--- aboot-1.0~pre20040408.orig/.cvsignore +++ aboot-1.0~pre20040408/.cvsignore @@ -0,0 +1,2 @@ +aboot +bootlx --- aboot-1.0~pre20040408.orig/Makefile +++ aboot-1.0~pre20040408/Makefile @@ -30,20 +30,23 @@ # # There shouldn't be any need to change anything below this line. # +TOP = $(shell pwd) LOADADDR = 20000000 -ABOOT_LDFLAGS = -static -N -Taboot.lds +ifndef $($(CC)) +CC = gcc +endif -CC = gcc -TOP = $(shell pwd) ifeq ($(TESTING),) -CPPFLAGS = $(CFGDEFS) -I$(TOP)/include -CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs -ffixed-8 +override CPPFLAGS += $(CFGDEFS) -I$(TOP)/include +override CFLAGS += $(CPPFLAGS) -D__KERNEL__ -mcpu=ev4 -Os -Wall -fno-builtin -Wcast-align -mno-fp-regs -ffixed-8 -fno-builtin-printf else -CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include -CFLAGS = $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8 +override CPPFLAGS += -DTESTING $(CFGDEFS) -I$(TOP)/include +override CFLAGS += $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8 endif -ASFLAGS = $(CPPFLAGS) + +ABOOT_LDFLAGS = -static -N -Taboot.lds +override ASFLAGS += $(CPPFLAGS) .c.s: @@ -80,6 +83,13 @@ netboot: vmlinux.bootp +bootloader.h: net_aboot.nh b2c + ./b2c net_aboot.nh bootloader.h bootloader + +netabootwrap: netabootwrap.c bootloader.h + $(CC) $@.c $(CFLAGS) -o $@ + + bootlx: aboot tools/objstrip tools/objstrip -vb aboot bootlx @@ -92,10 +102,10 @@ install: tools/abootconf tools/e2writeboot tools/isomarkboot \ sdisklabel/swriteboot install-man install -d $(bindir) $(bootdir) - install -c -s tools/abootconf $(bindir) - install -c -s tools/e2writeboot $(bindir) - install -c -s tools/isomarkboot $(bindir) - install -c -s sdisklabel/swriteboot $(bindir) + install -c tools/abootconf $(bindir) + install -c tools/e2writeboot $(bindir) + install -c tools/isomarkboot $(bindir) + install -c sdisklabel/swriteboot $(bindir) install -c bootlx $(bootdir) installondisk: bootlx sdisklabel/swriteboot @@ -113,6 +123,7 @@ cat net_aboot.nh $(VMLINUXGZ) net_pad > $@ net_aboot.nh: net_aboot tools/objstrip + strip net_aboot tools/objstrip -vb net_aboot $@ net_aboot: $(ABOOT_OBJS) $(ABOOT_OBJS) $(NET_OBJS) $(LIBS) @@ -124,7 +135,7 @@ clean: sdisklabel/clean tools/clean lib/clean rm -f aboot abootconf net_aboot net_aboot.nh net_pad vmlinux.bootp \ $(ABOOT_OBJS) $(DISK_OBJS) $(NET_OBJS) bootlx \ - include/ksize.h vmlinux.nh + include/ksize.h vmlinux.nh b2c bootloader.h netabootwrap distclean: clean find . -name \*~ | xargs rm -f --- aboot-1.0~pre20040408.orig/aboot.c +++ aboot-1.0~pre20040408/aboot.c @@ -19,14 +19,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include - #include -#include -#include +#include "hwrpb.h" +#include "system.h" +#include #include #include @@ -37,16 +36,6 @@ #include "utils.h" #include "string.h" -#ifndef elf_check_arch -# define aboot_elf_check_arch(e) 1 -#else -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -# define aboot_elf_check_arch(e) elf_check_arch(e) -# else -# define aboot_elf_check_arch(e) elf_check_arch(e->e_machine) -# endif -#endif - struct bootfs * bfs = 0; /* filesystem to boot from */ char * dest_addr = 0; jmp_buf jump_buffer; @@ -83,77 +72,101 @@ long first_block (const char *buf, long blocksize) { - struct elfhdr *elf; - struct elf_phdr *phdrs; + Elf64_Ehdr *elf; + Elf64_Phdr *phdrs; + int i, j; - elf = (struct elfhdr *) buf; + elf = (Elf64_Ehdr *) buf; - if (elf->e_ident[0] == 0x7f - && strncmp(elf->e_ident + 1, "ELF", 3) == 0) + if (elf->e_ident[0] != 0x7f + || elf->e_ident[1] != 'E' + || elf->e_ident[2] != 'L' + || elf->e_ident[3] != 'F') { - int i; - /* looks like an ELF binary: */ - if (elf->e_type != ET_EXEC) { - printf("aboot: not an executable ELF file\n"); - return -1; - } - if (!aboot_elf_check_arch(elf)) { - printf("aboot: ELF executable not for this machine\n"); - return -1; - } - if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) > (unsigned) blocksize) { - printf("aboot: " - "ELF program headers not in first block (%ld)\n", - (long) elf->e_phoff); - return -1; - } - phdrs = (struct elf_phdr *) (buf + elf->e_phoff); - chunks = malloc(sizeof(struct segment) * elf->e_phnum); - nchunks = elf->e_phnum; - start_addr = phdrs[0].p_vaddr; /* assume they are sorted */ - entry_addr = elf->e_entry; + /* Fail silently, it might be a compressed file */ + return -1; + } + if (elf->e_ident[EI_CLASS] != ELFCLASS64 + || elf->e_ident[EI_DATA] != ELFDATA2LSB + || elf->e_machine != EM_ALPHA) + { + printf("aboot: ELF executable not for this machine\n"); + return -1; + } + + /* Looks like an ELF binary. */ + if (elf->e_type != ET_EXEC) { + printf("aboot: not an executable ELF file\n"); + return -1; + } + + if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) > (unsigned) blocksize) + { + printf("aboot: " + "ELF program headers not in first block (%ld)\n", + (long) elf->e_phoff); + return -1; + } + + phdrs = (struct elf_phdr *) (buf + elf->e_phoff); + chunks = malloc(sizeof(struct segment) * elf->e_phnum); + start_addr = phdrs[0].p_vaddr; /* assume they are sorted */ + entry_addr = elf->e_entry; + #ifdef DEBUG - printf("aboot: %d program headers, start address %#lx, entry %#lx\n", - nchunks, start_addr, entry_addr); + printf("aboot: %d program headers, start address %#lx, entry %#lx\n", + elf->e_phnum, start_addr, entry_addr); #endif - for (i = 0; i < elf->e_phnum; ++i) { - int status; - chunks[i].addr = phdrs[i].p_vaddr; - chunks[i].offset = phdrs[i].p_offset; - chunks[i].size = phdrs[i].p_filesz; + for (i = j = 0; i < elf->e_phnum; ++i) { + int status; + + if (phdrs[i].p_type != PT_LOAD) + continue; + + chunks[j].addr = phdrs[i].p_vaddr; + chunks[j].offset = phdrs[i].p_offset; + chunks[j].size = phdrs[i].p_filesz; + #ifdef DEBUG - printf("aboot: segment %d vaddr %#lx offset %#lx size %#lx\n", - i, chunks[i].addr, chunks[i].offset, chunks[i].size); + printf("aboot: PHDR %d vaddr %#lx offset %#lx size %#lx\n", + i, chunks[j].addr, chunks[j].offset, chunks[j].size); #endif #ifndef TESTING - status = check_memory(chunks[i].addr, chunks[i].size); - if (status) { + status = check_memory(chunks[j].addr, chunks[j].size); + if (status) { + printf("aboot: Can't load kernel.\n" + " Memory at %lx - %lx (PHDR %i) " + "is %s\n", + chunks[j].addr, + chunks[j].addr + chunks[j].size - 1, + i, + (status == -ENOMEM) ? + "Not Found" : + "Busy (Reserved)"); + return -1; + } +#endif + + if (phdrs[i].p_memsz > phdrs[i].p_filesz) { + if (bss_size > 0) { printf("aboot: Can't load kernel.\n" - " Memory at %lx - %lx (chunk %i) " - "is %s\n", - chunks[i].addr, - chunks[i].addr + chunks[i].size - 1, - i, - (status == -ENOMEM) ? - "Not Found" : - "Busy (Reserved)"); + " Multiple BSS segments" + " (PHDR %d)\n", i); return -1; } -#endif + bss_start = (char *) (phdrs[i].p_vaddr + + phdrs[i].p_filesz); + bss_size = (phdrs[i].p_memsz - phdrs[i].p_filesz); } - bss_start = (char *) (phdrs[elf->e_phnum - 1].p_vaddr + - phdrs[elf->e_phnum - 1].p_filesz); - bss_size = (phdrs[elf->e_phnum - 1].p_memsz - - phdrs[elf->e_phnum - 1].p_filesz); + + j++; + } + nchunks = j; #ifdef DEBUG - printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size); + printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size); #endif - } else { - /* Fail silently, it might be a compressed file */ - return -1; - } return 0; } --- aboot-1.0~pre20040408.orig/aboot.lds +++ aboot-1.0~pre20040408/aboot.lds @@ -1,22 +1,25 @@ OUTPUT_FORMAT("elf64-alpha") ENTRY(__start) +PHDRS { kernel PT_LOAD; } SECTIONS { . = 0x20000000; - .text : { *(.text) } + .text : { *(.text) } :kernel _etext = .; PROVIDE (etext = .); - .rodata : { *(.rodata) } - .data : { *(.data) CONSTRUCTORS } - .got : { *(.got) } - .sdata : { *(.sdata) } + .rodata : { *(.rodata) } :kernel + .data : { *(.data) } :kernel + .got : { *(.got) } :kernel + .sdata : { *(.sdata) } :kernel _edata = .; PROVIDE (edata = .); - .sbss : { *(.sbss) *(.scommon) } - .bss : { *(.bss) *(COMMON) } + .sbss : { *(.sbss) *(.scommon) } :kernel + .bss : { *(.bss) *(COMMON) } :kernel _end = . ; PROVIDE (end = .); + /DISCARD/ : { *(.eh_frame) } + .mdebug 0 : { *(.mdebug) } .note 0 : { *(.note) } .comment 0 : { *(.comment) } --- aboot-1.0~pre20040408.orig/b2c.c +++ aboot-1.0~pre20040408/b2c.c @@ -0,0 +1,70 @@ + + +#include +#include +#include +#include +#include + +void print_usage(void ) +{ + printf("Usage: b2c bin_img tar_file.h symname\n"); + exit(1); +} + +void open_file(char *fn, int *fd, int *sz) +{ + struct stat buf; + + *fd = open(fn, O_RDONLY); + if (fd < 0) { + printf("cannot open %s\n", fn); + exit(1); + } + + fstat(*fd, &buf); + + if (buf.st_size <= 10*1024) { + printf("Is this a right file %s, size = %ld\n", fn, buf.st_size); + exit(1); + } + + *sz = (int)buf.st_size; +} + +int main(int argc, char **argv) +{ + int sfd, ssz, red, i; + int buf[1024]; + char *sfn, *tfn, *symname; + FILE *tfd; + + if (argc != 4) { + print_usage(); + } + + sfn = argv[1]; + tfn = argv[2]; + symname = argv[3]; + + open_file(sfn, &sfd, &ssz); + + tfd = fopen(tfn, "w"); + + fprintf(tfd, "int %s[] = {\n", symname); + + while((red=read(sfd, buf, 1024*sizeof(int)))) { + for (i=0; i #include -#include -#include +#include "hwrpb.h" +#include "system.h" #include "aboot.h" #include "cons.h" @@ -20,7 +20,6 @@ #endif long cons_dev; /* console device */ -extern long int dispatch(); /* Need the full 64 bit return here...*/ long cons_puts(const char *str, long len) --- aboot-1.0~pre20040408.orig/debian/README.Debian +++ aboot-1.0~pre20040408/debian/README.Debian @@ -0,0 +1,37 @@ +aboot for Debian +---------------- + +This package was originally created by Jeff Noxon , +and was then maintained by Greg Johnson +and later by Helge Kreutzmann . The current +maintainer is Steve Langasek . + +The last upstream maintainers were Will Woods and +Chris Lumens . + +The aboot package includes code from the milo source tree (srmbootfat +and srmbootraw) on request by the d-i; I have not tested it. You can get +the full source from: +http://milo.coresystems.de/source/milo-2.2-18.tar.bz2 + +For architectures other than alpha, the aboot-cross package contains +isomarkboot and srmbootfat required to create bootable images in d-i. +On alpha these are contained in the aboot package. Since they are +architecture independent but not heavily tested on non-alpha archs use +with proper care and please *report bugs* if they don't work on your +favourite architecture! + +Notes for backporting +--------------------- +If you want to update your kernel in Etch beyond 2.6.22 (i.e. 2.6.23-rcX or +later) you cannot use the aboot package supplied in Etch. Simply compiling +the Lenny version in an Etch system does not work either. To backport a +current aboot, do either one of the following (untested, but should work): + +- grab the aboot-base package from unstable, which is arch: all and has no + dependencies, and install it without worrying about the aboot package; the + bootloader itself is contained in aboot-base, so that should be sufficient + to get you a working 2.6.23 (or later) boot. +- install linux-libc-dev from unstable, and build the package against that + instead of the linux-kernel-headers included in etch. + --- aboot-1.0~pre20040408.orig/debian/TODO +++ aboot-1.0~pre20040408/debian/TODO @@ -0,0 +1,18 @@ +* Better documentation: + - Remove upstream README when something more up-to-date is written + +* Fix WARNINGS and possibly improve CFLAGS for isomarkboot + +* clean up our rules file/better integrate with upstream + +* Proper solution for the policy violation (dependency of aboot on the + priority optional packet aboot-base) + +* Proper i18n of man pages, possibly using po4a + +* Where appropriate, use gettext to localize messages (e.g. abootconf) + +* Do other distributions supporting alpha (e.g. gentoo) have some + "interesting" patches? + +* Integrate netabootwrap in SRM-HOWTO --- aboot-1.0~pre20040408.orig/debian/aboot-base.dirs +++ aboot-1.0~pre20040408/debian/aboot-base.dirs @@ -0,0 +1 @@ +boot --- aboot-1.0~pre20040408.orig/debian/aboot-base.doc-base +++ aboot-1.0~pre20040408/debian/aboot-base.doc-base @@ -0,0 +1,12 @@ +Document: srm-howto +Title: SRM Firmware Howto +Author: Rich Payne and David Huggins-Daines +Abstract: This document describes how to boot Linux/Alpha using the + SRM console, which is the console firmware also used to boot HP Tru64 Unix + (also known as Digital Unix and OSF/1) and OpenVMS. +Section: System/Administration + +Format: HTML +Index: /usr/share/doc/aboot-base/SRM-HOWTO/index.html +Files: /usr/share/doc/aboot-base/SRM-HOWTO/*.html + --- aboot-1.0~pre20040408.orig/debian/aboot-base.docs +++ aboot-1.0~pre20040408/debian/aboot-base.docs @@ -0,0 +1,2 @@ +README +doc/faq/SRM-HOWTO --- aboot-1.0~pre20040408.orig/debian/aboot-cross.dirs +++ aboot-1.0~pre20040408/debian/aboot-cross.dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/doc/aboot-cross +usr/sbin --- aboot-1.0~pre20040408.orig/debian/aboot-cross.docs +++ aboot-1.0~pre20040408/debian/aboot-cross.docs @@ -0,0 +1 @@ +README --- aboot-1.0~pre20040408.orig/debian/aboot-cross.manpages +++ aboot-1.0~pre20040408/debian/aboot-cross.manpages @@ -0,0 +1,4 @@ +doc/man/isomarkboot.1 +srmbootfat/srmbootfat.1 +doc/man/de/isomarkboot.de.1 +doc/man/de/srmbootfat.de.1 --- aboot-1.0~pre20040408.orig/debian/aboot.dirs +++ aboot-1.0~pre20040408/debian/aboot.dirs @@ -0,0 +1,5 @@ +sbin +usr/share/doc/aboot +usr/bin +usr/share/aboot +boot --- aboot-1.0~pre20040408.orig/debian/aboot.docs +++ aboot-1.0~pre20040408/debian/aboot.docs @@ -0,0 +1 @@ +README --- aboot-1.0~pre20040408.orig/debian/aboot.manpages +++ aboot-1.0~pre20040408/debian/aboot.manpages @@ -0,0 +1,5 @@ +srmbootfat/srmbootraw.8 +doc/man/isomarkboot.1 +doc/man/netabootwrap.1 +srmbootfat/srmbootfat.1 +doc/man/de/*.de.? --- aboot-1.0~pre20040408.orig/debian/aboot.postinst +++ aboot-1.0~pre20040408/debian/aboot.postinst @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ ! -e /etc/aboot.conf ]; then + cp -a /usr/share/aboot/aboot.conf /etc/ +fi + +#DEBHELPER# --- aboot-1.0~pre20040408.orig/debian/changelog +++ aboot-1.0~pre20040408/debian/changelog @@ -0,0 +1,302 @@ +aboot (1.0~pre20040408-4) unstable; urgency=low + + * Add Vcs-Bzr field to debian/control. + * Add headers needed for size_t and other types with recent + linux-libc-dev. + * Pull in include/linux/ext2_fs.h from the Linux 3.2.46 source, since it's + no longer included in linux-libc-dev and recent versions are much less + userspace-friendly. + * fs/ufs.c, include/ufs.h: replace undefined types with the modern kernel + types. + * tools/objstrip.c: fix elf structure definitions. + * tools/isomarkboot.c: avoid mixing kernel and libc headers. + Closes: #652598. + * Correct accidental revert of upstream sources in 1.0~pre20040408. + Closes: #524916. + * Replace mkisofs with genisoimage in Suggests. Closes: #601260. + * Fix debian/control to use ${misc:Depends} everywhere. Thanks to + Benjamin Kerensa for the patch. Closes: #692636. + * Update debian/copyright to copyright-format 1.0. + * Modernize debian/rules: debhelper 9, dh(1). + * Add rough support for cross-building. + * Split sgmtools-lite into Build-Depends-Indep. + * Use Breaks/Replaces instead of Conflicts for historical replaces. + * Fix the doc-base section. + * Bump to Standards-Version 3.9.3; no changes required. + + -- Steve Langasek Sun, 06 Oct 2013 23:35:32 -0700 + +aboot (1.0~pre20040408-3) unstable; urgency=low + + [ Helge Kreutzmann ] + * Fix wrong sync from alioth for aboot.conf.(sgml|5), e2writeboot.8, + swriteboot.8 + * debian/control: Move section to admin to match overrides + * Remove incorrect isomarkboot.8 (as upstream did), this is in section 1 + * Update my e-mail address also in every man page (where applicable) + * Slightly improve debian/rules + * Add a note for people intending to recompile aboot on stable (Etch) + * Update TODO + * Update download location of milo in appropriate READMEs + * Bump standards version to 3.7.3.0 (no changes required) + + [ Steve Langasek ] + * Drop the reference to asm/page.h from zip/main.c since it isn't actually + needed, fixing a build failure with current linux-libc-dev; thanks to + Philipp Benner for pointing out the obvious + fix. Closes: #480364. + * disk.c: drop reference to asm/elf.h. + * tools/objstrip.c: drop reference to asm/elf.h; use a.out.h instead + of linux/a.out.h, which is no longer provided by the kernel; and + include a copy of the elf_check_arch() define from the old asm/elf.h + in the event that we're building against recent kernel headers. + * tools/elfencap.c: there is only one right answer for each of ELF_CLASS, + ELF_DATA, and ELF_ARCH; reference these values directly, for + compatibility with linux-libc-dev 2.6.24 and above. + * Take over from Helge as maintainer; thanks for all your work! + Closes: #315592. + + -- Steve Langasek Mon, 02 Jun 2008 09:33:19 -0700 + +aboot (1.0~pre20040408-2) unstable; urgency=low + + * Include userspace headers from lib/isolib.c instead of kernel + headers; this isn't kernel code anyway, and the kernel headers don't + work right on i386 the way they're being used. + + -- Steve Langasek Wed, 22 Aug 2007 20:29:59 -0700 + +aboot (1.0~pre20040408-1) unstable; urgency=low + + [ Steve Langasek ] + * New upstream version, pulled from CVS snapshot. + * Drop separate faq-src directory, now merged upstream as doc/faq + * Fix header references in multiple files, and import a local copy of + asm-alpha/pal.h and asm-alpha/system.h from the kernel sources for + use by head.S and aboot.c, for the switch to linux-libc-dev in + lenny. Closes: #437296. + * Update debian/rules to use DEB_HOST_GNU_CPU instead of + DEB_HOST_GNU_TYPE, to fix a misbuild in unstable. + * Fix wrong manpage section for srmbootraw(8) in the clean target + * Update bootlx to ignore ELF header sections not of type PT_LOAD when + loading the kernel, so that the new PT_NOTE sections in 2.6.23rc1 and + above don't cause load failures. Thanks to Richard Henderson for the + patch. Closes: #438431. + * Drop unneeded build-dependency on linux-kernel-headers, which is + build-essential. + + [ Helge Kreutzmann ] + * Fix minor typos in German man pages. + * Update my e-mail address in debian related files + * Do not ignore errors in clean targets (thanks, lintian) + * Bump standards version to 3.7.2.2 + * Bump dephelper level to 5 + + -- Steve Langasek Wed, 22 Aug 2007 14:31:26 -0700 + +aboot (0.9b-3) unstable; urgency=low + + * Synced man pages with upstream: aboot.conf.sgml, aboot.sgml, + abootconf.sgml, e2writeboot.8, isomarkboot.sgml, sdisklabel.sgml, + swriteboot.8. + * Took german translation of man pages from upstream. + * Minor code issues synced from upstream CVS (partially for testing + builds). Closes: #258594. + * Include patch to make isomarkboot endian-safe. Thanks to Steve McIntyre, + Closes: #253846. + * Add netabootwrap man page (english and german). + * Fix netabootwrap so that it stops claiming to be bootp. + + -- Helge Kreutzmann Mon, 12 Jul 2004 17:02:10 +0200 + +aboot (0.9b-2) unstable; urgency=low + + * Actually install the netabootwrap binary so that people can use it + (really-closes: #127303). + + -- Steve Langasek Sat, 8 May 2004 16:20:42 -0500 + +aboot (0.9b-1) unstable; urgency=low + + * New maintainer. + * Build all our tools with "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64", + so they can handle accessing files > 4GB (e.g., DVD images for + isomarkboot) (closes: #228235). + * Include patch from Chris Lumens (upstream) for building with + additional flags (e.g. "-g"). + * Enable noopt in DEB_BUILD_OPTIONS build with "-g" always for now; also + stripping can be disabled now. + * Enable the all-package to be build on non-alpha archs as well + (typo & thinko in debian/rules). + * FOREIGN for building on non-alpha archs is gone, it was not necessary. + * Conflict aboot with aboot-cross as the latter package + is no longer build on Alpha but contained in aboot. + * Fixed dependencies (dropped woody only docbook2man) + * Added SRM-HOWTO (and updated description) built from SGML sources and + added into doc-base. + * Removed source diff target in rules file + * Turn off DH_VERBOSE, so our builds are a bit more palatable + * Don't forget to create the 'boot' directory in the install target + * Fix the srmbootfat manpage's section (8->1) + * Updated TODO list. + * Improved & split man pages for srmbootfat/srmbootraw. + * Clarified copyright (we are using a stable upstream release). + * Slightly updated isomarkboot.sgml + * Include netboot patch from + Soohoon Lee (closes: #127303). + + -- Steve Langasek Mon, 3 May 2004 19:43:19 -0500 + +aboot (0.9b-0.3) unstable; urgency=low + + * Non-maintainer upload. + * Fix package split so that aboot-cross isn't needed on alpha, + and aboot-base isn't attempted on non-alpha systems (in spite of + being arch: all). + * Put srmbootfat and isomarkboot both in /usr/bin, for consistency. + * Fix package priorities/sections to match archive overrides. + * Reorder headers in lib/isolib.c, needed for building on i386. + * Change aboot.conf from a conffile to maintainer script-managed + config file, so that aboot-installer can do its job. + + -- Steve Langasek Sun, 4 Jan 2004 17:03:46 -0600 + +aboot (0.9b-0.2) unstable; urgency=low + + * Non-maintainer upload. + * Change the order of docbook2man and docbook-utils in the + build-depends list, to satisfy the autobuilders. Closes: #225938 + + -- Steve Langasek Sun, 4 Jan 2004 13:51:35 -0600 + +aboot (0.9b-0.1) unstable; urgency=low + + * NMU. + * Upgraded to 0.9b. + * Switched from dh_installmanpages to dh_installman. + * Included latest version of all man pages. Closes: #57804 + * All man pages are now created at build time from their sgml source. + * Updated README.Debian -- upstream maintainer is now Will Woods -- and + copyright -- home page is sourceforge now --. + * Move isomarkboot to /usr/bin and the manpage into section 1 + * Include upstream changelog + * Upgraded to standards version 3.6.1.0. Partially support DEB_BUILD_OPTIONS. + * Split package into three packages to enable isomarkboot to be used on + other archs (e.g. for d-i); since we run into conflicts with two + packages three were needed, where aboot-base just contains common files + needed for booting (which need to be built on alpha). Closes: #211777 + * We depend on "linux-kernel-headers" to properly build isomarkboot, + patched "include/utils.h" to properly include the "asm"-headers + * Patched "lib/Makefile" to only use "no-fp-regs" for isomarkboot if + building for alpha + * Added srmbootfat and srmbootraw from the milo package + http://www.suse.de/~stepan/source/milo-2.2-18.tar.bz2 + The man page was slightly updated (spell checking, formatting, SEE ALSO). + Closes: #173620 + Applied a patch from Falk Hueffner + to get_fat_entry in srmbootfat/srmbootfat.c to make it portable + * Stole patches from CVS HEAD/Jeff.Wiedemeier@hp.com for USB console and + to check kernel memory against console memory descriptors. + These two patches should allow booting on Wildfire. + * Disable check for vol-set-size in lib/isolib.c as sets of volumes are + perfectly fine. For explanation of this term, see e.g. section 4.16 and + 4.17 in http://www.y-adagio.com/public/standards/iso_cdromr/sect_1.htm + Closes: #149840 + * Added extra-args patch from RedHat/Will Wood to allow calls like + dka0 -fl "0 console=ttyS0" + This will be in the next official aboot release as well. + + -- Helge Kreutzmann Sat, 13 Dec 2003 18:32:43 +0100 + +aboot (0.9-1.1) unstable; urgency=low + + * NMU. + * Use -fno-builtin-printf when compiling, so we don't end up with + references to gcc's implementation. Closes: 205864 + + -- Steve Langasek Sat, 23 Aug 2003 18:04:48 -0500 + +aboot (0.9-1) unstable; urgency=low + + * New upstream release. Closes: #117973 + + -- Gregory W. Johnson Sun, 11 Nov 2001 23:19:00 -0500 + +aboot (0.8-1) unstable; urgency=low + + * New upstream (from CVS) + * I am calling this version of aboot from CVS 0.8. + * Minor tweeks to make it compile with kernel 2.4.x headers. + * e2writeboot now returns non-zero on error. Closes: #107757 + + -- Gregory W. Johnson Wed, 15 Aug 2001 01:55:36 -0400 + +aboot (0.7a-1) unstable; urgency=low + + * New upstream release + * added Build-Depends line to debian/control. Closes: #70114 + + -- Gregory W. Johnson Fri, 8 Sep 2000 15:57:32 -0400 + +aboot (0.7-1) frozen unstable; urgency=low + + * New upstream release + * Needed for potato boot-floppies + + -- Gregory W. Johnson Thu, 4 May 2000 15:48:25 -0400 + +aboot (0.6a-1) frozen unstable; urgency=low + + * New upstream version. + * Updated README.Debian. Closes: #57803 + + -- Gregory W. Johnson Mon, 27 Mar 2000 00:46:39 -0500 + +aboot (0.5-5) unstable; urgency=low + + * Added "ext2" patch form RedHat aboot for new style ext2 + filesystems. Closes: #54388 + * Added "big" patch from RedHat aboot. + * Closes: #34109, #34368: previously fixed -- see below. + + -- Gregory W. Johnson Wed, 12 Jan 2000 01:26:26 -0500 + +aboot (0.5-4) unstable; urgency=low + + * Adopted package from Jeff. + * Updated to FHS (/usr/doc -> /usr/share/doc) + * Added patch from Jay Estabrook (via RedHat) for volumes larger than + 2GB. + + -- Gregory W. Johnson Fri, 1 Oct 1999 01:40:58 -0400 + +aboot (0.5-3) unstable; urgency=low + + * Included patches from Loic Prylli, closing #34109: + - A bug fix in isolib.c which could cause isomarkboot to segfault (and + probably also bootlx to have undefined behaviour at run-time), if a + directory entry is in the middle of a 2k block. + - A bug fix for sdisklabel whcih segfault when called with only one + argument + - some more functionality in isomarkboot to set a offset to a root + filesystem image in the CD in the application_data fied of the first + volume descriptor. + * Increase maximum partitions from 8 to 16 + * Include sdisklabel in package (fixes #34368) + + -- Jefferson E. Noxon Thu, 11 Mar 1999 17:05:12 -0600 + +aboot (0.5-2) unstable; urgency=low + + * Several bugfixes. + * Included objdump from kernel sources. + * Now works with binutils >= 2.9. + * Cleaned up debian/rules and build process. + + -- Jefferson E. Noxon Mon, 12 Oct 1998 12:04:43 -0500 + +aboot (0.5-1) unstable; urgency=low + + * Initial release. + + -- Jefferson E. Noxon Sat, 3 Oct 1998 16:31:50 -0500 --- aboot-1.0~pre20040408.orig/debian/compat +++ aboot-1.0~pre20040408/debian/compat @@ -0,0 +1 @@ +9 --- aboot-1.0~pre20040408.orig/debian/control +++ aboot-1.0~pre20040408/debian/control @@ -0,0 +1,44 @@ +Source: aboot +Build-Depends: debhelper (>= 9), sp, sgmlspl, docbook-utils +Build-Depends-Indep: sgmltools-lite +Section: admin +Priority: standard +Maintainer: Steve Langasek +Standards-Version: 3.9.3 +Vcs-Bzr: http://bzr.debian.org/bzr/pkg-aboot/aboot/branches/debian/ + +Package: aboot +Architecture: alpha +Depends: ${shlibs:Depends}, ${misc:Depends}, aboot-base +Conflicts: aboot-cross +Description: Linux bootloader for the SRM console + This is the standard Linux bootloader for machines with SRM firmware + installed. If you're using ARC or AlphaBIOS, you have to use MILO + instead. + . + Aboot allows booting from hard disk, CD-ROM, and floppy. It also + provides what you need to make kernel images that can be booted over + a network using BOOTP/TFTP. + +Package: aboot-cross +Architecture: any +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends}, aboot-base +Breaks: aboot (<< 0.9-1.2) +Replaces: aboot (<< 0.9-1.2) +Suggests: genisoimage +Description: utility to create bootable ISO-Images for Linux/Alpha + If you want to create bootable CD-ROMs or floppies for the Linux/Alpha + platform, you need this utility. It is not needed for normal system + installation or operation. + +Package: aboot-base +Priority: optional +Architecture: all +Depends: ${misc:Depends} +Conflicts: aboot (<< 0.9-1.2) +Description: base files required for bootable media on Linux/Alpha + This package contains the files to create bootable media for Linux/Alpha. + No binaries are included to enable any architecture to use these files. + . + Also a current version of the SRM-FAQ is included. --- aboot-1.0~pre20040408.orig/debian/copyright +++ aboot-1.0~pre20040408/debian/copyright @@ -0,0 +1,58 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: aboot +Source: http://www.sf.net/projects/aboot + +Files: * +Copyright: 1990,1991,1993 Arizona Board of Regents + 1991-1992,1996 Linus Torvalds + 1992-1993 Jean-loup Gailly + 1992-1995 Remy Card (card@masi.ibp.fr) + 1993 Hannu Savolainen + 1995-1996 David Mosberger-Tang + 1995 Alain Knaff + 1996 Dave Larson + 1996 Michael Schwingen + 1998 Nikita Schmidt + 2000 David Huggins-Daines + 2001-2004 Will Woods + 2008-2013 Steve Langasek +License: GPL-2+ + +Files: fs/ufs.c include/ufs.h +Copyright: 1993 Carnegie Mellon University +License: BSD-2-Clause-CMU + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + On Debian systems, the complete text of the GNU General Public License + can be found in `/usr/share/common-licenses/GPL'. + +License: BSD-2-Clause-CMU + Permission to use, copy, modify and distribute this software and its + documentation is hereby granted, provided that both the copyright + notice and this permission notice appear in all copies of the + software, derivative works or modified versions, and any portions + thereof, and that both notices appear in supporting documentation. + . + CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + . + Carnegie Mellon requests users of this software to return to + . + Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + School of Computer Science + Carnegie Mellon University + Pittsburgh PA 15213-3890 + . + any improvements or extensions that they make and grant Carnegie Mellon + the rights to redistribute these changes. --- aboot-1.0~pre20040408.orig/debian/rules +++ aboot-1.0~pre20040408/debian/rules @@ -0,0 +1,75 @@ +#!/usr/bin/make -f + +DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +export DEB_CPPFLAGS_MAINT_APPEND = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +export DEB_CFLAGS_MAINT_APPEND = -Wall + +CC ?= gcc +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + CC = $(DEB_HOST_GNU_TYPE)-$(CC) +endif + +ifeq (alpha,$(DEB_HOST_GNU_CPU)) + export DH_OPTIONS=-Naboot-cross +else + export DH_OPTIONS=-paboot-cross +endif + +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + LDFLAGS += +s +# TESTING = "TESTING=yes" + CPPFLAGS += "-O0" +endif + +%: + dh $@ + +override_dh_auto_build: +ifeq (alpha,$(DEB_HOST_GNU_CPU)) + $(MAKE) $(TESTING) all netabootwrap CC=$(CC) $(shell dpkg-buildflags --export=configure) + $(MAKE) -C doc/man all + $(MAKE) -C doc/man/de all + $(MAKE) -C srmbootfat all CC=$(CC) $(shell dpkg-buildflags --export=configure) +ifneq (,$(filter aboot-base, $(shell dh_listpackages))) + $(MAKE) $(TESTING) bootlx net_aboot.nh net_pad CC=$(CC) $(shell dpkg-buildflags --export=configure) + $(MAKE) -C doc/faq +endif +else + $(MAKE) -C tools $(TESTING) isomarkboot CC=$(CC) $(shell dpkg-buildflags --export=configure) + $(MAKE) -C srmbootfat srmbootfat srmbootfat.1 CC=$(CC) $(shell dpkg-buildflags --export=configure) + $(MAKE) -C doc/man isomarkboot.1 + $(MAKE) -C doc/man/de isomarkboot.de.1 srmbootfat.de.1 +endif + +override_dh_auto_clean: + $(MAKE) distclean + $(MAKE) -C doc/man clean + $(MAKE) -C doc/man/de clean + $(MAKE) -C doc/faq clean + $(MAKE) -C srmbootfat clean + +override_dh_auto_install: +ifeq (alpha,$(DEB_HOST_GNU_CPU)) +ifneq (,$(filter aboot, $(shell dh_listpackages))) + $(MAKE) root=`pwd`/debian/aboot install + install -m 644 aboot.conf debian/aboot/usr/share/aboot/aboot.conf + mv debian/aboot/sbin/isomarkboot debian/aboot/usr/bin/ + install -m 755 sdisklabel/sdisklabel debian/aboot/sbin/sdisklabel + install -m 755 srmbootfat/srmbootraw debian/aboot/sbin/srmbootraw + install -m 755 srmbootfat/srmbootfat debian/aboot/usr/bin/ + install -m 755 netabootwrap debian/aboot/usr/bin/ + rm -rf debian/aboot/boot + rm -rf debian/aboot/usr/share/man/man1 +endif +else + install -m 755 tools/isomarkboot debian/aboot-cross/usr/bin + install -m 755 srmbootfat/srmbootfat debian/aboot-cross/usr/bin +endif +ifneq (,$(filter aboot-base, $(shell dh_listpackages))) + install -m 644 bootlx debian/aboot-base/boot/bootlx + install -m 644 net_aboot.nh debian/aboot-base/boot/ + install -m 644 net_pad debian/aboot-base/boot/ +endif --- aboot-1.0~pre20040408.orig/disk.c +++ aboot-1.0~pre20040408/disk.c @@ -35,8 +35,7 @@ #include #include -#include -#include +#include "system.h" extern struct bootfs ext2fs; extern struct bootfs iso; --- aboot-1.0~pre20040408.orig/doc/faq/.cvsignore +++ aboot-1.0~pre20040408/doc/faq/.cvsignore @@ -0,0 +1 @@ +*.html --- aboot-1.0~pre20040408.orig/doc/faq/Makefile +++ aboot-1.0~pre20040408/doc/faq/Makefile @@ -6,3 +6,4 @@ SRM-HOWTO/index.html : SRM-HOWTO.sgml sgmltools --backend=html SRM-HOWTO.sgml +#.PHONY clean --- aboot-1.0~pre20040408.orig/doc/man/Makefile +++ aboot-1.0~pre20040408/doc/man/Makefile @@ -10,17 +10,42 @@ else MANDIR=$(mandir) endif +MAN1=$(MANDIR)/man1 MAN5=$(MANDIR)/man5 MAN8=$(MANDIR)/man8 -default: +all: aboot.8 aboot.conf.5 abootconf.8 isomarkboot.1 sdisklabel.8 netabootwrap.1 install: - install -d $(MAN5) $(MAN8) + install -d $(MAN1) $(MAN5) $(MAN8) + install -c isomarkboot.1 netabootwrap.1 $(MAN1) install -c aboot.conf.5 $(MAN5) - install -c aboot.8 abootconf.8 e2writeboot.8 swriteboot.8 $(MAN8) + install -c aboot.8 abootconf.8 e2writeboot.8 swriteboot.8 sdisklabel.8 $(MAN8) install-gz: install + gzip -f9 $(MAN1)/isomarkboot.1 $(MAN1)/netabootwrap.1 gzip -f9 $(MAN5)/aboot.conf.5 gzip -f9 $(MAN8)/aboot.8 $(MAN8)/abootconf.8 $(MAN8)/e2writeboot.8 \ - $(MAN8)/swriteboot.8 + $(MAN8)/swriteboot.8 $(MAN8)/sdisklabel.8 install-gzip: install-gz + +clean: + rm -f aboot.8 aboot.conf.5 abootconf.8 isomarkboot.1 sdisklabel.8 netabootwrap.1 manpage.log manpage.links manpage.refs + +aboot.8: aboot.sgml + nsgmls aboot.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +aboot.conf.5: aboot.conf.sgml + nsgmls aboot.conf.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +abootconf.8: abootconf.sgml + nsgmls abootconf.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +isomarkboot.1: isomarkboot.sgml + nsgmls isomarkboot.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +netabootwrap.1: netabootwrap.sgml + nsgmls netabootwrap.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +sdisklabel.8: sdisklabel.sgml + nsgmls sdisklabel.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + --- aboot-1.0~pre20040408.orig/doc/man/aboot.conf.sgml +++ aboot-1.0~pre20040408/doc/man/aboot.conf.sgml @@ -31,11 +31,9 @@ In the following example the kernels reside on a different partition (hda4) -then / belongs to (hda5) while in the fourth +then / belongs to (hda5), while in the fifth line /boot is on the same partition (hda6) as -/. +/. Therefore aboot.conf can be located on any of the three partitions but always in a directory etc at the top level of the file system on that @@ -77,7 +75,7 @@ After the slash the name of the kernel to boot is given, including a possible path. If your kernel does not reside on a file system but is located directly -after aboot at the beginning of the hard disk +after aboot(8) at the beginning of the hard disk you would omit the number, the slash and the kernel name. @@ -98,11 +96,11 @@ AUTHOR This man page was written by Helge Kreutzmann -kreutzm@itp.uni-hannover.de for the Debian GNU/Linux project but +debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. SEE ALSO -aboot(8), abootconf(8), swriteboot(8), HP SRM Manual +aboot(8), abootconf(8), swriteboot(8), HP SRM Manual () --- aboot-1.0~pre20040408.orig/doc/man/aboot.sgml +++ aboot-1.0~pre20040408/doc/man/aboot.sgml @@ -39,13 +39,13 @@ at the SRM-Prompt where dka0 has to be replaced by the device used. -In the interactive mode you can use the command h to show your current +In the interactive mode you can use the command l to show your current etc/aboot.conf and then the appropriate number (or a complete boot command as in SRM) to boot Linux. If you do not want to use the etc/aboot.conf as set -up by abootconf you can explicitly tell +up by abootconf(8) you can explicitly tell aboot where to look for etc/aboot.conf by prepending the number of the configuration with the proper partition, i.e. if your etc/aboot.conf is on your second partition and you want to boot the entry labeled three you would @@ -67,7 +67,7 @@ AUTHOR This man page was written by Helge Kreutzmann -kreutzm@itp.uni-hannover.de for the Debian GNU/Linux project +debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. @@ -78,6 +78,6 @@ SEE ALSO abootconf(8), aboot.conf(5), -swriteboot(8), HP SRM Manual +swriteboot(8), HP SRM Manual () --- aboot-1.0~pre20040408.orig/doc/man/abootconf.sgml +++ aboot-1.0~pre20040408/doc/man/abootconf.sgml @@ -99,7 +99,7 @@ Note that you have to rerun abootconf if you updated -aboot. +aboot(8). Strictly speaking abootconf is not necessary as @@ -129,13 +129,13 @@ AUTHOR -This man page was written by Helge Kreutzmann kreutzm@itp.uni-hannover.de for the Debian GNU/Linux project but may be used by others. +This man page was written by Helge Kreutzmann debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. FILES etc/aboot.conf SEE ALSO -aboot(8), swriteboot(8), aboot.conf(5), HP SRM Manual +aboot(8), swriteboot(8), aboot.conf(5), HP SRM Manual () --- aboot-1.0~pre20040408.orig/doc/man/de/Makefile +++ aboot-1.0~pre20040408/doc/man/de/Makefile @@ -0,0 +1,46 @@ +all: srmbootraw.de.8 aboot.de.8 aboot.conf.de.5 abootconf.de.8 isomarkboot.de.1 sdisklabel.de.8 srmbootfat.de.1 e2writeboot.de.8 swriteboot.de.8 netabootwrap.de.1 + +aboot.de.8: aboot.sgml + nsgmls aboot.sgml | sgmlspl docbook2man-de-spec.pl + mv aboot.8 aboot.de.8 + +aboot.conf.de.5: aboot.conf.sgml + nsgmls aboot.conf.sgml | sgmlspl docbook2man-de-spec.pl + mv aboot.conf.5 aboot.conf.de.5 + +abootconf.de.8: abootconf.sgml + nsgmls abootconf.sgml | sgmlspl docbook2man-de-spec.pl + mv abootconf.8 abootconf.de.8 + +netabootwrap.de.1: netabootwrap.sgml + nsgmls netabootwrap.sgml | sgmlspl docbook2man-de-spec.pl + mv netabootwrap.1 netabootwrap.de.1 + +isomarkboot.de.1: isomarkboot.sgml + nsgmls isomarkboot.sgml | sgmlspl docbook2man-de-spec.pl + mv isomarkboot.1 isomarkboot.de.1 + +sdisklabel.de.8: sdisklabel.sgml + nsgmls sdisklabel.sgml | sgmlspl docbook2man-de-spec.pl + mv sdisklabel.8 sdisklabel.de.8 + +srmbootfat.de.1: srmbootfat.sgml + nsgmls srmbootfat.sgml | sgmlspl docbook2man-de-spec.pl + mv srmbootfat.1 srmbootfat.de.1 + +srmbootraw.de.8: srmbootraw.sgml + nsgmls srmbootraw.sgml | sgmlspl docbook2man-de-spec.pl + mv srmbootraw.8 srmbootraw.de.8 + +e2writeboot.de.8: e2writeboot.8 + ln -s e2writeboot.8 e2writeboot.de.8 + +swriteboot.de.8: swriteboot.8 + ln -s swriteboot.8 swriteboot.de.8 + +clean : + rm -f *.html *.de.? srmbootraw.8 srmbootfat.1 sdisklabel.8 isomarkboot.8 abootconf.8 aboot.conf.5 aboot.8 netabootwrap.1 manpage.links manpage.log manpage.refs + rm -rf SRM-HOWTO + + +#.PHONY clean --- aboot-1.0~pre20040408.orig/doc/man/de/aboot.conf.sgml +++ aboot-1.0~pre20040408/doc/man/de/aboot.conf.sgml @@ -0,0 +1,108 @@ + + + + +aboot.conf +5 +aboot.conf + + + +aboot.conf +Die Konfigurationsdatei für aboot(8) + + + +BESCHREIBUNG + +aboot.conf +aboot.conf enthält eine Liste von Boot-Einstellungen +für aboot(8). Jede Boot-Einstellung hat eine +eindeutige Zahl, die am SRM-Prompt angegeben werden kann. +SRM. + + +aboot.conf muß sich in einem Verzeichnis names +etc auf der gleichen Partition +wie Ihre Kernel befinden, es sei den, Sie geben explizit die Partition +für Ihre Kernel an (siehe dazu die Ausführungen weiter unten). Falls Sie +also eine seperate Boot-Partition (namens /boot) +erzeugen, dann sollte aboot.conf in +/boot/etc/ liegen. + + +Im folgenden Beispiel liegen die Kernel auf einer anderen Partition (hda4) +als / (hda5), während in der fünften Zeile +/boot auf der gleichen Partition (hda6) wie +/ liegt. Daher kann sich aboot.conf +auf einer der drei Partitionen befinden, muß aber immer +in einem Verzeichnis namens etc relativ zur obersten +Verzeichnisebene auf dieser Partition angelegt sein. Die zu verwendene +Partition können Sie mittels abootconf(8) +ändern. + + +BEISPIEL <filename>aboot.conf</filename> +
+ +0:4/vmlinuz root=/dev/hda5 +1:4/vmlinuz root=/dev/hda5 single +2:4/vmlinuz.old ro root=/dev/hda5 +3:4/vmlinuz-2.4.9-32 root=/dev/sdc3 initrd=/initrd-2.4.9-32.img console=tty0 +8:6/boot/vmlinuz ro root=/dev/hda6 + +
+
+ +Die erste Zahl ist ein eindeutige Identifikation für jede Boot-Konfiguration. +Um eine bestimmte Konfiguration am SRM-Prompt zu booten, geben Sie + + + +boot dka0 -fl "0" + + + +ein, wobei dka0 durch Ihr Boot-Gerät und die 0 durch die zur bootende, +in etc/aboot.conf angegegebene Konfigurationszahl +ersetzt werden muß. + + + +Nach dem Doppelpunkt ist die Partition, auf der sich der Kernel befindet, +angegeben. 1 entspricht der BSD-Partition mit Namen A:, 2 B: und so weiter. + + + +Nach dem Schrägstrich ist der Name (ggf. inklusive des zugehörigen Pfads) +des zu bootenden Kernels angegeben. Falls sich Ihr Kernel nicht in einem +Dateisystem, sondern direkt nach aboot(8) am Anfang +der Festplatte befindet lassen Sie die Zahl, den Schrägstrich und den +Kernelnamen weg. + + + +Als nächstes ist die als / zu montierende Partition +angegeben. Andere benötigte Kernel-Parameter folgen. Wie gezeigt kann auch +eine initrd angegeben werden. + + + +Der Inhalt dieser Datei kann vor dem Booten mittels des interaktiven +Modus -- durch Booten mit dem Paramter "i" -- +von aboot(8) und der Angabe von +"h" am aboot-Prompt angezeigt werden. + + +
+AUTOR + +Diese Handbuchseite wurde von Helge Kreutzmann +debian@helgefjell.de für das Debian GNU/Linux-Projekt +geschrieben, sie darf aber auch von anderen verwendet werden. + + +SIEHE AUCH +aboot(8), abootconf(8), swriteboot(8), HP SRM Handbuch () + +
--- aboot-1.0~pre20040408.orig/doc/man/de/aboot.sgml +++ aboot-1.0~pre20040408/doc/man/de/aboot.sgml @@ -0,0 +1,89 @@ + + + + +aboot +8 +aboot + + + +aboot +Der Bootloader (Urlader) der zweiten Stufe auf Linux/Alpha + + +COPYRIGHT + +aboot unterliegt dem Copyright (C) 1996 Linus Torvalds, David Mosberger-Tang und Michael Schwingen + + + +BESCHREIBUNG + +aboot +aboot wird als Bootloader (Urlader) der zweiten +Stufe benötigt, falls das System via SRM gebootet wird. Er wird normalerweise +während der Systeminstallation durch +swriteboot(8) installiert. + + +Um den Bootprozess zu automatisieren können vordefinierte Boot-Konfigurationen +in etc/aboot.conf(5) eingetragen werden. + + +aboot kann durch die Angabe von + + +boot dka0 -fl "i" + + +am SRM-Prompt auch interaktiv verwendet werden, wobei dka0 durch das +verwendete Gerät ersetzt werden muß. + + +Im interaktiven Modus können Sie das Kommando l zur Anzeige der derzeitigen +etc/aboot.conf verwenden, und durch die Angabe der +entsprechenden Zahl (oder des kompletten Boot-Kommandos wie bei SRM) +Linux booten. + + +Falls Sie nicht die von abootconf(8) erstellte +etc/aboot.conf verwenden wollen, können Sie +aboot explizit angeben, wo es nach der +etc/aboot.conf suchen soll, indem Sie vor die +Zahl der Konfiguration die passende Partition angeben, d.h. falls +Ihre etc/aboot.conf sich auf Ihrer zweiten Partition +befindet und Sie den mit 3 benannten Eintrag booten wollen, dann gäben +Sie an + + +boot dqa -fl "2:3" + + +Beachten Sie, daß dies nur für das Booten von Linux via SRM zutrifft, da +VMS, Tru64, *BSD und +Windows NT jeweils über ihren eigenen Bootloader +für die zweite Stufe verfügen. Desweiteren wird aboot +nicht benötigt, falls das System mittels milo +gebootet wird. + + + + +AUTOR + +Diese Handbuchseite wurde von Helge Kreutzmann +debian@helgefjell.de für das Debian GNU/Linux-Projekt +geschrieben, sie darf aber auch von anderen verwendet werden. + + + +DATEIEN +etc/aboot.conf + + +SIEHE AUCH +abootconf(8), aboot.conf(5), +swriteboot(8), HP SRM Handbuch () + + --- aboot-1.0~pre20040408.orig/doc/man/de/abootconf.sgml +++ aboot-1.0~pre20040408/doc/man/de/abootconf.sgml @@ -0,0 +1,146 @@ + + + + +abootconf +8 +abootconf + + + +abootconf + +Konfiguration des Ortes der Konfigurationsdatei für den Bootloader der zweiten Stufe aboot(8) von Linux/Alpha. + + + + + + abootconf /dev/xxx num + + + +COPYRIGHT + +abootconf unterliegt dem Copyright (C) 1996 Linus Torvalds, David Mosberger-Tang und Michael Schwingen + + + +BESCHREIBUNG + +abootconf +aboot +abootconf wird zur Änderung der +Partitionpartition, in der der Linux +Boot-Loader (Urlader) aboot(8) nach seiner +Konfigurationsdatei schaut, verwendet. Die Konfiguration wird in +etc/aboot.conf(5) relativ zur Wurzel des Dateisystems +auf dieser Partition gespeichert. + + +abootconf benötigt das Boot-Gerät (bspw. +/dev/hdb, /dev/sda) und die +zu verwendende Partition (z.B. 3). Wollen Sie daher von Partition E: +auf Ihrer zweiten SCSI-Festplatte booten, dann geben Sie + + +abootconf /dev/sdb 5 + + + +ein. + + +HINWEISE + +abootconf wird nicht benötigt, wenn Sie Ihr +alpha-System mittels milo booten. + + +Auf jeder Festplatte kann eine Partition aktiviert werden, die die +Konfiguration für aboot(8) enthält, welche +unter etc/aboot.conf(5) liegt. Die zu bootende +Festplatte wird am SRM-Prompt als zweites Argument ausgewählt, also +beispielsweise + + + +boot dqa + + + +um von der ersten IDE-Festplatte zu booten. Lesen Sie bitte das +HP SRM-Handbuch und aboot(8) für weitere +Informationen. + + +aboot(8) kann einen Kernel von einer beliebiegen +Partition laden und kann soger eine andere Root-Partition verwenden, als die +zu der etc/aboot.conf gehört. Daher sollten Sie +normalerweise eine etc/aboot.conf mit allen Kombinationen +erstellen und benötigten abootconf außer für +die Erstinstallation nicht. Sie können dann den gewünschten Linuxkernel über +die entsprechenden Parameter am SRM-Prompt booten, z.B. um den mit 2 +bezeichneten Eintrag zu booten würden Sie + + + +boot dqa -fl "2" + + + +verwenden. Bitte lesen Sie das HP SRM-Handbuch und +aboot.conf(5) für weitere Informationen. + + +Um die derzeitigen Einstellungen anzuzeigen, lassen Sie einfach das letzte +Argument fort (d.h. die Partitionsnummer). + + +Beachten Sie, daß Sie abootconf erneut ausführen +müssen, wenn Sie aboot(8) aktualisiert haben. + + +Streng genommen wird abootconf nicht benötigt, +da Sie die Partition, auf der etc/aboot.conf liegt +auf dem SRM-Prompt spezifizieren können, indem Sie den Flags-Parameter mit +der Partitions-Nummer, gefolgt vom einem Doppelpunkt, einleiten, d.h. +falls etc/aboot.conf auf der vierten Partition liegt +und Sie den Eintrag mit der Nummer 2 booten wollen, dann könnte Sie am +SRM-Prompt auch + + + +boot dqa -fl "4:2" + + + +eingeben. + + +Beachten Sie, daß dies nur auf Linux zutrifft, da +VMS, Tru64, *BSD und +Windows NT jeweils über Ihren eigenen Bootloader +der zweiten Stufe verfügen. + + +Beachten Sie desweiteren, daß für das erstmalige Aufsetzen auf der Festplatte +abootconf ebenfalls nicht mehr benötigt wird, da +swriteboot(8) über die gesamte Funktionalität +von abootconf verfügt. + + +AUTOR + +Diese Handbuchseite wurde von Helge Kreutzmann +debian@helgefjell.de für das Debian GNU/Linux-Projekt +geschrieben, sie darf aber auch von anderen verwendet werden. + + +DATEIEN +etc/aboot.conf + +SIEHE AUCH +aboot(8), swriteboot(8), aboot.conf(5), HP SRM Handbuch () + + --- aboot-1.0~pre20040408.orig/doc/man/de/docbook2man-de-spec.pl +++ aboot-1.0~pre20040408/doc/man/de/docbook2man-de-spec.pl @@ -0,0 +1,1304 @@ +=head1 NAME + +docbook2man-spec - convert DocBook RefEntries to Unix manpages + +=head1 SYNOPSIS + +The SGMLSpm package from CPAN. This contains the sgmlspl script which +is used to grok this file. Use it like this: + +nsgmls some-docbook-document.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +=head1 OPTIONS + +=over 4 + +=item --section
A typical location of bootlx on the disk image is -boot/bootlx. The path of bootlx +boot/bootlx. The paths of bootlx and root.bin are relative to the root of the image. If your image is not mounted you have to replace /dev/xxx with the path to the image. @@ -74,9 +74,9 @@ BUGS -isomarkboot is currently only available on -Linux/Alpha systems though it can be compiled and used with minor -modifications on other platforms as well. +isomarkboot is not heavily tested on +architectures other than Linux/Alpha, though it compiles (with +slight patches). Please report bugs if you experience them. NOTES @@ -87,7 +87,7 @@ AUTHOR -This man page was written by Helge Kreutzmann kreutzm@itp.uni-hannover.de for the Debian GNU/Linux project but may be used by others. +This man page was written by Helge Kreutzmann debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. SEE ALSO --- aboot-1.0~pre20040408.orig/doc/man/netabootwrap.sgml +++ aboot-1.0~pre20040408/doc/man/netabootwrap.sgml @@ -0,0 +1,102 @@ + + + + +netabootwrap +1 +netabootwrap + + + +netabootwrap + +builds network bootable images for Linux/Alpha + + + + + + netabootwrap + -t netboot.img + -k vmlinux.gz + -i initrd.gz + -a "some kernel parameters" + + + +COPYRIGHT + +netabootwrap is (c) 2000 by Soohoon Lee +soohoon.lee@api-networks.com + + + +DESCRIPTIONS + +netabootwrap +netabootwrap merges net_aboot, +kernel and initrd +images to build the network bootable image for Linux/Alpha systems. +net_aboot.nh will not be usable but +netabootwrap has all +the functions. Without options, It'll look for vmlinux.gz +and build netboot.img, which is net_aboot ++ vmlinux.gz. + + + + +-t filename + +Sets the file name of the netboot image to be created, default is netboot.img. This file will be unconditionally overwritten if it exists. + +-k filename + +Sets the file name of the kernel image, default is vmlinux.gz + +-i filename + +Sets the file name of the initial RAM-disk image, default is initrd.gz + +-a "some kernel options" + +Provide additional kernel options, e.g. -a "root=/dev/sda1 single" + + + + + + + +NOTES + +To actually use the image, you need a tftpd(8) server and a +dhcp(8) or bootpd(8) +server. You can find further details in the SRM-HOWTO: +( or in +/usr/share/doc/aboot/SRM-HOWTO/ on Debian GNU/Linux +systems (and possibly others)) + + + + +AUTHOR + +This man page was written by Helge Kreutzmann debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. + + +SEE ALSO + +tftpd(8), +dhcpd(8), +bootpd(8), +aboot(8), +SRM-HOWTO in /usr/share/doc/aboot/SRM-HOWTO/ or , +HP SRM Manual () + + + --- aboot-1.0~pre20040408.orig/doc/man/sdisklabel.copyright +++ aboot-1.0~pre20040408/doc/man/sdisklabel.copyright @@ -29,4 +29,4 @@ +under the GPL the same as the rest of the aboot package. -Helge Kreutzmann , September 4th 2002 +Helge Kreutzmann , September 4th 2002 --- aboot-1.0~pre20040408.orig/doc/man/sdisklabel.sgml +++ aboot-1.0~pre20040408/doc/man/sdisklabel.sgml @@ -18,7 +18,7 @@ sdisklabel - drive + device print zero sum @@ -26,13 +26,13 @@ sdisklabel - drive + device size partsize sdisklabel - drive + device partnum offset size @@ -226,14 +226,14 @@ In case you do want to leave empty partitions or create labels which -extend beyond the end of the disk (e.g. when you know +extend beyond the end of the disk (e.g., when you know sdisklabel is reporting a wrong size) then use can use the force switch on the command line. AUTHOR -This man page was written by Helge Kreutzmann kreutzm@itp.uni-hannover.de for the Debian GNU/Linux project but may be used by others. It is +This man page was written by Helge Kreutzmann debian@helgefjell.de for the Debian GNU/Linux project but may be used by others. It is heavily based on the README provided along with the sdisklabel source. --- aboot-1.0~pre20040408.orig/doc/man/swriteboot.8 +++ aboot-1.0~pre20040408/doc/man/swriteboot.8 @@ -11,7 +11,7 @@ a harddisk. The loader is written in a way that allows the SRM firmware to boot from that disk (SRM is the firmware that is also used to boot \fBHP Tru64\fP, \fBOpenVMS\fP and *BSD). -Specifically, the loader is written to +Specifically, the loader is written to occupy a physically contiguous range of sectors starting at sector 2 and the first sector is updated such that the SRM firmware can find the boot loader. \fBswriteboot\fP may fail if the bootstrap loader is too big @@ -54,5 +54,5 @@ .nf Bob Manson Michael Schwingen -Helge Kreutzmann (Update of man page) +Helge Kreutzmann (Update of man page) .fi --- aboot-1.0~pre20040408.orig/fs/dummy.c +++ aboot-1.0~pre20040408/fs/dummy.c @@ -4,7 +4,7 @@ * * Michael Schwingen (rincewind@discworld.oche.de). */ -#include +#include "system.h" #include #include --- aboot-1.0~pre20040408.orig/fs/ext2.c +++ aboot-1.0~pre20040408/fs/ext2.c @@ -19,6 +19,7 @@ #else /* Linux 2.4.0 or later */ +typedef unsigned short umode_t; # undef __KERNEL__ # include # include --- aboot-1.0~pre20040408.orig/fs/iso.c +++ aboot-1.0~pre20040408/fs/iso.c @@ -6,6 +6,7 @@ * functionality to the Linux bootstrapper. All we can do is * open and read files... but that's all we need 8-) */ +#include #include #include #include --- aboot-1.0~pre20040408.orig/fs/ufs.c +++ aboot-1.0~pre20040408/fs/ufs.c @@ -26,6 +26,10 @@ /* * HISTORY * $Log: ufs.c,v $ + * Revision 1.1.1.2 2007/08/16 07:04:23 vorlon + * Import upstream "release" 1.0pre20040408 to CVS to facilitate rebasing + * against the current upstream work and avoid copying patches one-by-one. + * * Revision 1.2 2003/11/08 00:03:36 wgwoods * Reverted changes from 0.10, merged doc changes * @@ -80,17 +84,17 @@ void *f_blk[NIADDR]; /* buffer for indir block at level i */ long f_blksize[NIADDR]; /* size of buffer */ - daddr_t f_blkno[NIADDR]; + __kernel_daddr_t f_blkno[NIADDR]; /* disk address of block in buffer */ void *f_buf; /* buffer for data block */ long f_buf_size; /* size of data block */ - daddr_t f_buf_blkno; /* block number of data block */ + __kernel_daddr_t f_buf_blkno; /* block number of data block */ } inode_table[MAX_OPEN_FILES]; -static int read_inode(ino_t inumber, struct file *fp) +static int read_inode(__kernel_ino_t inumber, struct file *fp) { - daddr_t disk_block; + __kernel_daddr_t disk_block; long offset; struct dinode *dp; int level; @@ -123,9 +127,9 @@ * Given an offset in a file, find the disk block number that * contains that block. */ -static daddr_t block_map(struct file *fp, daddr_t file_block) +static __kernel_daddr_t block_map(struct file *fp, __kernel_daddr_t file_block) { - daddr_t ind_block_num, *ind_p; + __kernel_daddr_t ind_block_num, *ind_p; int level, idx; long offset; /* @@ -202,7 +206,7 @@ fp->f_blkno[level] = ind_block_num; } - ind_p = (daddr_t *)fp->f_blk[level]; + ind_p = (__kernel_daddr_t *)fp->f_blk[level]; if (level > 0) { idx = file_block / fp->f_nindir[level-1]; @@ -219,7 +223,7 @@ static int breadi(struct file *fp, long blkno, long nblks, char *buffer) { long block_size, offset, tot_bytes, nbytes, ncontig; - daddr_t disk_block; + __kernel_daddr_t disk_block; tot_bytes = 0; while (nblks) { @@ -260,7 +264,7 @@ * Search a directory for a name and return its * i_number. */ -static int search_dir(const char *name, struct file *fp, ino_t *inumber_p) +static int search_dir(const char *name, struct file *fp, __kernel_ino_t *inumber_p) { long offset, blockoffset; struct direct *dp; @@ -339,7 +343,7 @@ { char *cp = 0, *component; int fd; - ino_t inumber, parent_inumber; + __kernel_ino_t inumber, parent_inumber; int nlinks = 0; struct file *fp; static char namebuf[MAXPATHLEN+1]; @@ -360,7 +364,7 @@ /* copy name into buffer to allow modifying it: */ memcpy(namebuf, path, (unsigned)(strlen(path) + 1)); - inumber = (ino_t) ROOTINO; + inumber = (__kernel_ino_t) ROOTINO; if (read_inode(inumber, fp) < 0) { return -1; } @@ -407,9 +411,9 @@ { /* read file for symbolic link: */ long rc, offset; - daddr_t disk_block; + __kernel_daddr_t disk_block; - disk_block = block_map(fp, (daddr_t)0); + disk_block = block_map(fp, (__kernel_daddr_t)0); offset = fsbtodb(fs, disk_block) * DEV_BSIZE + partition_offset; rc = cons_read(dev, namebuf, sizeof(namebuf), @@ -426,7 +430,7 @@ if (*cp != '/') { inumber = parent_inumber; } else - inumber = (ino_t)ROOTINO; + inumber = (__kernel_ino_t)ROOTINO; if (read_inode(inumber, fp)) return -1; --- aboot-1.0~pre20040408.orig/head.S +++ aboot-1.0~pre20040408/head.S @@ -4,7 +4,7 @@ * initial bootloader stuff.. */ -#include +#include "pal.h" #include @@ -170,4 +170,4 @@ mov $16,$27 mov $17,$30 jmp $31,($27) - .end run_kernel \ No newline at end of file + .end run_kernel --- aboot-1.0~pre20040408.orig/include/aboot.h +++ aboot-1.0~pre20040408/include/aboot.h @@ -3,7 +3,7 @@ #include -#include +#include "hwrpb.h" #include --- aboot-1.0~pre20040408.orig/include/hwrpb.h +++ aboot-1.0~pre20040408/include/hwrpb.h @@ -0,0 +1,220 @@ +#ifndef __ALPHA_HWRPB_H +#define __ALPHA_HWRPB_H + +#define INIT_HWRPB ((struct hwrpb_struct *) 0x10000000) + +/* + * DEC processor types for Alpha systems. Found in HWRPB. + * These values are architected. + */ + +#define EV3_CPU 1 /* EV3 */ +#define EV4_CPU 2 /* EV4 (21064) */ +#define LCA4_CPU 4 /* LCA4 (21066/21068) */ +#define EV5_CPU 5 /* EV5 (21164) */ +#define EV45_CPU 6 /* EV4.5 (21064/xxx) */ +#define EV56_CPU 7 /* EV5.6 (21164) */ +#define EV6_CPU 8 /* EV6 (21264) */ +#define PCA56_CPU 9 /* PCA56 (21164PC) */ +#define PCA57_CPU 10 /* PCA57 (notyet) */ +#define EV67_CPU 11 /* EV67 (21264A) */ +#define EV68CB_CPU 12 /* EV68CB (21264C) */ +#define EV68AL_CPU 13 /* EV68AL (21264B) */ +#define EV68CX_CPU 14 /* EV68CX (21264D) */ +#define EV7_CPU 15 /* EV7 (21364) */ +#define EV79_CPU 16 /* EV79 (21364??) */ +#define EV69_CPU 17 /* EV69 (21264/EV69A) */ + +/* + * DEC system types for Alpha systems. Found in HWRPB. + * These values are architected. + */ + +#define ST_ADU 1 /* Alpha ADU systype */ +#define ST_DEC_4000 2 /* Cobra systype */ +#define ST_DEC_7000 3 /* Ruby systype */ +#define ST_DEC_3000_500 4 /* Flamingo systype */ +#define ST_DEC_2000_300 6 /* Jensen systype */ +#define ST_DEC_3000_300 7 /* Pelican systype */ +#define ST_DEC_2100_A500 9 /* Sable systype */ +#define ST_DEC_AXPVME_64 10 /* AXPvme system type */ +#define ST_DEC_AXPPCI_33 11 /* NoName system type */ +#define ST_DEC_TLASER 12 /* Turbolaser systype */ +#define ST_DEC_2100_A50 13 /* Avanti systype */ +#define ST_DEC_MUSTANG 14 /* Mustang systype */ +#define ST_DEC_ALCOR 15 /* Alcor (EV5) systype */ +#define ST_DEC_1000 17 /* Mikasa systype */ +#define ST_DEC_EB64 18 /* EB64 systype */ +#define ST_DEC_EB66 19 /* EB66 systype */ +#define ST_DEC_EB64P 20 /* EB64+ systype */ +#define ST_DEC_BURNS 21 /* laptop systype */ +#define ST_DEC_RAWHIDE 22 /* Rawhide systype */ +#define ST_DEC_K2 23 /* K2 systype */ +#define ST_DEC_LYNX 24 /* Lynx systype */ +#define ST_DEC_XL 25 /* Alpha XL systype */ +#define ST_DEC_EB164 26 /* EB164 systype */ +#define ST_DEC_NORITAKE 27 /* Noritake systype */ +#define ST_DEC_CORTEX 28 /* Cortex systype */ +#define ST_DEC_MIATA 30 /* Miata systype */ +#define ST_DEC_XXM 31 /* XXM systype */ +#define ST_DEC_TAKARA 32 /* Takara systype */ +#define ST_DEC_YUKON 33 /* Yukon systype */ +#define ST_DEC_TSUNAMI 34 /* Tsunami systype */ +#define ST_DEC_WILDFIRE 35 /* Wildfire systype */ +#define ST_DEC_CUSCO 36 /* CUSCO systype */ +#define ST_DEC_EIGER 37 /* Eiger systype */ +#define ST_DEC_TITAN 38 /* Titan systype */ +#define ST_DEC_MARVEL 39 /* Marvel systype */ + +/* UNOFFICIAL!!! */ +#define ST_UNOFFICIAL_BIAS 100 +#define ST_DTI_RUFFIAN 101 /* RUFFIAN systype */ + +/* Alpha Processor, Inc. systems */ +#define ST_API_BIAS 200 +#define ST_API_NAUTILUS 201 /* UP1000 systype */ + +struct pcb_struct { + unsigned long ksp; + unsigned long usp; + unsigned long ptbr; + unsigned int pcc; + unsigned int asn; + unsigned long unique; + unsigned long flags; + unsigned long res1, res2; +}; + +struct percpu_struct { + unsigned long hwpcb[16]; + unsigned long flags; + unsigned long pal_mem_size; + unsigned long pal_scratch_size; + unsigned long pal_mem_pa; + unsigned long pal_scratch_pa; + unsigned long pal_revision; + unsigned long type; + unsigned long variation; + unsigned long revision; + unsigned long serial_no[2]; + unsigned long logout_area_pa; + unsigned long logout_area_len; + unsigned long halt_PCBB; + unsigned long halt_PC; + unsigned long halt_PS; + unsigned long halt_arg; + unsigned long halt_ra; + unsigned long halt_pv; + unsigned long halt_reason; + unsigned long res; + unsigned long ipc_buffer[21]; + unsigned long palcode_avail[16]; + unsigned long compatibility; + unsigned long console_data_log_pa; + unsigned long console_data_log_length; + unsigned long bcache_info; +}; + +struct procdesc_struct { + unsigned long weird_vms_stuff; + unsigned long address; +}; + +struct vf_map_struct { + unsigned long va; + unsigned long pa; + unsigned long count; +}; + +struct crb_struct { + struct procdesc_struct * dispatch_va; + struct procdesc_struct * dispatch_pa; + struct procdesc_struct * fixup_va; + struct procdesc_struct * fixup_pa; + /* virtual->physical map */ + unsigned long map_entries; + unsigned long map_pages; + struct vf_map_struct map[1]; +}; + +struct memclust_struct { + unsigned long start_pfn; + unsigned long numpages; + unsigned long numtested; + unsigned long bitmap_va; + unsigned long bitmap_pa; + unsigned long bitmap_chksum; + unsigned long usage; +}; + +struct memdesc_struct { + unsigned long chksum; + unsigned long optional_pa; + unsigned long numclusters; + struct memclust_struct cluster[0]; +}; + +struct dsr_struct { + long smm; /* SMM nubber used by LMF */ + unsigned long lurt_off; /* offset to LURT table */ + unsigned long sysname_off; /* offset to sysname char count */ +}; + +struct hwrpb_struct { + unsigned long phys_addr; /* check: physical address of the hwrpb */ + unsigned long id; /* check: "HWRPB\0\0\0" */ + unsigned long revision; + unsigned long size; /* size of hwrpb */ + unsigned long cpuid; + unsigned long pagesize; /* 8192, I hope */ + unsigned long pa_bits; /* number of physical address bits */ + unsigned long max_asn; + unsigned char ssn[16]; /* system serial number: big bother is watching */ + unsigned long sys_type; + unsigned long sys_variation; + unsigned long sys_revision; + unsigned long intr_freq; /* interval clock frequency * 4096 */ + unsigned long cycle_freq; /* cycle counter frequency */ + unsigned long vptb; /* Virtual Page Table Base address */ + unsigned long res1; + unsigned long tbhb_offset; /* Translation Buffer Hint Block */ + unsigned long nr_processors; + unsigned long processor_size; + unsigned long processor_offset; + unsigned long ctb_nr; + unsigned long ctb_size; /* console terminal block size */ + unsigned long ctbt_offset; /* console terminal block table offset */ + unsigned long crb_offset; /* console callback routine block */ + unsigned long mddt_offset; /* memory data descriptor table */ + unsigned long cdb_offset; /* configuration data block (or NULL) */ + unsigned long frut_offset; /* FRU table (or NULL) */ + void (*save_terminal)(unsigned long); + unsigned long save_terminal_data; + void (*restore_terminal)(unsigned long); + unsigned long restore_terminal_data; + void (*CPU_restart)(unsigned long); + unsigned long CPU_restart_data; + unsigned long res2; + unsigned long res3; + unsigned long chksum; + unsigned long rxrdy; + unsigned long txrdy; + unsigned long dsr_offset; /* "Dynamic System Recognition Data Block Table" */ +}; + +#ifdef __KERNEL__ + +extern struct hwrpb_struct *hwrpb; + +static inline void +hwrpb_update_checksum(struct hwrpb_struct *h) +{ + unsigned long sum = 0, *l; + for (l = (unsigned long *) h; l < (unsigned long *) &h->chksum; ++l) + sum += *l; + h->chksum = sum; +} + +#endif /* __KERNEL__ */ + +#endif /* __ALPHA_HWRPB_H */ --- aboot-1.0~pre20040408.orig/include/linux/ext2_fs.h +++ aboot-1.0~pre20040408/include/linux/ext2_fs.h @@ -0,0 +1,591 @@ +/* + * linux/include/linux/ext2_fs.h + * + * Copyright (C) 1992, 1993, 1994, 1995 + * Remy Card (card@masi.ibp.fr) + * Laboratoire MASI - Institut Blaise Pascal + * Universite Pierre et Marie Curie (Paris VI) + * + * from + * + * linux/include/linux/minix_fs.h + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#ifndef _LINUX_EXT2_FS_H +#define _LINUX_EXT2_FS_H + +#include +#include +#include + +/* + * The second extended filesystem constants/structures + */ + +/* + * Define EXT2FS_DEBUG to produce debug messages + */ +#undef EXT2FS_DEBUG + +/* + * Define EXT2_RESERVATION to reserve data blocks for expanding files + */ +#define EXT2_DEFAULT_RESERVE_BLOCKS 8 +/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ +#define EXT2_MAX_RESERVE_BLOCKS 1027 +#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0 +/* + * The second extended file system version + */ +#define EXT2FS_DATE "95/08/09" +#define EXT2FS_VERSION "0.5b" + +/* + * Debug code + */ +#ifdef EXT2FS_DEBUG +# define ext2_debug(f, a...) { \ + printk ("EXT2-fs DEBUG (%s, %d): %s:", \ + __FILE__, __LINE__, __func__); \ + printk (f, ## a); \ + } +#else +# define ext2_debug(f, a...) /**/ +#endif + +/* + * Special inode numbers + */ +#define EXT2_BAD_INO 1 /* Bad blocks inode */ +#define EXT2_ROOT_INO 2 /* Root inode */ +#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ +#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ + +/* First non-reserved inode for old ext2 filesystems */ +#define EXT2_GOOD_OLD_FIRST_INO 11 + +#ifdef __KERNEL__ +#include +static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) +{ + return sb->s_fs_info; +} +#else +/* Assume that user mode programs are passing in an ext2fs superblock, not + * a kernel struct super_block. This will allow us to call the feature-test + * macros from user land. */ +#define EXT2_SB(sb) (sb) +#endif + +/* + * Maximal count of links to a file + */ +#define EXT2_LINK_MAX 32000 + +/* + * Macro-instructions used to manage several block sizes + */ +#define EXT2_MIN_BLOCK_SIZE 1024 +#define EXT2_MAX_BLOCK_SIZE 4096 +#define EXT2_MIN_BLOCK_LOG_SIZE 10 +#ifdef __KERNEL__ +# define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) +#else +# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) +#endif +#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) +#ifdef __KERNEL__ +# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) +#else +# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) +#endif +#ifdef __KERNEL__ +#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_addr_per_block_bits) +#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size) +#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino) +#else +#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ + EXT2_GOOD_OLD_INODE_SIZE : \ + (s)->s_inode_size) +#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ + EXT2_GOOD_OLD_FIRST_INO : \ + (s)->s_first_ino) +#endif + +/* + * Macro-instructions used to manage fragments + */ +#define EXT2_MIN_FRAG_SIZE 1024 +#define EXT2_MAX_FRAG_SIZE 4096 +#define EXT2_MIN_FRAG_LOG_SIZE 10 +#ifdef __KERNEL__ +# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size) +# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block) +#else +# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) +# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) +#endif + +/* + * Structure of a blocks group descriptor + */ +struct ext2_group_desc +{ + __le32 bg_block_bitmap; /* Blocks bitmap block */ + __le32 bg_inode_bitmap; /* Inodes bitmap block */ + __le32 bg_inode_table; /* Inodes table block */ + __le16 bg_free_blocks_count; /* Free blocks count */ + __le16 bg_free_inodes_count; /* Free inodes count */ + __le16 bg_used_dirs_count; /* Directories count */ + __le16 bg_pad; + __le32 bg_reserved[3]; +}; + +/* + * Macro-instructions used to manage group descriptors + */ +#ifdef __KERNEL__ +# define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) +# define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block) +# define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) +# define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) +#else +# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) +# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) +# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group) +#endif + +/* + * Constants relative to the data blocks + */ +#define EXT2_NDIR_BLOCKS 12 +#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS +#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) +#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) +#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) + +/* + * Inode flags (GETFLAGS/SETFLAGS) + */ +#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ +#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ +#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ +#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ +#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ +#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ +#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ +#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ +/* Reserved for compression usage... */ +#define EXT2_DIRTY_FL FS_DIRTY_FL +#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ +#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ +#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ +/* End compression flags --- maybe not all used */ +#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ +#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ +#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ +#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ +#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ +#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ +#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ +#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ + +#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ +#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ + +/* Flags that should be inherited by new inodes from their parent. */ +#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ + EXT2_SYNC_FL | EXT2_NODUMP_FL |\ + EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\ + EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ + EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) + +/* Flags that are appropriate for regular files (all but dir-specific ones). */ +#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL)) + +/* Flags that are appropriate for non-directories/regular files. */ +#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) + +/* Mask out flags that are inappropriate for the given type of inode. */ +static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags) +{ + if (S_ISDIR(mode)) + return flags; + else if (S_ISREG(mode)) + return flags & EXT2_REG_FLMASK; + else + return flags & EXT2_OTHER_FLMASK; +} + +/* + * ioctl commands + */ +#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS +#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS +#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION +#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION +#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long) +#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long) + +/* + * ioctl commands in 32 bit emulation + */ +#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS +#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS +#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION +#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION + +/* + * Structure of an inode on the disk + */ +struct ext2_inode { + __le16 i_mode; /* File mode */ + __le16 i_uid; /* Low 16 bits of Owner Uid */ + __le32 i_size; /* Size in bytes */ + __le32 i_atime; /* Access time */ + __le32 i_ctime; /* Creation time */ + __le32 i_mtime; /* Modification time */ + __le32 i_dtime; /* Deletion Time */ + __le16 i_gid; /* Low 16 bits of Group Id */ + __le16 i_links_count; /* Links count */ + __le32 i_blocks; /* Blocks count */ + __le32 i_flags; /* File flags */ + union { + struct { + __le32 l_i_reserved1; + } linux1; + struct { + __le32 h_i_translator; + } hurd1; + struct { + __le32 m_i_reserved1; + } masix1; + } osd1; /* OS dependent 1 */ + __le32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ + __le32 i_generation; /* File version (for NFS) */ + __le32 i_file_acl; /* File ACL */ + __le32 i_dir_acl; /* Directory ACL */ + __le32 i_faddr; /* Fragment address */ + union { + struct { + __u8 l_i_frag; /* Fragment number */ + __u8 l_i_fsize; /* Fragment size */ + __u16 i_pad1; + __le16 l_i_uid_high; /* these 2 fields */ + __le16 l_i_gid_high; /* were reserved2[0] */ + __u32 l_i_reserved2; + } linux2; + struct { + __u8 h_i_frag; /* Fragment number */ + __u8 h_i_fsize; /* Fragment size */ + __le16 h_i_mode_high; + __le16 h_i_uid_high; + __le16 h_i_gid_high; + __le32 h_i_author; + } hurd2; + struct { + __u8 m_i_frag; /* Fragment number */ + __u8 m_i_fsize; /* Fragment size */ + __u16 m_pad1; + __u32 m_i_reserved2[2]; + } masix2; + } osd2; /* OS dependent 2 */ +}; + +#define i_size_high i_dir_acl + +#if defined(__KERNEL__) || defined(__linux__) +#define i_reserved1 osd1.linux1.l_i_reserved1 +#define i_frag osd2.linux2.l_i_frag +#define i_fsize osd2.linux2.l_i_fsize +#define i_uid_low i_uid +#define i_gid_low i_gid +#define i_uid_high osd2.linux2.l_i_uid_high +#define i_gid_high osd2.linux2.l_i_gid_high +#define i_reserved2 osd2.linux2.l_i_reserved2 +#endif + +#ifdef __hurd__ +#define i_translator osd1.hurd1.h_i_translator +#define i_frag osd2.hurd2.h_i_frag +#define i_fsize osd2.hurd2.h_i_fsize +#define i_uid_high osd2.hurd2.h_i_uid_high +#define i_gid_high osd2.hurd2.h_i_gid_high +#define i_author osd2.hurd2.h_i_author +#endif + +#ifdef __masix__ +#define i_reserved1 osd1.masix1.m_i_reserved1 +#define i_frag osd2.masix2.m_i_frag +#define i_fsize osd2.masix2.m_i_fsize +#define i_reserved2 osd2.masix2.m_i_reserved2 +#endif + +/* + * File system states + */ +#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ +#define EXT2_ERROR_FS 0x0002 /* Errors detected */ + +/* + * Mount flags + */ +#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ +#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ +#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ +#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ +#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */ +#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */ +#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */ +#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */ +#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */ +#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ +#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ +#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ +#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ +#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ +#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ +#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ + + +#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt +#define set_opt(o, opt) o |= EXT2_MOUNT_##opt +#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ + EXT2_MOUNT_##opt) +/* + * Maximal mount counts between two filesystem checks + */ +#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ +#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ + +/* + * Behaviour when detecting errors + */ +#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ +#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ +#define EXT2_ERRORS_PANIC 3 /* Panic */ +#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE + +/* + * Structure of the super block + */ +struct ext2_super_block { + __le32 s_inodes_count; /* Inodes count */ + __le32 s_blocks_count; /* Blocks count */ + __le32 s_r_blocks_count; /* Reserved blocks count */ + __le32 s_free_blocks_count; /* Free blocks count */ + __le32 s_free_inodes_count; /* Free inodes count */ + __le32 s_first_data_block; /* First Data Block */ + __le32 s_log_block_size; /* Block size */ + __le32 s_log_frag_size; /* Fragment size */ + __le32 s_blocks_per_group; /* # Blocks per group */ + __le32 s_frags_per_group; /* # Fragments per group */ + __le32 s_inodes_per_group; /* # Inodes per group */ + __le32 s_mtime; /* Mount time */ + __le32 s_wtime; /* Write time */ + __le16 s_mnt_count; /* Mount count */ + __le16 s_max_mnt_count; /* Maximal mount count */ + __le16 s_magic; /* Magic signature */ + __le16 s_state; /* File system state */ + __le16 s_errors; /* Behaviour when detecting errors */ + __le16 s_minor_rev_level; /* minor revision level */ + __le32 s_lastcheck; /* time of last check */ + __le32 s_checkinterval; /* max. time between checks */ + __le32 s_creator_os; /* OS */ + __le32 s_rev_level; /* Revision level */ + __le16 s_def_resuid; /* Default uid for reserved blocks */ + __le16 s_def_resgid; /* Default gid for reserved blocks */ + /* + * These fields are for EXT2_DYNAMIC_REV superblocks only. + * + * Note: the difference between the compatible feature set and + * the incompatible feature set is that if there is a bit set + * in the incompatible feature set that the kernel doesn't + * know about, it should refuse to mount the filesystem. + * + * e2fsck's requirements are more strict; if it doesn't know + * about a feature in either the compatible or incompatible + * feature set, it must abort and not try to meddle with + * things it doesn't understand... + */ + __le32 s_first_ino; /* First non-reserved inode */ + __le16 s_inode_size; /* size of inode structure */ + __le16 s_block_group_nr; /* block group # of this superblock */ + __le32 s_feature_compat; /* compatible feature set */ + __le32 s_feature_incompat; /* incompatible feature set */ + __le32 s_feature_ro_compat; /* readonly-compatible feature set */ + __u8 s_uuid[16]; /* 128-bit uuid for volume */ + char s_volume_name[16]; /* volume name */ + char s_last_mounted[64]; /* directory where last mounted */ + __le32 s_algorithm_usage_bitmap; /* For compression */ + /* + * Performance hints. Directory preallocation should only + * happen if the EXT2_COMPAT_PREALLOC flag is on. + */ + __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ + __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ + __u16 s_padding1; + /* + * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. + */ + __u8 s_journal_uuid[16]; /* uuid of journal superblock */ + __u32 s_journal_inum; /* inode number of journal file */ + __u32 s_journal_dev; /* device number of journal file */ + __u32 s_last_orphan; /* start of list of inodes to delete */ + __u32 s_hash_seed[4]; /* HTREE hash seed */ + __u8 s_def_hash_version; /* Default hash version to use */ + __u8 s_reserved_char_pad; + __u16 s_reserved_word_pad; + __le32 s_default_mount_opts; + __le32 s_first_meta_bg; /* First metablock block group */ + __u32 s_reserved[190]; /* Padding to the end of the block */ +}; + +/* + * Codes for operating systems + */ +#define EXT2_OS_LINUX 0 +#define EXT2_OS_HURD 1 +#define EXT2_OS_MASIX 2 +#define EXT2_OS_FREEBSD 3 +#define EXT2_OS_LITES 4 + +/* + * Revision levels + */ +#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ +#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ + +#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV +#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV + +#define EXT2_GOOD_OLD_INODE_SIZE 128 + +/* + * Feature set definitions + */ + +#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) +#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) +#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) +#define EXT2_SET_COMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) +#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask) +#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask) +#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask) +#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask) +#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ + EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask) + +#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 +#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 +#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 +#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 +#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 +#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 +#define EXT2_FEATURE_COMPAT_ANY 0xffffffff + +#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 +#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 +#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff + +#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 +#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 +#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 +#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 +#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 +#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff + +#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR +#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ + EXT2_FEATURE_INCOMPAT_META_BG) +#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ + EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ + EXT2_FEATURE_RO_COMPAT_BTREE_DIR) +#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP +#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP + +/* + * Default values for user and/or group using reserved blocks + */ +#define EXT2_DEF_RESUID 0 +#define EXT2_DEF_RESGID 0 + +/* + * Default mount options + */ +#define EXT2_DEFM_DEBUG 0x0001 +#define EXT2_DEFM_BSDGROUPS 0x0002 +#define EXT2_DEFM_XATTR_USER 0x0004 +#define EXT2_DEFM_ACL 0x0008 +#define EXT2_DEFM_UID16 0x0010 + /* Not used by ext2, but reserved for use by ext3 */ +#define EXT3_DEFM_JMODE 0x0060 +#define EXT3_DEFM_JMODE_DATA 0x0020 +#define EXT3_DEFM_JMODE_ORDERED 0x0040 +#define EXT3_DEFM_JMODE_WBACK 0x0060 + +/* + * Structure of a directory entry + */ +#define EXT2_NAME_LEN 255 + +struct ext2_dir_entry { + __le32 inode; /* Inode number */ + __le16 rec_len; /* Directory entry length */ + __le16 name_len; /* Name length */ + char name[EXT2_NAME_LEN]; /* File name */ +}; + +/* + * The new version of the directory entry. Since EXT2 structures are + * stored in intel byte order, and the name_len field could never be + * bigger than 255 chars, it's safe to reclaim the extra byte for the + * file_type field. + */ +struct ext2_dir_entry_2 { + __le32 inode; /* Inode number */ + __le16 rec_len; /* Directory entry length */ + __u8 name_len; /* Name length */ + __u8 file_type; + char name[EXT2_NAME_LEN]; /* File name */ +}; + +/* + * Ext2 directory file types. Only the low 3 bits are used. The + * other bits are reserved for now. + */ +enum { + EXT2_FT_UNKNOWN = 0, + EXT2_FT_REG_FILE = 1, + EXT2_FT_DIR = 2, + EXT2_FT_CHRDEV = 3, + EXT2_FT_BLKDEV = 4, + EXT2_FT_FIFO = 5, + EXT2_FT_SOCK = 6, + EXT2_FT_SYMLINK = 7, + EXT2_FT_MAX +}; + +/* + * EXT2_DIR_PAD defines the directory entries boundaries + * + * NOTE: It must be a multiple of 4 + */ +#define EXT2_DIR_PAD 4 +#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) +#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ + ~EXT2_DIR_ROUND) +#define EXT2_MAX_REC_LEN ((1<<16)-1) + +#endif /* _LINUX_EXT2_FS_H */ --- aboot-1.0~pre20040408.orig/include/pal.h +++ aboot-1.0~pre20040408/include/pal.h @@ -0,0 +1,51 @@ +#ifndef __ALPHA_PAL_H +#define __ALPHA_PAL_H + +/* + * Common PAL-code + */ +#define PAL_halt 0 +#define PAL_cflush 1 +#define PAL_draina 2 +#define PAL_bpt 128 +#define PAL_bugchk 129 +#define PAL_chmk 131 +#define PAL_callsys 131 +#define PAL_imb 134 +#define PAL_rduniq 158 +#define PAL_wruniq 159 +#define PAL_gentrap 170 +#define PAL_nphalt 190 + +/* + * VMS specific PAL-code + */ +#define PAL_swppal 10 +#define PAL_mfpr_vptb 41 + +/* + * OSF specific PAL-code + */ +#define PAL_cserve 9 +#define PAL_wripir 13 +#define PAL_rdmces 16 +#define PAL_wrmces 17 +#define PAL_wrfen 43 +#define PAL_wrvptptr 45 +#define PAL_jtopal 46 +#define PAL_swpctx 48 +#define PAL_wrval 49 +#define PAL_rdval 50 +#define PAL_tbi 51 +#define PAL_wrent 52 +#define PAL_swpipl 53 +#define PAL_rdps 54 +#define PAL_wrkgp 55 +#define PAL_wrusp 56 +#define PAL_wrperfmon 57 +#define PAL_rdusp 58 +#define PAL_whami 60 +#define PAL_retsys 61 +#define PAL_rti 63 + +#endif /* __ALPHA_PAL_H */ --- aboot-1.0~pre20040408.orig/include/setjmp.h +++ aboot-1.0~pre20040408/include/setjmp.h @@ -11,6 +11,9 @@ * * HISTORY * $Log: setjmp.h,v $ + * Revision 1.1.1.1 2004/04/25 20:38:20 vorlon + * Initial import of upstream source + * * Revision 1.1.1.1 2001/10/08 23:03:52 wgwoods * initial import of CVS source from alphalinux.org, plus a couple bugfixes * --- aboot-1.0~pre20040408.orig/include/string.h +++ aboot-1.0~pre20040408/include/string.h @@ -5,6 +5,8 @@ * kernels don't provide these to userspace code. */ +#include + #include extern char * ___strtok; --- aboot-1.0~pre20040408.orig/include/system.h +++ aboot-1.0~pre20040408/include/system.h @@ -0,0 +1,326 @@ +#ifndef __ALPHA_SYSTEM_H +#define __ALPHA_SYSTEM_H + +#include +#define PAGE_SHIFT 13 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_OFFSET 0xfffffc0000000000UL + + +/* + * System defines.. Note that this is included both from .c and .S + * files, so it does only defines, not any C code. + */ + +/* + * We leave one page for the initial stack page, and one page for + * the initial process structure. Also, the console eats 3 MB for + * the initial bootloader (one of which we can reclaim later). + */ +#define BOOT_PCB 0x20000000 +#define BOOT_ADDR 0x20000000 +/* Remove when official MILO sources have ELF support: */ +#define BOOT_SIZE (16*1024) + +#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS +#define KERNEL_START_PHYS 0x300000 /* Old bootloaders hardcoded this. */ +#else +#define KERNEL_START_PHYS 0x1000000 /* required: Wildfire/Titan/Marvel */ +#endif + +#define KERNEL_START (PAGE_OFFSET+KERNEL_START_PHYS) +#define SWAPPER_PGD KERNEL_START +#define INIT_STACK (PAGE_OFFSET+KERNEL_START_PHYS+0x02000) +#define EMPTY_PGT (PAGE_OFFSET+KERNEL_START_PHYS+0x04000) +#define EMPTY_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x08000) +#define ZERO_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000) + +#define START_ADDR (PAGE_OFFSET+KERNEL_START_PHYS+0x10000) + +/* + * This is setup by the secondary bootstrap loader. Because + * the zero page is zeroed out as soon as the vm system is + * initialized, we need to copy things out into a more permanent + * place. + */ +#define PARAM ZERO_PGE +#define COMMAND_LINE ((char*)(PARAM + 0x0000)) +#define INITRD_START (*(unsigned long *) (PARAM+0x100)) +#define INITRD_SIZE (*(unsigned long *) (PARAM+0x108)) + +#ifndef __ASSEMBLY__ +#include + +/* + * This is the logout header that should be common to all platforms + * (assuming they are running OSF/1 PALcode, I guess). + */ +struct el_common { + unsigned int size; /* size in bytes of logout area */ + unsigned int sbz1 : 30; /* should be zero */ + unsigned int err2 : 1; /* second error */ + unsigned int retry : 1; /* retry flag */ + unsigned int proc_offset; /* processor-specific offset */ + unsigned int sys_offset; /* system-specific offset */ + unsigned int code; /* machine check code */ + unsigned int frame_rev; /* frame revision */ +}; + +/* Machine Check Frame for uncorrectable errors (Large format) + * --- This is used to log uncorrectable errors such as + * double bit ECC errors. + * --- These errors are detected by both processor and systems. + */ +struct el_common_EV5_uncorrectable_mcheck { + unsigned long shadow[8]; /* Shadow reg. 8-14, 25 */ + unsigned long paltemp[24]; /* PAL TEMP REGS. */ + unsigned long exc_addr; /* Address of excepting instruction*/ + unsigned long exc_sum; /* Summary of arithmetic traps. */ + unsigned long exc_mask; /* Exception mask (from exc_sum). */ + unsigned long pal_base; /* Base address for PALcode. */ + unsigned long isr; /* Interrupt Status Reg. */ + unsigned long icsr; /* CURRENT SETUP OF EV5 IBOX */ + unsigned long ic_perr_stat; /* I-CACHE Reg. <11> set Data parity + <12> set TAG parity*/ + unsigned long dc_perr_stat; /* D-CACHE error Reg. Bits set to 1: + <2> Data error in bank 0 + <3> Data error in bank 1 + <4> Tag error in bank 0 + <5> Tag error in bank 1 */ + unsigned long va; /* Effective VA of fault or miss. */ + unsigned long mm_stat; /* Holds the reason for D-stream + fault or D-cache parity errors */ + unsigned long sc_addr; /* Address that was being accessed + when EV5 detected Secondary cache + failure. */ + unsigned long sc_stat; /* Helps determine if the error was + TAG/Data parity(Secondary Cache)*/ + unsigned long bc_tag_addr; /* Contents of EV5 BC_TAG_ADDR */ + unsigned long ei_addr; /* Physical address of any transfer + that is logged in EV5 EI_STAT */ + unsigned long fill_syndrome; /* For correcting ECC errors. */ + unsigned long ei_stat; /* Helps identify reason of any + processor uncorrectable error + at its external interface. */ + unsigned long ld_lock; /* Contents of EV5 LD_LOCK register*/ +}; + +struct el_common_EV6_mcheck { + unsigned int FrameSize; /* Bytes, including this field */ + unsigned int FrameFlags; /* <31> = Retry, <30> = Second Error */ + unsigned int CpuOffset; /* Offset to CPU-specific info */ + unsigned int SystemOffset; /* Offset to system-specific info */ + unsigned int MCHK_Code; + unsigned int MCHK_Frame_Rev; + unsigned long I_STAT; /* EV6 Internal Processor Registers */ + unsigned long DC_STAT; /* (See the 21264 Spec) */ + unsigned long C_ADDR; + unsigned long DC1_SYNDROME; + unsigned long DC0_SYNDROME; + unsigned long C_STAT; + unsigned long C_STS; + unsigned long MM_STAT; + unsigned long EXC_ADDR; + unsigned long IER_CM; + unsigned long ISUM; + unsigned long RESERVED0; + unsigned long PAL_BASE; + unsigned long I_CTL; + unsigned long PCTX; +}; + +extern void halt(void) __attribute__((noreturn)); +#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) + +#define switch_to(P,N,L) \ + do { \ + (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \ + check_mmu_context(); \ + } while (0) + +struct task_struct; +extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); + +/* + * On SMP systems, when the scheduler does migration-cost autodetection, + * it needs a way to flush as much of the CPU's caches as possible. + * + * TODO: fill this in! + */ +static inline void sched_cacheflush(void) +{ +} + +#define imb() \ +__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") + +#define draina() \ +__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory") + +enum implver_enum { + IMPLVER_EV4, + IMPLVER_EV5, + IMPLVER_EV6 +}; + +#ifdef CONFIG_ALPHA_GENERIC +#define implver() \ +({ unsigned long __implver; \ + __asm__ ("implver %0" : "=r"(__implver)); \ + (enum implver_enum) __implver; }) +#else +/* Try to eliminate some dead code. */ +#ifdef CONFIG_ALPHA_EV4 +#define implver() IMPLVER_EV4 +#endif +#ifdef CONFIG_ALPHA_EV5 +#define implver() IMPLVER_EV5 +#endif +#if defined(CONFIG_ALPHA_EV6) +#define implver() IMPLVER_EV6 +#endif +#endif + +enum amask_enum { + AMASK_BWX = (1UL << 0), + AMASK_FIX = (1UL << 1), + AMASK_CIX = (1UL << 2), + AMASK_MAX = (1UL << 8), + AMASK_PRECISE_TRAP = (1UL << 9), +}; + +#define amask(mask) \ +({ unsigned long __amask, __input = (mask); \ + __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \ + __amask; }) + +#define __CALL_PAL_R0(NAME, TYPE) \ +static inline TYPE NAME(void) \ +{ \ + register TYPE __r0 __asm__("$0"); \ + __asm__ __volatile__( \ + "call_pal %1 # " #NAME \ + :"=r" (__r0) \ + :"i" (PAL_ ## NAME) \ + :"$1", "$16", "$22", "$23", "$24", "$25"); \ + return __r0; \ +} + +#define __CALL_PAL_W1(NAME, TYPE0) \ +static inline void NAME(TYPE0 arg0) \ +{ \ + register TYPE0 __r16 __asm__("$16") = arg0; \ + __asm__ __volatile__( \ + "call_pal %1 # "#NAME \ + : "=r"(__r16) \ + : "i"(PAL_ ## NAME), "0"(__r16) \ + : "$1", "$22", "$23", "$24", "$25"); \ +} + +#define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ +static inline void NAME(TYPE0 arg0, TYPE1 arg1) \ +{ \ + register TYPE0 __r16 __asm__("$16") = arg0; \ + register TYPE1 __r17 __asm__("$17") = arg1; \ + __asm__ __volatile__( \ + "call_pal %2 # "#NAME \ + : "=r"(__r16), "=r"(__r17) \ + : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \ + : "$1", "$22", "$23", "$24", "$25"); \ +} + +#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ +static inline RTYPE NAME(TYPE0 arg0) \ +{ \ + register RTYPE __r0 __asm__("$0"); \ + register TYPE0 __r16 __asm__("$16") = arg0; \ + __asm__ __volatile__( \ + "call_pal %2 # "#NAME \ + : "=r"(__r16), "=r"(__r0) \ + : "i"(PAL_ ## NAME), "0"(__r16) \ + : "$1", "$22", "$23", "$24", "$25"); \ + return __r0; \ +} + +#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ +static inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ +{ \ + register RTYPE __r0 __asm__("$0"); \ + register TYPE0 __r16 __asm__("$16") = arg0; \ + register TYPE1 __r17 __asm__("$17") = arg1; \ + __asm__ __volatile__( \ + "call_pal %3 # "#NAME \ + : "=r"(__r16), "=r"(__r17), "=r"(__r0) \ + : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \ + : "$1", "$22", "$23", "$24", "$25"); \ + return __r0; \ +} + +__CALL_PAL_W1(cflush, unsigned long); +__CALL_PAL_R0(rdmces, unsigned long); +__CALL_PAL_R0(rdps, unsigned long); +__CALL_PAL_R0(rdusp, unsigned long); +__CALL_PAL_RW1(swpipl, unsigned long, unsigned long); +__CALL_PAL_R0(whami, unsigned long); +__CALL_PAL_W2(wrent, void*, unsigned long); +__CALL_PAL_W1(wripir, unsigned long); +__CALL_PAL_W1(wrkgp, unsigned long); +__CALL_PAL_W1(wrmces, unsigned long); +__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long); +__CALL_PAL_W1(wrusp, unsigned long); +__CALL_PAL_W1(wrvptptr, unsigned long); + +#define IPL_MIN 0 +#define IPL_SW0 1 +#define IPL_SW1 2 +#define IPL_DEV0 3 +#define IPL_DEV1 4 +#define IPL_TIMER 5 +#define IPL_PERF 6 +#define IPL_POWERFAIL 6 +#define IPL_MCHECK 7 +#define IPL_MAX 7 + +#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK +#undef IPL_MIN +#define IPL_MIN __min_ipl +extern int __min_ipl; +#endif + +#define getipl() (rdps() & 7) +#define setipl(ipl) ((void) swpipl(ipl)) + +#define local_irq_disable() do { setipl(IPL_MAX); barrier(); } while(0) +#define local_irq_enable() do { barrier(); setipl(IPL_MIN); } while(0) +#define local_save_flags(flags) ((flags) = rdps()) +#define local_irq_save(flags) do { (flags) = swpipl(IPL_MAX); barrier(); } while(0) +#define local_irq_restore(flags) do { barrier(); setipl(flags); barrier(); } while(0) + +#define irqs_disabled() (getipl() == IPL_MAX) + +/* + * TB routines.. + */ +#define __tbi(nr,arg,arg1...) \ +({ \ + register unsigned long __r16 __asm__("$16") = (nr); \ + register unsigned long __r17 __asm__("$17"); arg; \ + __asm__ __volatile__( \ + "call_pal %3 #__tbi" \ + :"=r" (__r16),"=r" (__r17) \ + :"0" (__r16),"i" (PAL_tbi) ,##arg1 \ + :"$0", "$1", "$22", "$23", "$24", "$25"); \ +}) + +#define tbi(x,y) __tbi(x,__r17=(y),"1" (__r17)) +#define tbisi(x) __tbi(1,__r17=(x),"1" (__r17)) +#define tbisd(x) __tbi(2,__r17=(x),"1" (__r17)) +#define tbis(x) __tbi(3,__r17=(x),"1" (__r17)) +#define tbiap() __tbi(-1, /* no second argument */) +#define tbia() __tbi(-2, /* no second argument */) + +#endif /* __ASSEMBLY__ */ + +#define arch_align_stack(x) (x) + +#endif --- aboot-1.0~pre20040408.orig/include/ufs.h +++ aboot-1.0~pre20040408/include/ufs.h @@ -42,6 +42,9 @@ /* * HISTORY * $Log: ufs.h,v $ + * Revision 1.1.1.1 2004/04/25 20:38:21 vorlon + * Initial import of upstream source + * * Revision 1.1.1.1 2001/10/08 23:03:52 wgwoods * initial import of CVS source from alphalinux.org, plus a couple bugfixes * @@ -141,8 +144,8 @@ #define SBSIZE 8192 #define BBOFF ((off_t)(0)) #define SBOFF ((off_t)(BBOFF + BBSIZE)) -#define BBLOCK ((daddr_t)(0)) -#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) +#define BBLOCK ((__kernel_daddr_t)(0)) +#define SBLOCK ((__kernel_daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) /* * Addresses stored in inodes are capable of addressing fragments @@ -169,7 +172,7 @@ * this purpose, however numerous dump tapes make this * assumption, so we are stuck with it) */ -#define ROOTINO ((ino_t)2) /* i number of all roots */ +#define ROOTINO ((__kernel_ino_t)2) /* i number of all roots */ /* * MINBSIZE is the smallest allowable block size. @@ -222,10 +225,10 @@ { int xxx1; /* struct fs *fs_link;*/ int xxx2; /* struct fs *fs_rlink;*/ - daddr_t fs_sblkno; /* addr of super-block in filesys */ - daddr_t fs_cblkno; /* offset of cyl-block in filesys */ - daddr_t fs_iblkno; /* offset of inode-blocks in filesys */ - daddr_t fs_dblkno; /* offset of first data after cg */ + __kernel_daddr_t fs_sblkno; /* addr of super-block in filesys */ + __kernel_daddr_t fs_cblkno; /* offset of cyl-block in filesys */ + __kernel_daddr_t fs_iblkno; /* offset of inode-blocks in filesys */ + __kernel_daddr_t fs_dblkno; /* offset of first data after cg */ int fs_cgoffset; /* cylinder group offset in cylinder */ int fs_cgmask; /* used to calc mod fs_ntrak */ ext_time_t fs_time; /* last time written */ @@ -265,7 +268,7 @@ int fs_headswitch; /* head switch time, usec */ int fs_trkseek; /* track-to-track seek, usec */ /* sizes determined by number of cylinder groups and their sizes */ - daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ + __kernel_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ int fs_cssize; /* size of cyl grp summary area */ int fs_cgsize; /* cylinder group size */ /* these fields are derived from the hardware */ @@ -303,7 +306,7 @@ int fs_postbloff; /* (short) rotation block list head */ int fs_rotbloff; /* (u_char) blocks for each rotation */ int fs_magic; /* magic number */ - u_char fs_space[1]; /* list of blocks for each rotation */ + unsigned char fs_space[1]; /* list of blocks for each rotation */ /* actually longer */ }; /* @@ -327,7 +330,7 @@ #define fs_rotbl(fs) \ (((fs)->fs_postblformat == FS_42POSTBLFMT) \ ? ((fs)->fs_space) \ - : ((u_char *)((char *)(fs) + (fs)->fs_rotbloff))) + : ((unsigned char *)((char *)(fs) + (fs)->fs_rotbloff))) /* * Convert cylinder group to base address of its global summary info. @@ -360,7 +363,7 @@ int cg_freeoff; /* (u_char) free block map */ int cg_nextfreeoff; /* (u_char) next available space */ int cg_sparecon[16]; /* reserved for future use */ - u_char cg_space[1]; /* space for cylinder group maps */ + unsigned char cg_space[1]; /* space for cylinder group maps */ /* actually longer */ }; /* @@ -381,7 +384,7 @@ #define cg_blksfree(cgp) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_free) \ - : ((u_char *)((char *)(cgp) + (cgp)->cg_freeoff))) + : ((unsigned char *)((char *)(cgp) + (cgp)->cg_freeoff))) #define cg_chkmagic(cgp) \ ((cgp)->cg_magic == CG_MAGIC || ((struct ocg *)(cgp))->cg_magic == CG_MAGIC) @@ -406,7 +409,7 @@ short cg_b[32][8]; /* positions of free blocks */ char cg_iused[256]; /* used inode map */ int cg_magic; /* magic number */ - u_char cg_free[1]; /* free block map */ + unsigned char cg_free[1]; /* free block map */ /* actually longer */ }; @@ -421,7 +424,7 @@ * Cylinder group macros to locate things in cylinder groups. * They calc file system addresses of cylinder group data structures. */ -#define cgbase(fs, c) ((daddr_t)((fs)->fs_fpg * (c))) +#define cgbase(fs, c) ((__kernel_daddr_t)((fs)->fs_fpg * (c))) #define cgstart(fs, c) \ (cgbase(fs, c) + (fs)->fs_cgoffset * ((c) & ~((fs)->fs_cgmask))) #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ @@ -438,7 +441,7 @@ #define itoo(fs, x) ((x) % INOPB(fs)) #define itog(fs, x) ((x) / (fs)->fs_ipg) #define itod(fs, x) \ - ((daddr_t)(cgimin(fs, itog(fs, x)) + \ + ((__kernel_daddr_t)(cgimin(fs, itog(fs, x)) + \ (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) /* @@ -572,9 +575,9 @@ #define MAXNAMLEN 255 struct direct { - u_int d_ino; /* inode number of entry */ - u_short d_reclen; /* length of this record */ - u_short d_namlen; /* length of string in d_name */ + unsigned int d_ino; /* inode number of entry */ + unsigned short d_reclen; /* length of this record */ + unsigned short d_namlen; /* length of string in d_name */ char d_name[MAXNAMLEN + 1]; /* name with length <= MAXNAMLEN */ }; @@ -599,13 +602,13 @@ #define NDADDR 12 /* direct addresses in inode */ #define NIADDR 3 /* indirect addresses in inode */ -#define MAX_FASTLINK_SIZE ((NDADDR + NIADDR) * sizeof(daddr_t)) +#define MAX_FASTLINK_SIZE ((NDADDR + NIADDR) * sizeof(__kernel_daddr_t)) struct icommon { - u_short ic_mode; /* 0: mode and type of file */ + unsigned short ic_mode; /* 0: mode and type of file */ short ic_nlink; /* 2: number of links to file */ - u_short ic_uid; /* 4: owner's user id */ - u_short ic_gid; /* 6: owner's group id */ + unsigned short ic_uid; /* 4: owner's user id */ + unsigned short ic_gid; /* 6: owner's group id */ long ic_size; /* 8: number of bytes in file */ ext_time_t ic_atime; /* 16: time last accessed */ int ic_atspare; @@ -615,8 +618,8 @@ int ic_ctspare; union { struct { - daddr_t Mb_db[NDADDR]; /* 40: disk block addresses */ - daddr_t Mb_ib[NIADDR]; /* 88: indirect blocks */ + __kernel_daddr_t Mb_db[NDADDR]; /* 40: disk block addresses */ + __kernel_daddr_t Mb_ib[NIADDR]; /* 88: indirect blocks */ } ic_Mb; char ic_Msymlink[MAX_FASTLINK_SIZE]; /* 40: symbolic link name */ --- aboot-1.0~pre20040408.orig/include/utils.h +++ aboot-1.0~pre20040408/include/utils.h @@ -1,7 +1,9 @@ #ifndef utils_h #define utils_h -#include +#include + +#include "hwrpb.h" #ifdef TESTING #define pal_init() --- aboot-1.0~pre20040408.orig/lib/Makefile +++ aboot-1.0~pre20040408/lib/Makefile @@ -1,11 +1,19 @@ -CC = gcc -CPPFLAGS += -D__KERNEL__ -I../include +ifndef ($(CC)) +CC = gcc +endif + +override CPPFLAGS += -D__KERNEL__ -I../include +override ASFLAGS += $(CPPFLAGS) -D__ASSEMBLY__ -traditional + ifeq ($(TESTING),) -CFLAGS = -Os -Wall -mno-fp-regs -fno-builtin +ifeq ($(FOREIGN),"yes") +override CFLAGS += -Os -Wall -fno-builtin +else +override CFLAGS += -Os -Wall -mno-fp-regs -fno-builtin +endif else -CFLAGS = -Os -g3 -Wall +override CFLAGS += -Os -g3 -Wall endif -ASFLAGS = $(CPPFLAGS) -D__ASSEMBLY__ -traditional ifeq ($(TESTING),) libaboot.a: vsprintf.o memcpy.o memset.o string.o _setjmp.o \ --- aboot-1.0~pre20040408.orig/lib/_longjmp.S +++ aboot-1.0~pre20040408/lib/_longjmp.S @@ -2,7 +2,7 @@ * Copyright (c) 1995 David Mosberger (davidm@cs.arizona.edu) */ #include -#include +#include "system.h" .extern printf --- aboot-1.0~pre20040408.orig/lib/isolib.c +++ aboot-1.0~pre20040408/lib/isolib.c @@ -6,12 +6,8 @@ * functionality to the Linux bootstrapper. All we can do is * open and read files... but that's all we need 8-) */ -#include -#include -#include #include -#include -#include +#include #include "string.h" #include "iso.h" @@ -617,6 +613,7 @@ { struct inode_table_entry *itp = (struct inode_table_entry *)from; struct iso_inode *root = iso_iget(root_inode); + /* HK: iso_iget expects an "int" but root_inode is "long" ?? */ struct iso_inode *result = NULL; char *linkto; @@ -758,10 +755,14 @@ if (high_sierra) { rootp = (struct iso_directory_record *) h_pri->root_directory_record; +#if 0 +//See http://www.y-adagio.com/public/standards/iso_cdromr/sect_1.htm +//Section 4.16 and 4.17 for explanation why this check is invalid if (isonum_723 (h_pri->volume_set_size) != 1) { printf("Multi-volume disks not (yet) supported.\n"); return -1; }; +#endif sb.s_nzones = isonum_733 (h_pri->volume_space_size); sb.s_log_zone_size = isonum_723 (h_pri->logical_block_size); @@ -769,10 +770,14 @@ } else { rootp = (struct iso_directory_record *) pri->root_directory_record; +#if 0 +//See http://www.y-adagio.com/public/standards/iso_cdromr/sect_1.htm +//Section 4.16 and 4.17 for explanation why this check is invalid if (isonum_723 (pri->volume_set_size) != 1) { printf("Multi-volume disks not (yet) supported.\n"); return -1; } +#endif sb.s_nzones = isonum_733 (pri->volume_space_size); sb.s_log_zone_size = isonum_723 (pri->logical_block_size); sb.s_max_size = isonum_733(pri->volume_space_size); @@ -829,6 +834,7 @@ /* return successfully */ root_inode = isonum_733 (rootp->extent) << sb.s_log_zone_size; + /* HK: isonum_733 returns an "int" but root_inode is a long ? */ return 0; } @@ -852,6 +858,7 @@ /* get the root directory */ root = iso_iget(root_inode); +/* HK: iso_iget expects an "int" but root_inode is "long" ?? */ if (!root) { printf("iso9660: get root inode failed\n"); return -1; --- aboot-1.0~pre20040408.orig/lib/memcpy.c +++ aboot-1.0~pre20040408/lib/memcpy.c @@ -4,6 +4,7 @@ * Copyright (c) 1995 David Mosberger (davidm@cs.arizona.edu) */ #include +#include /* * Booting is I/O bound so rather than a time-optimized, we want --- aboot-1.0~pre20040408.orig/lib/memset.c +++ aboot-1.0~pre20040408/lib/memset.c @@ -4,6 +4,7 @@ * Copyright (c) 1995 David Mosberger (davidm@cs.arizona.edu) */ #include +#include /* * Booting is I/O bound so rather than a time-optimized, we want --- aboot-1.0~pre20040408.orig/lib/string.c +++ aboot-1.0~pre20040408/lib/string.c @@ -10,7 +10,8 @@ * * These are buggy as well.. */ - + +#include #include char * ___strtok = NULL; --- aboot-1.0~pre20040408.orig/net.c +++ aboot-1.0~pre20040408/net.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include "system.h" #include "config.h" #include "cons.h" @@ -27,6 +27,7 @@ #include "bootfs.h" #include "utils.h" #include "string.h" +#include "netwrap.h" extern char boot_file[256]; @@ -36,17 +37,16 @@ printf("aboot: oops, unimplemented net-bfs function called!\n"); } +extern char _end; +static char *src = 0; +static char *kern_src=0, *ird_src=0; +static int header_size=0, kern_size=0, ird_size=0; int net_bread (int fd, long blkno, long nblks, char * buf) { - static char * src = 0; - extern char _end; int nbytes; - if (!src) - src = (char *) (((unsigned long) &_end + 511) & ~511); - #ifdef DEBUG printf("net_bread: %p -> %p (%ld blocks at %ld)\n", src, buf, nblks, blkno); @@ -70,17 +70,72 @@ (int (*)(int, struct stat*)) dang, /* fstat */ }; +long +read_initrd() +{ + int nblocks, nread; + + /* put it as high up in memory as possible */ + initrd_start = free_mem_ptr - align_pagesize(ird_size); + initrd_size = ird_size; + /* update free_mem_ptr so malloc() still works */ + free_mem_ptr = initrd_start; +#ifdef DEBUG + printf("memory_end %x %x\n", free_mem_ptr, initrd_start); +#endif + + nblocks = align_512(ird_size)/ 512; + printf("aboot: loading initrd (%d bytes/%d blocks) at %#lx\n", + ird_size, nblocks, initrd_start); + nread = (*bfs->bread)(-1, 0, nblocks, (char*) initrd_start); + return 0; +} + + long load_kernel (void) { + struct header *header; bfs = &netfs; + header = (struct header *)align_512( (unsigned long)&_end ); + header_size = header->header_size; + kern_src = (char *)align_512((unsigned long)header + header_size); + kern_size = header->kern_size; + ird_src = (char *)align_512((unsigned long)kern_src + kern_size); + ird_size = header->ird_size; + + if (!free_mem_ptr) + free_mem_ptr = memory_end(); + free_mem_ptr = free_mem_ptr & ~(PAGE_SIZE-1); + +#ifdef DEBUG + printf("head %x %x kernel %x %x, initrd %x %x \n", header, header_size, kern_src, kern_size, ird_src, ird_size); +#endif + + if (ird_size) { + src = ird_src; + if (read_initrd() < 0) { + return -1; + } + } + strcpy(boot_file, "network"); + + //Move kernel to safe place before uncompression + src = (char*)free_mem_ptr - align_pagesize(kern_size); + free_mem_ptr = (unsigned long)src; + memcpy(src, kern_src, kern_size); + uncompress_kernel(-1); memset((char*)bss_start, 0, bss_size); /* clear bss */ + if (!kernel_args[0] && header->boot_arg[0]) { //have argument? + strncpy(kernel_args, header->boot_arg, header_size - sizeof(int)*3); + } + while (kernel_args[0] == 'i' && !kernel_args[1]) { printf("Enter kernel arguments:\n"); printf("aboot> "); --- aboot-1.0~pre20040408.orig/netabootwrap.c +++ aboot-1.0~pre20040408/netabootwrap.c @@ -0,0 +1,185 @@ +#include +#include +#include "system.h" +#include +#include +#include +#include +#include +#include "netwrap.h" +#include "bootloader.h" + + +char *tfn="netboot.img", *kfn="vmlinux.gz", *ifn=NULL, *barg=NULL; +char *progname; + +void print_usage(void ) +{ + printf("Following shows options and default values or example value\n"); + printf("%s -t netboot.img -k vmlinux.gz -i initrd.gz -a \"root=/dev/hda1 single\"\n", progname); + exit(1); +} + +void open_file(char *fn, int *fd, int *sz) +{ + struct stat buf; + + *fd = open(fn, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "%s: Cannot open %s\n", progname, fn); + print_usage(); + exit(1); + } + + fstat(*fd, &buf); + + if (buf.st_size <= 10*1024) { + fprintf(stderr, "%s:Is this a right file %s, size = %d\n", progname, fn, (int)buf.st_size); + print_usage(); + exit(1); + } + + *sz = buf.st_size; +} + +void append_file(int tfd, int sfd) +{ + char buf[4096]; + int red; + + while ((red=read(sfd, buf, 4096))) + write(tfd, buf, red); +} + +int main(int argc, char **argv) +{ + int tfd=0, kfd=0, ifd=0, ksz=0, isz=0; + struct header hdr; + char *stmp; + + progname=argv[0]; + + /* + * Read switches. + */ + for (argc--, argv++; argc > 0; argc--, argv++) { + if (argv[0][0] != '-') + break; + switch (argv[0][1]) { + + case 't': /* override target file name */ + if (argv[0][2]) { + stmp = &(argv[0][2]); + } else { + argc--; + argv++; + stmp = argv[0]; + } + if (!stmp) { + fprintf(stderr, + "%s: missing file name for target\n",progname); + break; + } + tfn = stmp; + break; + case 'k': /* override kernel name */ + if (argv[0][2]) { + stmp = &(argv[0][2]); + } else { + argc--; + argv++; + stmp = argv[0]; + } + if (!stmp) { + fprintf(stderr, + "%s: missing file name for kernel\n",progname); + break; + } + kfn = stmp; + break; + case 'i': /* override file name for initrd */ + if (argv[0][2]) { + stmp = &(argv[0][2]); + } else { + argc--; + argv++; + stmp = argv[0]; + } + if (!stmp) { + fprintf(stderr, + "%s: missing file name for initial RAM-disk\n",progname); + break; + } + ifn = stmp; + break; + case 'a': /* add kernel parameters */ + if (argv[0][2]) { + stmp = &(argv[0][2]); + } else { + argc--; + argv++; + stmp = argv[0]; + } + if (!stmp) { + fprintf(stderr, + "%s: No kernel parameters specified\n",progname); + break; + } + barg = stmp; + break; + default: + fprintf(stderr, "%s: unknown switch: -%c\n", + progname, argv[0][1]); + print_usage(); + break; + + } /* switch */ + } /* for args */ + + open_file(kfn, &kfd, &ksz); + + if (ifn) + open_file(ifn, &ifd, &isz); + + printf("Target file name is %s\n", tfn); + unlink(tfn); + tfd = open(tfn, O_RDWR|O_CREAT, 0644); + + write(tfd, bootloader, sizeof(bootloader)); + + hdr.header_size = sizeof(int)*3; + hdr.kern_size = ksz; + hdr.ird_size = isz; + + if (barg) printf("With kernel arguments : %s \n", barg); + else printf("Without kernel argument\n"); + + if (barg) { + if (strlen(barg) >= 200) { + printf("Kernel argument-list is too long\n"); + exit(1); + } + strncpy(hdr.boot_arg, barg, strlen(barg)+1); + hdr.header_size += strlen(barg)+1; + } + + lseek(tfd, align_512(sizeof(bootloader)), SEEK_SET); + write(tfd, &hdr, hdr.header_size); + + printf("Binding kernel %s\n", kfn); + lseek(tfd, align_512((unsigned long)lseek(tfd, 0, SEEK_CUR)), SEEK_SET); + append_file(tfd, kfd); + + if (ifn) { + printf("Binding initrd %s\n", ifn); + lseek(tfd, align_512((unsigned long)lseek(tfd, 0, SEEK_CUR)), SEEK_SET); + append_file(tfd, ifd); + } + + close(tfd); + printf("Done.\n"); + return 0; +} + + + --- aboot-1.0~pre20040408.orig/netwrap.h +++ aboot-1.0~pre20040408/netwrap.h @@ -0,0 +1,17 @@ +struct header { + int header_size; + int kern_size; + int ird_size; + char boot_arg[200]; +} ; + +unsigned long align_pagesize(unsigned long v) +{ + return ((v + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1)); +} + +unsigned long align_512(unsigned long v) +{ + return ((v + 511) & ~511); +} + --- aboot-1.0~pre20040408.orig/sdisklabel/.cvsignore +++ aboot-1.0~pre20040408/sdisklabel/.cvsignore @@ -0,0 +1,2 @@ +sdisklabel +swriteboot --- aboot-1.0~pre20040408.orig/sdisklabel/Makefile +++ aboot-1.0~pre20040408/sdisklabel/Makefile @@ -1,13 +1,15 @@ -CC = gcc -O2 -CFLAGS= -I../include $(CPPFLAGS) -Wall +ifndef ($(CC)) +CC = gcc +endif +override CFLAGS += -g -O2 -I../include -Wall $(CPPFLAGS) all: sdisklabel swriteboot sdisklabel: sdisklabel.o library.o - $(CC) $(LDFLAGS) sdisklabel.o library.o -o sdisklabel + $(CC) $(LDFLAGS) $(CFLAGS) sdisklabel.o library.o -o sdisklabel swriteboot: swriteboot.o library.o - $(CC) $(LDFLAGS) swriteboot.o library.o -o swriteboot + $(CC) $(LDFLAGS) $(CFLAGS) swriteboot.o library.o -o swriteboot clean: rm -f sdisklabel swriteboot *.o --- aboot-1.0~pre20040408.orig/sdisklabel/swriteboot.c +++ aboot-1.0~pre20040408/sdisklabel/swriteboot.c @@ -6,7 +6,7 @@ #include #include -#include +#include "system.h" #include #include #include "library.h" --- aboot-1.0~pre20040408.orig/srmbootfat/COPYING +++ aboot-1.0~pre20040408/srmbootfat/COPYING @@ -0,0 +1,349 @@ +This software uses part of mtools-3.9. +Mtools are Copyright (C) 1995 Alain Knaff. +The rest is Copyright (C) 1998 Nikita Schmidt. + + You may use, distribute and copy this program according to the terms of the +GNU General Public License version 2 or later. + + Alain Knaff +---------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. --- aboot-1.0~pre20040408.orig/srmbootfat/Makefile +++ aboot-1.0~pre20040408/srmbootfat/Makefile @@ -0,0 +1,24 @@ +ifndef ($(CC)) +CC = gcc +endif +override CFLAGS += -O2 -g -pipe -Wall +#override LDFLAGS += -s +SBINDIR = ../bin + +all: srmbootfat srmbootraw srmbootfat.1 srmbootraw.8 + +srmbootfat: srmbootfat.c msdos.h + $(CC) $(CFLAGS) $(LDFLAGS) -o srmbootfat srmbootfat.c + +srmbootraw: srmbootraw.c + $(CC) $(CFLAGS) $(LDFLAGS) -o srmbootraw srmbootraw.c + +srmbootfat.1: srmbootfat.sgml + nsgmls srmbootfat.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +srmbootraw.8: srmbootraw.sgml + nsgmls srmbootraw.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl + +clean: + rm -f srmbootfat srmbootraw srmbootfat.1 srmbootraw.8 manpage.links manpage.log manpage.refs + --- aboot-1.0~pre20040408.orig/srmbootfat/README +++ aboot-1.0~pre20040408/srmbootfat/README @@ -0,0 +1,5 @@ +The contents of this diretory are taken from the milo source +which can be found at http://milo.coresystems.de/source/milo-2.2-18.tar.bz2 + +Additional patches to srmbootfat have been applied; also the man pages are +improved in respect to the upstream version. --- aboot-1.0~pre20040408.orig/srmbootfat/msdos.h +++ aboot-1.0~pre20040408/srmbootfat/msdos.h @@ -0,0 +1,160 @@ +#ifndef MTOOLS_MSDOS_H +#define MTOOLS_MSDOS_H + +/* + * msdos common header file + */ + +#define MAX_SECTOR 8192 /* largest sector size */ +#define MDIR_SIZE 32 /* MSDOS directory entry size in bytes*/ +#define MAX_CLUSTER 8192 /* largest cluster size */ +#define MAX_PATH 128 /* largest MSDOS path length */ +#define MAX_DIR_SECS 64 /* largest directory (in sectors) */ + +#define NEW 1 +#define OLD 0 + +#define _WORD(x) ((unsigned char)(x)[0] + (((unsigned char)(x)[1]) << 8)) +#define _DWORD(x) (_WORD(x) + (_WORD((x)+2) << 16)) + +#define DELMARK ((char) 0xe5) + +struct directory { + char name[8]; /* 0 file name */ + char ext[3]; /* 8 file extension */ + unsigned char attr; /* 11 attribute byte */ + unsigned char Case; /* 12 case of short filename */ + unsigned char ctime_ms; /* 13 creation time, milliseconds (?) */ + unsigned char ctime[2]; /* 14 creation time */ + unsigned char cdate[2]; /* 16 creation date */ + unsigned char adate[2]; /* 18 last access date */ + unsigned char startHi[2]; /* 20 start cluster, Hi */ + unsigned char time[2]; /* 22 time stamp */ + unsigned char date[2]; /* 24 date stamp */ + unsigned char start[2]; /* 26 starting cluster number */ + unsigned char size[4]; /* 28 size of the file */ +}; + +#define EXTCASE 0x10 +#define BASECASE 0x8 + +#define MAX32 0xffffffff +#define MAX_SIZE 0x7fffffff + + + +typedef struct InfoSector_t { + unsigned char signature0[4]; + unsigned char filler[0x1e0]; + unsigned char signature[4]; + unsigned char count[4]; + unsigned char pos[4]; +} InfoSector_t; + +#define INFOSECT_SIGNATURE0 0x41615252 +#define INFOSECT_SIGNATURE 0x61417272 + + +/* FAT32 specific info in the bootsector */ +typedef struct fat32_t { + unsigned char bigFat[4]; /* 36 nb of sectors per FAT */ + unsigned char extFlags[2]; /* 40 extension flags */ + unsigned char fsVersion[2]; /* 42 ? */ + unsigned char rootCluster[4]; /* 44 start cluster of root dir */ + unsigned char infoSector[2]; /* 48 changeable global info */ + unsigned char backupBoot[2]; /* 50 back up boot sector */ + unsigned char reserved[6]; /* 52 ? */ +} fat32; /* ends at 58 */ + +typedef struct oldboot_t { + unsigned char physdrive; /* 36 physical drive ? */ + unsigned char reserved; /* 37 reserved */ + unsigned char dos4; /* 38 dos > 4.0 diskette */ + unsigned char serial[4]; /* 39 serial number */ + char label[11]; /* 43 disk label */ + char fat_type[8]; /* 54 FAT type */ + + unsigned char res_2m; /* 62 reserved by 2M */ + unsigned char CheckSum; /* 63 2M checksum (not used) */ + unsigned char fmt_2mf; /* 64 2MF format version */ + unsigned char wt; /* 65 1 if write track after format */ + unsigned char rate_0; /* 66 data transfer rate on track 0 */ + unsigned char rate_any; /* 67 data transfer rate on track<>0 */ + unsigned char BootP[2]; /* 68 offset to boot program */ + unsigned char Infp0[2]; /* 70 T1: information for track 0 */ + unsigned char InfpX[2]; /* 72 T2: information for track<>0 */ + unsigned char InfTm[2]; /* 74 T3: track sectors size table */ + unsigned char DateF[2]; /* 76 Format date */ + unsigned char TimeF[2]; /* 78 Format time */ + unsigned char junk[1024 - 80]; /* 80 remaining data */ +} oldboot_t; + +struct bootsector { + unsigned char jump[3]; /* 0 Jump to boot code */ + char banner[8]; /* 3 OEM name & version */ + unsigned char secsiz[2]; /* 11 Bytes per sector hopefully 512 */ + unsigned char clsiz; /* 13 Cluster size in sectors */ + unsigned char nrsvsect[2]; /* 14 Number of reserved (boot) sectors */ + unsigned char nfat; /* 16 Number of FAT tables hopefully 2 */ + unsigned char dirents[2]; /* 17 Number of directory slots */ + unsigned char psect[2]; /* 19 Total sectors on disk */ + unsigned char descr; /* 21 Media descriptor=first byte of FAT */ + unsigned char fatlen[2]; /* 22 Sectors in FAT */ + unsigned char nsect[2]; /* 24 Sectors/track */ + unsigned char nheads[2]; /* 26 Heads */ + unsigned char nhs[4]; /* 28 number of hidden sectors */ + unsigned char bigsect[4]; /* 32 big total sectors */ + + union { + struct fat32_t fat32; + struct oldboot_t old; + } ext; +}; + +extern struct OldDos_t { + unsigned int tracks; + unsigned int sectors; + unsigned int heads; + + unsigned int dir_len; + unsigned int cluster_size; + unsigned int fat_len; + + unsigned int media; +} old_dos[]; + +#define FAT12 4085 /* max. number of clusters described by a 12 bit FAT */ +#define FAT16 65525 + +#define MAX_SECT_PER_CLUSTER 64 +/* Experimentally, it turns out that DOS only accepts cluster sizes + * which are powers of two, and less than 128 sectors (else it gets a + * divide overflow) */ + + +#define FAT_SIZE(bits, sec_siz, clusters) \ + ((((clusters)+2) * ((bits)/4) - 1) / 2 / (sec_siz) + 1) + +#define NEEDED_FAT_SIZE(x) FAT_SIZE((x)->fat_bits, (x)->sector_size, \ + (x)->num_clus) + +/* disk size taken by FAT and clusters */ +#define DISK_SIZE(bits, sec_siz, clusters, n, cluster_size) \ + ((n) * FAT_SIZE(bits, sec_siz, clusters) + \ + (clusters) * (cluster_size)) + +#define TOTAL_DISK_SIZE(bits, sec_siz, clusters, n, cluster_size) \ + (DISK_SIZE(bits, sec_siz, clusters, n, cluster_size) + 2) +/* approx. total disk size: assume 1 boot sector and one directory sector */ + +extern const char *mversion; +extern const char *mdate; + + + +int init(char drive, int mode); + +#define MT_READ 1 +#define MT_WRITE 2 + +#endif --- aboot-1.0~pre20040408.orig/srmbootfat/srmbootfat.c +++ aboot-1.0~pre20040408/srmbootfat/srmbootfat.c @@ -0,0 +1,246 @@ +/* + * SRMbootFAT - SRM boot block composer for FAT filesystems. + * Copyright (C) 1998 Nikita Schmidt + * msdos.h is Copyright (C) 1995 Alain Knaff. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "msdos.h" + +/* This should test for little-endianness, but why bother, + the whole thing is Alpha-specific anyway. */ +#ifdef __alpha__ /* Little endian */ +#define WORD(x) (*(u_int16_t *)(x)) +#define DWORD(x) (*(u_int32_t *)(x)) +#else /* Big endian; in fact, generic stuff */ +#define WORD _WORD +#define DWORD _DWORD +#endif + +union full_bootsector { + struct bootsector dos; + struct { + unsigned char textlabel[64]; + unsigned char disklabel[276]; + unsigned char unused[140]; + u_int64_t count, start, flags; + u_int64_t checksum; + } srm; + struct { + u_int64_t contents[63]; + u_int64_t checksum; + } check; +}; + +#ifdef __alpha__ /* Should be test for little endian */ +unsigned int get_fat_entry (unsigned char *fat, int fatbits, unsigned entry) +{ + unsigned i, a, b; + + /* No check for fat boundaries... */ + switch (fatbits) { + case 12: + i = ((entry *= 3) & 7) << 2; /* Number of bits to shift */ + a = ((u_int32_t *)fat)[entry >>= 3]; + b = ((u_int32_t *)fat)[entry + 1]; /* May be outside FAT */ + return ((a >> i) | (b << (32 - i))) & 0xFFF; + case 16: + return ((u_int16_t *)fat)[entry]; + } + fprintf (stderr, "Unknown FAT type - FAT-%d\n", fatbits); + exit (3); +} +#else +// Portable Version from Falk Hueffner +unsigned int get_fat_entry (unsigned char *fat, int fatbits, unsigned entry) +{ + unsigned i, a, b; + + /* No check for fat boundaries... */ + switch (fatbits) { + case 12: + i = ((entry *= 3) & 7) << 2; /* Number of bits to shift */ + entry >>= 3; + a = DWORD(fat + 4 * entry); + b = DWORD(fat + 4 * entry + 4); + return ((a >> i) | (b << (32 - i))) & 0xFFF; + case 16: + return WORD(fat + 2 * entry); + } + fprintf (stderr, "Unknown FAT type - FAT-%d\n", fatbits); + exit (3); +} +#endif + +int main (int argc, char *argv[]) +{ + int f; + int i; + char *p; + union full_bootsector boot; + unsigned secsize; /* Bytes per sector, hopefully 512 */ + unsigned clusize; /* Cluster size in sectors */ + unsigned fatstart; /* Number of reserved (boot) sectors */ + unsigned nfat; /* Number of FAT tables, hopefully 2 */ + unsigned dirents; /* Number of directory slots */ + unsigned psect; /* Total sectors on disk */ + unsigned media; /* Media descriptor=first byte of FAT */ + unsigned fatsize; /* Sectors in FAT */ + unsigned fatbits; /* FAT type (bits per entry) */ + unsigned char *fat; + struct directory *rootdir; + unsigned start; /* Starting cluster of the boot file */ + unsigned size; /* Boot file size */ + unsigned fat_end; + unsigned j; + u_int64_t checksum; + char dosname[12]; + + if (argc != 3) + return printf ("Usage: srmbootfat \n"), 1; + + if ((f = open (argv[1], O_RDWR)) < 0) + return perror (argv[1]), 2; + + if (read (f, &boot, sizeof boot) != sizeof boot) + return fprintf (stderr, "Can't read boot sector from %s\n", argv[1]), 2; + + secsize = _WORD (boot.dos.secsiz); + clusize = boot.dos.clsiz; + fatstart = WORD (boot.dos.nrsvsect); + nfat = boot.dos.nfat; + dirents = _WORD (boot.dos.dirents); + psect = _WORD (boot.dos.psect); + media = boot.dos.descr; + fatsize = WORD (boot.dos.fatlen); + + if ((media & ~7) == 0xf8) { + i = media & 3; + clusize = old_dos[i].cluster_size; + fatstart = 1; + fatsize = old_dos[i].fat_len; + dirents = old_dos[i].dir_len * (512 / MDIR_SIZE); + nfat = 2; + fatbits = 12; + } else if (strncmp (boot.dos.ext.old.fat_type, "FAT12", 5) == 0) + fatbits = 12; + else if (strncmp (boot.dos.ext.old.fat_type, "FAT16", 5) == 0) + fatbits = 16; + else return fprintf (stderr, "%s: unrecognisable FAT type\n", argv[1]), + 3; +#ifdef DEBUG + printf ("%s: filesystem type is FAT-%d\n", argv[1], fatbits); +#endif + + if (secsize != 512) + return fprintf (stderr, "%s: sector size is %d; " + "unfortunately, this is not supported\n", + argv[1], secsize), + 3; + if (nfat != 1 && nfat != 2) + fprintf (stderr, + "%s: warning: weird number of FAT tables (%d)\n", + argv[1], nfat); + + fat = malloc (i = fatsize * secsize); + rootdir = malloc (dirents * MDIR_SIZE); + if (!fat || !rootdir) + return fprintf (stderr, "Not enough memory\n"), 2; + if (lseek (f, fatstart * secsize, SEEK_SET) == -1 + || read (f, fat, i) != i + || lseek (f, (nfat - 1) * i, SEEK_CUR) == -1 + || read (f, rootdir, dirents * MDIR_SIZE) != dirents * MDIR_SIZE) + return perror (argv[1]), 2; + + memset (dosname, ' ', sizeof dosname); + i = 0; + for (p = argv[2]; *p; p++) + if (*p == '.') + i = 8; + else if (i < sizeof dosname) + dosname[i++] = toupper (*p); + + for (i = 0; i < dirents; i++) + if (memcmp (rootdir[i].name, dosname, 11) == 0 + && (rootdir[i].attr & (8 | 16)) == 0) + break; + if (i == dirents) + return fprintf (stderr, + "Can't find %s in the root directory in %s\n", + argv[2], argv[1]), 4; + + start = WORD (rootdir[i].start); + size = DWORD (rootdir[i].size); + + if (start * fatbits > fatsize * secsize * 8) + return fprintf (stderr, + "%s: first cluster (%u) is beyond the end of FAT", + argv[2], start), 3; + + /* Fill in the bootstrap information */ + size = (size + secsize - 1) / secsize; /* Size is now in sectors */ + boot.srm.start = (start - 2) * clusize + fatstart + nfat * fatsize + + dirents / (512 / MDIR_SIZE); + boot.srm.count = size; + boot.srm.flags = 0; + + /* Check that the image is contiguous */ + i = 1; + fat_end = (1 << fatbits) - 9; /* 0xFF7, 0xFFF7 or whatever */ + while ((j = get_fat_entry (fat, fatbits, start)) < fat_end) { + if (j != start + 1) + return fprintf (stderr, + "Unfortunately, %s is not contiguous\n", + argv[2]), 4; + start = j; + i++; + } + if ((size + clusize - 1) / clusize != i) + return fprintf (stderr, "Inconsistency: file size contradicts " + "with the number of clusters allocated\n"), 3; + + /* Put the checksum and write the boot sector. */ + checksum = 0; + for (i = 0; i < 63; i++) + checksum += boot.check.contents[i]; + boot.check.checksum = checksum; + + printf ("Writing SRM boot block: starting sector %u, block count %u\n", + (unsigned)boot.srm.start, (unsigned)boot.srm.count); + + if (lseek (f, 0, SEEK_SET) == -1 + || write (f, &boot, sizeof boot) != sizeof boot) + return perror (argv[2]), 2; + + close (f); + return 0; +} + +struct OldDos_t old_dos[]={ + { 40, 9, 1, 4, 1, 2, 0xfc }, + { 40, 9, 2, 7, 2, 2, 0xfd }, + { 40, 8, 1, 4, 1, 1, 0xfe }, + { 40, 8, 2, 7, 2, 1, 0xff }, + { 80, 9, 2, 7, 2, 3, 0xf9 }, + { 80, 15, 2,14, 1, 7, 0xf9 }, + { 80, 18, 2,14, 1, 9, 0xf0 }, + { 80, 36, 2,15, 2, 9, 0xf0 }, + { 1, 8, 1, 1, 1, 1, 0xf0 } +}; --- aboot-1.0~pre20040408.orig/srmbootfat/srmbootfat.sgml +++ aboot-1.0~pre20040408/srmbootfat/srmbootfat.sgml @@ -0,0 +1,85 @@ + + + + +srmbootfat +1 +srmbootfat + + + +srmbootfat + +Linux/Alpha SRM boot block composer + + + + + + srmbootfat + filesystem_image + boot_file + + + + + +DESCRIPTIONS + +srmbootfat +This tool is a quick hack and is not supposed to exist in its present +state for long. + + + +Srmbootfat finds boot_file +in the root directory of the FAT file system stored in file +filesystem_image +and makes it bootable by writing the appropriate SRM boot block into the +file system image file. This will work only on unpartitioned disks (such as +floppies), because otherwise the boot block would need to be written into the +partition table, which is outside the file system. However, a hard drive +containing a FAT file system would most probably be partitioned using the PC +partition table, which SRM cannot boot from anyway. + + + +The bootloader (boot_file) +must be contiguous, i.e. occupy consecutive blocks. + + + +ARGUMENTS + + +filesystem_image + +The name of the file containing a FAT file system image, e.g. +/dev/fd0. + +boot_file + +The file name of the bootloader. + + + + + + +AUTHOR + +Nikita Schmidt cetus@snowball.ucd.ie + + +SEE ALSO + +aboot(8), mke2fs(8), e2writeboot(8) + + + --- aboot-1.0~pre20040408.orig/srmbootfat/srmbootraw.c +++ aboot-1.0~pre20040408/srmbootfat/srmbootraw.c @@ -0,0 +1,101 @@ +/* + * SRMbootraw - SRM boot block composer for raw boot partitions. + * Copyright (C) 1998 Nikita Schmidt + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include + +/* We assume little endiannes and possibly other Alpha properties as well. */ +#ifndef __alpha__ +#error This stuff must be compiled for Alpha. +#endif + +#define BUFSIZE 65536 + +union bootsector { + struct { + unsigned char textlabel[64]; + unsigned char disklabel[276]; + unsigned char unused[140]; + u_int64_t count, start, flags; + u_int64_t checksum; + } srm; + struct { + u_int64_t contents[63]; + u_int64_t checksum; + } check; +}; + + +int main (int argc, char *argv[]) +{ + int device, image; + int i; + union bootsector boot; + char *buf; + unsigned long size; + ssize_t len; + u_int64_t checksum; + + if (argc != 3) + return printf ("Usage: srmbootraw \n"), 1; + + if ((device = open (argv[1], O_RDWR)) < 0) + return perror (argv[1]), 2; + if ((image = open (argv[2], O_RDONLY)) < 0) + return perror (argv[2]), 2; + + /* Read in the old bootsector */ + if (read (device, &boot, sizeof boot) != sizeof boot) + return fprintf (stderr, "Can't read boot sector from %s\n", argv[1]), 2; + + if (!(buf = malloc (BUFSIZE))) + return fprintf (stderr, "Can't allocate memory for %s\n", argv[2]), 2; + + /* Copy image onto the device */ + size = 0; + while ((len = read (image, buf, BUFSIZE)) > 0) + { + if (write (device, buf, len) != len) + return fprintf (stderr, "Can't write to %s\n", argv[1]), 2; + size += len; + } + close (image); + if (len == -1) + return perror (argv[2]), 2; + + /* Fill in the bootstrap information */ + boot.srm.start = 1; + boot.srm.count = (size + 511) / 512; /* Convert to sectors */ + boot.srm.flags = 0; + + /* Put the checksum and write the boot sector. */ + checksum = 0; + for (i = 0; i < 63; i++) + checksum += boot.check.contents[i]; + boot.check.checksum = checksum; + + printf ("Writing SRM boot block: starting sector %u, block count %u\n", + (unsigned)boot.srm.start, (unsigned)boot.srm.count); + + if (lseek (device, 0, SEEK_SET) == -1 + || write (device, &boot, sizeof boot) != sizeof boot) + return perror (argv[2]), 2; + + close (device); + return 0; +} --- aboot-1.0~pre20040408.orig/srmbootfat/srmbootraw.sgml +++ aboot-1.0~pre20040408/srmbootfat/srmbootraw.sgml @@ -0,0 +1,84 @@ + + + + +srmbootraw +8 +srmbootraw + + + +srmbootraw + +Linux/Alpha SRM boot block composer + + + + + + srmbootraw + boot_device + boot_file + + + + + +DESCRIPTIONS + +srmbootraw +This tool is a quick hack and is not supposed to exist in its present +state for long. + + + +Srmbootraw writes the image from +boot_file +preceded by the appropriate SRM boot block into the first blocks of +boot_device, preserving the disklabel. +It is intended to be used when you have a small raw +partition at the beginning of your hard drive, dedicated for the bootloader. +If you don't, srmbootraw +will silently render your file system(s) unusable. + + + +ARGUMENTS + + +boot_device + +The device you intend to boot from, e.g. /dev/sda. +It must have enough room +at the beginning to hold the boot block and the bootloader. + +boot_file + +The file name of the bootloader. + + + + + + +AUTHOR + +Nikita Schmidt cetus@snowball.ucd.ie + + +SEE ALSO + +aboot(8), +mke2fs(8), +swriteboot(8), +e2writeboot(8), +srmbootfat(1) + + + --- aboot-1.0~pre20040408.orig/tools/.cvsignore +++ aboot-1.0~pre20040408/tools/.cvsignore @@ -0,0 +1,5 @@ +abootconf +e2writeboot +elfencap +isomarkboot +objstrip --- aboot-1.0~pre20040408.orig/tools/Makefile +++ aboot-1.0~pre20040408/tools/Makefile @@ -1,14 +1,16 @@ +ifndef ($(CC)) CC = gcc -CFLAGS = -g -O2 -Wall -I. -I../include $(CPPFLAGS) -LDFLAGS = -g -PGMS = e2writeboot isomarkboot abootconf elfencap objstrip +endif +override CFLAGS += -g -O2 -Wall -I. -I../include $(CPPFLAGS) +#override LDFLAGS += -g +override PGMS += e2writeboot isomarkboot abootconf elfencap objstrip EXEC_PREFIX = /usr all: $(PGMS) install: $(PGMS) - install -s -c -o root -g root -m 755 $(PGMS) $(EXEC_PREFIX)/bin + install -c -o root -g root -m 755 $(PGMS) $(EXEC_PREFIX)/bin clean: rm -f *~ *.o *.a core $(PGMS) --- aboot-1.0~pre20040408.orig/tools/elfencap.c +++ aboot-1.0~pre20040408/tools/elfencap.c @@ -16,8 +16,8 @@ char buf[8192]; struct stat st; struct { - struct elfhdr ehdr; - struct elf_phdr phdr; + struct elf64_hdr ehdr; + struct elf64_phdr phdr; } h; ifd = open(argv[1], O_RDONLY); @@ -35,11 +35,11 @@ h.ehdr.e_ident[0] = 0x7f; strcpy(h.ehdr.e_ident + 1, "ELF"); - h.ehdr.e_ident[EI_CLASS] = ELF_CLASS; - h.ehdr.e_ident[EI_DATA] = ELF_DATA; + h.ehdr.e_ident[EI_CLASS] = ELFCLASS64; + h.ehdr.e_ident[EI_DATA] = ELFDATA2LSB; h.ehdr.e_ident[EI_VERSION] = EV_CURRENT; h.ehdr.e_type = ET_EXEC; - h.ehdr.e_machine = ELF_ARCH; + h.ehdr.e_machine = EM_ALPHA; h.ehdr.e_version = EV_CURRENT; h.ehdr.e_entry = 0xfffffc0000310000; h.ehdr.e_phnum = 1; --- aboot-1.0~pre20040408.orig/tools/isomarkboot.c +++ aboot-1.0~pre20040408/tools/isomarkboot.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -37,14 +37,12 @@ static int disk; - void __memcpy (void * dest, const void * src, size_t n) { memcpy (dest, src, n); } - long iso_dev_read (void * buf, long offset, long size) { @@ -55,7 +53,35 @@ return read(disk, buf, size); } +/* Write a 64-bit quantity out into memory in LITTLE ENDIAN order */ +static void write_64 (unsigned char* out, unsigned long long in) +{ + out[0] = in & 0xFF; + out[1] = (in >> 8) & 0xFF; + out[2] = (in >> 16) & 0xFF; + out[3] = (in >> 24) & 0xFF; + out[4] = (in >> 32) & 0xFF; + out[5] = (in >> 40) & 0xFF; + out[6] = (in >> 48) & 0xFF; + out[7] = (in >> 56) & 0xFF; +} +/* Read in a 64-bit LITTLE ENDIAN quantity */ +static unsigned long long read_64 (unsigned char *in) +{ + unsigned long long result = 0; + + result |= (unsigned long long) in[0]; + result |= (unsigned long long) in[1] << 8; + result |= (unsigned long long) in[2] << 16; + result |= (unsigned long long) in[3] << 24; + result |= (unsigned long long) in[4] << 32; + result |= (unsigned long long) in[5] << 40; + result |= (unsigned long long) in[6] << 48; + result |= (unsigned long long) in[7] << 56; + + return result; +} int main (int argc, char ** argv) @@ -119,15 +145,16 @@ } strcpy((char *) sector, "Linux/Alpha aboot for ISO filesystem."); - sector[60] = aboot_size / 512; /* sector count */ - sector[61] = aboot_pos / 512; /* starting LBM */ - sector[62] = 0; /* flags */ + write_64 ((unsigned char *) §or[60], aboot_size / 512);/* sector count */ + write_64 ((unsigned char *) §or[61], aboot_pos / 512); /* starting LBM */ + write_64 ((unsigned char *) §or[62], 0); /* flags */ /* update checksum: */ sum = 0; - for (i = 0; i < 63; ++i) - sum += sector[i]; - sector[63] = sum; + for (i = 0; i < 63; i++) + sum += read_64 ((unsigned char *) §or[i]); + + write_64 ((unsigned char *) §or[63], sum); if (lseek(disk, 0, SEEK_SET) != 0) { perror("lseek"); --- aboot-1.0~pre20040408.orig/tools/objstrip.c +++ aboot-1.0~pre20040408/tools/objstrip.c @@ -21,15 +21,17 @@ #include #include -#include +#include #include #include #include #ifdef __ELF__ -# include # include # include +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) +# define elf_check_arch(x) ((x)->e_machine == EM_ALPHA) +# endif # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) # define aboot_elf_check_arch(e) elf_check_arch(e) # else @@ -62,8 +64,8 @@ struct exec * aout; /* includes file & aout header */ long offset; #ifdef __ELF__ - struct elfhdr *elf; - struct elf_phdr *elf_phdr; /* program header */ + struct elf64_hdr *elf; + struct elf64_phdr *elf_phdr; /* program header */ unsigned long long e_entry; #endif @@ -150,7 +152,7 @@ } #ifdef __ELF__ - elf = (struct elfhdr *) buf; + elf = (struct elf64_hdr *) buf; if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) { if (elf->e_type != ET_EXEC) { @@ -177,7 +179,7 @@ exit(1); } - elf_phdr = (struct elf_phdr *) buf; + elf_phdr = (struct elf64_phdr *) buf; offset = elf_phdr->p_offset; mem_size = elf_phdr->p_memsz; fil_size = elf_phdr->p_filesz; --- aboot-1.0~pre20040408.orig/utils.c +++ aboot-1.0~pre20040408/utils.c @@ -1,16 +1,16 @@ #include -#include +#include "hwrpb.h" #include -#include +#include "system.h" + +#include "string.h" #include #include #include "aboot.h" #include "cons.h" -#include "string.h" - unsigned long free_mem_ptr = 0; --- aboot-1.0~pre20040408.orig/zip/misc.c +++ aboot-1.0~pre20040408/zip/misc.c @@ -11,7 +11,8 @@ */ #include -#include +#include +typedef __kernel_ssize_t ssize_t; #include "aboot.h" #include "bootfs.h"