ignore and set it to 18 sectors/track. This allows FreeBSD to boot with
2.88MB floppies which are used in older ThinkPads.
Submitted by: Random Net person whose name I lost
Claim the major numbers (before sombedoy else jumps in again and
claims the slots for his foocd driver :-), install all the hooks that
are required.
While i've been at this, i've cleaned up some of the routines at the
end of i386/conf.c; all the importers of the latest CDROM drivers
forgot to fill in the appropriate information. The `ata' driver
(vapourware?) does only occupy a slot in the bdevsw[] array, btw.
The actual import of the code does require a minor change in the SCSI
subsystem, and i want to have this reviewed by Peter first, so it will
be deferred for some days. The driver is already working for me
though.
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
user has entered a bogus kernel name in the first place).
Also fix the broken #ifdef FORCE_COMCONSOLE, it has been disabled by
accident. (NB: the keyboard probe remains disabled however.)
Few cosmetic fixes (declare functions to be void instead of int),
while i've been at this.
Pointed out by: wosch@cs.tu-berlin.de (Wolfram Schneider), for the init bug
serial_putchar() always hung if it was called and the serial port existed,
so booting with -h hung when the above bug was fixed. Previously, setting
-h did nothing but -h was sometimes the default due to the stack garbage
bug.
Submitted by: DI. Christian Gusenbauer <cg@scotty.edvz.uni-linz.ac.at>
The `howto' arg to boot() was not supplied, so it was stack garbage (actually
the return address in the boot program). I didn't use the submitted fix.
Change the interfaces of these functions to save space. The code
that takes the least amount of space is often the opposite to what
you might expect. E.g., it helps to waste a few bytes passing
pointers so that the compiler can't see that certain addresses
are identical (gcc likes to waste space by reloading fat constants
even when the constant is already in a register).
Rewrite getbootdev() to save 80 bytes of space and to make it less
ugly. 32 bytes were saved simply by omitting the continue statements
in the pseudo-switch.
recently introduced bloat in just 2 calls to biosread(), although
very little in calls to putc() and serial_putc(). Gcc produces
amazingly bad code for unnecessary conversions. E.g., if it has
`int x' in register %edx and wants to pass a char, then it could
simply push %edx and access only one byte in the callee. Instead,
it sometimes unnecessarily spills %edx; it always sign extends
%edx and pushes the result.
Remove useless `extern' in function prototypes.
Remove unused declaration of `end'.
Declare pbzero() and pcpy() like the library bzero and bcopy().
Declare printf() properly.
do fit, and beeping in case of an overflow.
. Drop a comment about the ``FORCE_COMCONSOLE'' option into
README.serial.
. Increase the name buffer for the root directory from 100 bytes
to 8 KB; this is in no way ideal, but (IMHO) the best that can
be done by now. People did encounter problems with their root
dir name listing overflowing the allocated buffer space. Once
we've got the three-stage boot, we should implement some basic
malloc(). Swap space is already getting tight now, perhaps the
swap should go into another 64 KB segment instead.
. Make the keyboard probe less paranoid. It should not give up in
case of a keyboard that's continuously demanding RESEND's. Even
though the keyboard reset apparently has not been reported to be
complete, it's at the very least proven that there IS something
like a keyboard available.
This solves problems with the ``Gateway-2000 AllKey programmable''
(sp?) keyboard, that experienced a total hang with the previous
probe.
Thanks goes to Scott Blachowicz <scott@statsci.com> for his
extensive testing of my various interim (debugging) bootblocks
to get this working.
interested parties.
Make the loader refuse to load anything below 1 MB -- we didn't
support it since FreeBSD 2.0R. Avoid gratuitously wiping out the BIOS
variables or the loader.
o Fix the keyboard probe to properly wait for the ready bit before
sending a command to the keyboard controller. This should avoid the
problems some people are experiencing where the boot blocks hang the
system during keyboard probe. (It does solve it for me.)
o Fix a bug that effectively prevented the boot blocks from ever
passing control to the serial console. [while(--retries) instead of
while(retries--)]
o Gratuitously reduced the keyboard probe timeout from 500 to 5
seconds. :)
o Introduced a new option ``FORCE_COMCONSOLE'' as a commented-out
example in the Makefile, to force the usage of a serial console
regardless of a keyboard being connected or not.
o Moved all external declarations to boot.h, declared all functions
there, and ANSIfied all function declarations/definitions.
(printf() remains bogus, however -- i'm too lazy to fix this.)
We're in the ninetees, dunno why we should still support compilers
from the 70's.
at least one user out there who's system won't autoboot from the
serial console because of what sounds like 'phantom keystrokes'
making the timeout timer trip. I've tried to solve this by
adding an extra call to init_serial() right before the 'Boot:'
prompt is printed (done only if RB_SERIAL is set) to hopefully
make sure that the input buffer is clear. Unfortunately, the fellow
is in Germany and I haven't heard back from him yet. I haven't
been able to duplicate this problem on my hardware, so this is
a stab in the dark. At the very least, it shouldn't hurt anything.
I'm not exactly sure why all the inb/outw stuff got added to netboot.h
and I'd be happy if someone like Martin or Bruce could take a look at it!
Submitted by: "Serge A. Babkin" <babkin@hq.icb.chel.su>
Install the biosboot as /usr/mdec/boot[12]
Make the traditional links from [swf]dboot and boot[swf]d to boot[12] files.
Install dosboot as /usr/mdec/boot/fbsdboot.exe
Feb. 10th snapshot. The keyboard probe in the bootblock seems to
have been singled out as the cause of these problems, so I've beefed it
up alittle. This pushes us right up to the edge of the size limit:
the second stage boot is now 7152 bytes in size, just 8 bytes under
the wire. On the other hand, the new probe now does almost exactly
what syscons does, so hopefully this will do the trick. It seems
to work properly on my hardware, but then so did the old probe.
It boots FreeBSD from a running MS-DOS system.
It's compiled using some MS-DOS tools, but there is a binary
hidden in the uuencoded file. (Go ahead, flame me if you can come up
with a solution for the problem. Just saying "this is bad" doesn't count!)
Rod, you were right: one would have to deal with weird interfaces to the
memory managers, and it seems that Christian found them all, and made them
work.
Thanks Christian!
Reviewed by: phk
Submitted by: DI. Christian Gusenbauer <cg@fimp01.fim.uni-linz.ac.at>
Christians README:
------------------
Hi Everybody!
This is version 1.5 of "fbsdboot", a program that allows you to boot a kernel
from a MS-DOS partition or a FreeBSD partition. This program runs using DOS.
It works with various memory managers (like EMM386, 386MAX) under certain
circumstances.
First, a FreeBSD kernel is always loaded to memory starting at 0x100000. To
assure that loading the kernel *does not* overwrite memory used by memory
managers, high memory for the kernel is allocated and after loading the kernel
it's moved to 0x100000.
Second, there are many ways to switch to protected mode which is necessary to
start the kernel. Each BIOS gives you the possibility to use INT15H (AH=89H)
to do that. But some memory-managers like 386max does not allow you to use
this method.
An other way to do the switch is to use DPMI services, but they do not
guarantee, that the protected mode application is executed with privilege
level 0. Therefore this method is *not* used.
VCPI services offer another way to switch to protected mode, and VCPI servers
are built into "emm386.exe", "386max" and "qemm". That's why, this method is
implemented in fbsdboot.exe.
Fbsdboot.exe tries to switch to protected mode using VCPI services. If they're
not available INT15H is used to do the switch. If that fails, it's not possible
for this version of fbsdboot.exe to boot a kernel :-(.
You can get commandline options of fbsdboot if you start it with "-?" as option!
I don't know, if fbsdboot works with QEMM, as I don't have the possibility to
test it.
Enjoy and have fun!
Christian.
cg@fimp01.fim.uni-linz.ac.at
PS: Many thanks to Bruce Evans for his assistance!
Submitted by: Rich
Make conditionals on BIOSWAIT consistent with usage in io.c.
If you had 'BOOTWAIT=0' in your /etc/make.conf then biosboot wouldn't
compile. It was '#if' in io.c and '#ifdef' in probe_keyboard.c so I
changed the latter to '#if'.
Even if BOOTWAIT is undefined then '#if BOOTWAIT' becomes
'#if 0' so it should compile either way with this change.
(Boot with the -D flag if you want symbols.)
Make it easier to extend `struct bootinfo' without losing either forwards
or backwards compatibility.
ddb_aout.c:
Get the symbol table from wherever the loader put it.
Nuke db_symtab[SYMTAB_SPACE].
boot.c:
Enable loading of symbols. Align them on a page boundary. Add printfs
about the symbol table sizes.
Pass the memory sizes to the kernel.
Fix initialization of `unit' (it got moved out of the loop).
Fix adding the bss size (it got moved inside an ifdef).
Initialize serial port when RB_SERIAL is toggled on.
Fix comments.
Clean up formatting of recently added code.
io.c:
Clean up formatting of recently added code.
netboot/main.c, machdep.c, wd.c:
Change names of bootinfo fields.
LINT:
Nuke SYMTAB_SPACE.
Fix comment about DODUMP.
Makefile.i386:
Nuke use of dbsym.
Exclude gcc symbols from kernel unless compiling with -g.
Remove unused macro.
Fix comments and formatting.
genassym.c:
Generate defines for some new bootinfo fields. Change names of old ones.
locore.s:
Copy only the valid part of the `struct bootinfo' passed by the loader.
Reserve space for symbol table, if any.
machdep.c:
Check the memory sizes passed by the loader, if any. Don't use them yet.
bootinfo.h:
Add a size field so that we can resolve some mismatches between the loader
bootinfo and the kernel boot info. The version number is not so good for
this because of historical botches and because it's harder to maintain.
Add memory size and symbol table fields. Change the names of everything.
Hacks to save a few bytes:
asm.S, boot.c, boot2.S:
Replace `ouraddr' by `(BOOTSEG << 4)'.
boot.c:
Don't statically initialize `loadflags' to 0. Disable the "REDUNDANT"
code that skips the BIOS variables. Eliminate `total'. Combine some
more printfs.
boot.h, disk.c, io.c, table.c:
Move all statically initialzed data to table.c.
io.c:
Don't put the A20 gate bits in a variable.