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.
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.
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.
Obtained from:
bios boot block changed to allow booting from both the attached graphics
display and from a serial port. (A specially compiled serial boot block
is no longer necessary.) The boot block should detect the presence or
absence of a keyboard: if there is no keyboard, COM1 is turned into the
console. This simulates the behavior of the Sun boot PROMs. Unplug your
keyboard, attach a terminal to COM1 and you should be ready to go. :)
boot(). This is needed so the "serialboot" stuff can share this file,
too.
Everything is #ifdef'ed so it evaluates to nothing when actually been
built in the "biosboot" directory.
been relocated to run in the 64k segment at 0x10000 with the stack at
the top of this segment. This corrects the problems machines with 512K
base memory had booting.
2. startprog routing rewritten to convert the BOOTSEG ss to a KERNELSEG
ss, this eliminated the last of the >512K memory references. Additional
cleanup in here included a better way to copy the arguments to the
kernel stack.
3. Elimination of argv and esym cruft saved a few bytes.
4. Only need to truncate the head.a_entry to a meg boundary once intead
of every time we used it! [Saving more bytes].
5. Addition of version 1 bootinfo structure support. These boot blocks
pass the kernel name in to the kernel now.
6. Removed historical comments about MACH argv stuff, as it is useless now.
2. Clean up the .S files to use /* */ style comments.
This is a totally cosmetic change, not one byte of the resulting boot
code changes. But at least it is installed with correct owners and in
the right places, and gets recompiled correctly when things change!
is used instead of /usr/lib
io.c: add #include <machine/cpufunc.h> as instructed by David Greenman to
avoid inb/outb linking errors.
NOTE: I just discovered that if GNUC is not used the inline functions will not be expanded from the include file and real inb/outb functions would
be needed.