diff options
Diffstat (limited to 'sys/arch/i386/stand/README')
-rw-r--r-- | sys/arch/i386/stand/README | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sys/arch/i386/stand/README b/sys/arch/i386/stand/README new file mode 100644 index 00000000000..5a92aa772ac --- /dev/null +++ b/sys/arch/i386/stand/README @@ -0,0 +1,62 @@ +$OpenBSD: README,v 1.1 1997/03/31 03:11:59 weingart Exp $ + + +Ok, just a couple quick pointers to people hacking on this stuff. These +are things that I have found out, and hopefully will make things easier +for the next dude. + +First of all, don't trust gas to get the opcodes right. Look at the +listing (-Wa,a), and check them. In particular, check for EIP relative +and absolute addressing. Some of this stuff is pretty hairy in that way. + +Debugging this stuff is hell. Remember that stores directly to video +memory will go a long way towards tracking how far things are getting, +especially when you don't have the BIOS handy. (movl %0x07410741, 0xb8000) + + +The basics of the /boot system is the following: + +biosboot: 512 bytes of the first sector on the disk/partition. This loads +/boot (or whatever you did with installboot) into ram. + +boot: relocates itself, and starts protected mode. There is some magic here +in terms of the placement and size of the various segments, as this piece of +code has to switch between real and protected mode many times to load the +next piece of the puzzle, /bsd.gz. + +bsd: The kernel itself, can be gzipped if ya want. + + +The basic steps at creating a boot floppy for yourself, and checking things +out are the following: + +1.) Compile a kernel you wish to use. +2.) Compile the new stand stuff. +3.) Mount floppy. +4.) Copy boot and kernel to floppy. (Kernel could be gzipped if needed) +5.) Run installboot on floppy. +6.) Unmount floppy. +7.) Test... + +A quick pasto for ya: +> natasha# mount /dev/fd0a /mnt +> natasha# cp boot/obj/boot /mnt +> natasha# gzip -9c bsd > /mnt/bsd.gz +> natasha# installboot -v /mnt/boot biosboot /dev/rfd0a +> boot: /mnt/boot +> proto: biosboot/obj/biosboot +> device: /dev/rfd0a +> +> biosboot/obj/biosboot: entry point 0 +> proto bootblock size 512 +> room for 32 filesystem blocks at 0x138 +> Will load 9 blocks of size 4096 each. +> 0: 4 @(2 1 15) (104-107) +> 1: 18 @(3 0 1) (108-125) +> 2: 18 @(3 1 1) (126-143) +> 3: 18 @(4 0 1) (144-161) +> 4: 14 @(4 1 1) (162-175) +> /mnt/boot: 5 entries total +> natasha# umount /mnt +> natasha# + |