Commit Graph

11 Commits

Author SHA1 Message Date
Joerg Wunsch
0f72d204e6 Reset defaults in case of boot() is looping several times (e.g. the
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
1995-06-25 14:02:57 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Bruce Evans
8da0f3b87a Make some functions static like they always should have been.
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.
1995-04-21 16:50:32 +00:00
Bruce Evans
a9ef92e638 Never pass char or short args to functions. This saves 64 bytes of
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.
1995-04-21 16:07:12 +00:00
Joerg Wunsch
15c99149f8 Boot block cleanup.
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.
1995-04-14 21:26:53 +00:00
Bruce Evans
b5d89ca8ad Load the kernel symbol table in the boot loader and not at compile time.
(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.
1995-01-25 21:40:47 +00:00
Bruce Evans
bf67b544a2 Pass the slice number of the boot device to the kernel in the previously
unused bitfields for the adaptor and the controller.  It should go in
the bitfield for the partition but that would not be backwards compatible.
1994-12-18 19:14:19 +00:00
Paul Richards
b95ed23990 Fixed bootblocks to work with FreeBSD 2.0
1) Fixed up some header locations
2) Replaced list of boot files with /kernel
3) Changed disklabel use in Makefile to conform to 4.4
4) Added size command in Makefile to get close estimate of bootblock
   sizes. Total size of text and data must be below 64K, slightly
   overestimated since a.out header subsequently gets stripped.
5) Various buffer sizes are set to 8192 bytes in sys.c. In 4.4 MAXBSIZE
   is set to 64K which is too big for the bootblocks to deal with.

Submitted by:	Paul Richards
1994-08-21 17:47:26 +00:00
Rodney W. Grimes
dd05fde699 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 19:17:18 +00:00
Charlie Root
f7710986e2 New boot blocks, from Bruce Evans, and NetBSD fixes. Allows kernel to
be loaded above 1MB.  Same boot code for floppies now.  Speed improvements.
etc etc etc. (I don't have much history on this, but then have been tested)
1993-07-13 18:15:32 +00:00
Rodney W. Grimes
5b81b6b301 Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00