Commit Graph

178 Commits

Author SHA1 Message Date
Bruce Evans
50ec4d5916 Added option PROBE_KEYBOARD_LOCK which gives a serial console if the
keyboard is locked.
1996-10-08 22:41:34 +00:00
Bruce Evans
4fd6d53a24 Saved about 160 bytes by using the gcc-2.7 alignment options. 1996-10-08 22:35:48 +00:00
Bruce Evans
5bac261e76 Print the dos device number for read failures. 1996-10-08 22:31:31 +00:00
Bruce Evans
86f17a898e Removed unused arg to badsect(). It wasted 16 bytes.
Staticized badsect().

Avoid warning for benign signed vs unsigned comparison.
1996-10-08 22:25:22 +00:00
Bruce Evans
3eeeca733b Use the same warning flags as for the kernel. This causes surprisingly
few warnings.
1996-10-08 22:18:34 +00:00
Paul Traina
b3f3fea5fd Fix a couple of bugs causing false positives 1996-09-26 20:52:13 +00:00
Bruce Evans
0c8ea4d48c Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications.  Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.
1996-09-24 08:08:11 +00:00
Bruce Evans
2e82980a4c Moved instantiation of `poff' to sys.c. It is no longer used in disk.c.
Saved a few bytes by copying `dosdev' and/or `name' to local variables.
This optimization (for dosdev) was done in one place before but this
was lost in the devread() cleanup.   This optimization (for dosdev)
can almost be done by bogusly declaring dosdev as const, but gcc still
often space-pessimizes code like the following:

	extern const int dosdev; ... foo(dosdev); bar(dosdev);

gcc often doesn't bother to copy dosdev to a temporary local because
the local would have to be preserved in memory across the call to
foo().  OTOH, for

	extern int dosdev; ... auto int dosdev_copy = dosdev; ...
		foo(dosdev_copy); bar(dosdev_copy);

the copy must be made because foo() might alter dosdev.
1996-09-14 07:41:00 +00:00
Bruce Evans
310abe0579 Removed declarations of recently deleted variables and cleaned up
#includes.
1996-09-14 07:38:14 +00:00
Bruce Evans
d154cceba7 Potentially saved a whole 4 bytes and reduced bogusness by eliminating
the pointer to the string "/kernel".  This pointer was once only
statically to once save space, but it has had to be dynamically
initialized for some time, so the static initialization just wastes
space.  The string gets moved to the text section, so the actual
savings may be negative due to padding.
1996-09-14 07:12:02 +00:00
Poul-Henning Kamp
078e82404e The intended usage is:
cat /usr/mdec/rawboot /sys/compile/FOO/kernel | fdwrite

That should explain it all  :-)
1996-09-11 19:25:12 +00:00
Poul-Henning Kamp
b679d552d3 Add #ifdef for RAWBOOT.
remove some #if 0 stuff.
1996-09-11 19:23:11 +00:00
Poul-Henning Kamp
8b5d3828b2 Add "rawboot", sort the subdirs. 1996-09-11 19:22:21 +00:00
Poul-Henning Kamp
980b7c9573 Rather than adding more gunk here, clean some of it up:
devread() had a bogus interface, cleaned up.
	Bread() did an unneeded bcopy(), don't.
Saves 80 bytes and some time.
1996-09-10 21:18:40 +00:00
Bruce Evans
24c074ad8d Remove boot2 when the size test fails so that rebuilding without fixing
the problem doesn't bogusly succeed.

Print size failures to stderr instead of stdout and don't print bells
and whistles.
1996-09-07 21:16:44 +00:00
Bruce Evans
6074a34497 Saved 48 bytes (46 before padding) using assorted nano-optimizations:
- avoiding strcmp("?" saved 12 bytes.  gcc inlined the strcmp()
  but this takes as much or more code as a function call.  The
  inlining was bogus because the strcmp() in the bootstrap isn't
  standard.

- using a char instead of an int for the boolean `last_only' saved 8
  bytes.  Booleans should usually be represented as chars on the i386.

- simplifying the return tests saved 9 bytes.

- using putc instead of printf to print a newline saved 3 bytes of code
  and 2 bytes of const data.

- avoiding `else's by always doing the else clause and fixing it up
  saved 4+8 bytes.
1996-09-07 21:06:43 +00:00
Bruce Evans
ae6e81ef56 Saved 48 bytes (56 before padding) by moving a variable declaration.
gcc always generates large code for accesses to globals.  For locals
it only generates large code if there are more than 128 bytes of
locals.  It sorts scalar locals after array locals to pessimize for
space in the usual case when there are more (static) references to
scalars than to arrays.

Saved another 16 bytes (13 before padding) by adding a `continue'.

Fall-through tests normally save space, but here one of them made
gcc do space-unoptimal register allocation (it allocates ch in %bl
because preserving this register across function calls is "free",
but comparisions with %bl take one byte fewer than comparsions with
%bl).
1996-09-07 20:18:04 +00:00
Julian Elischer
7fae9bcd24 Back out the previous changes
I just couldn't get the code to be as small as it should have gotten..

atill a LITTLE bigger than before as I need to allow the
default string to have options as well
1996-09-05 21:12:06 +00:00
Julian Elischer
bf709d2564 3 changes:
1/ Makefile:  the maximum size for boot2 is 7.5K not 7K,
so don't complain until it reaches THAT size..
newfs leaves 8K and boot 1 is 512k. leaving 7.5K becasue the disklabel
is considered to part of the boot2 file.

[512  boot1][512 disklabel][     7K boot2 code        ]
[boot1 file][               boot2 file                ]

2/ Boot2.S: move the soring of the default name read from block 2 to AFTER
clearing the BSS.

3/ boot.c:
Move the parsing of the command line into the
place it's called for clarity.. alsoi comment it a bit and clean it
up a bit.. for some reason this seems ot have made it a little
larger, but I can't work out why.. maybe bruce might have ideas?
compensated for by shrinkage elsewhere..

the practical result of this is htat the default string can now contain args
e.g. if you change the default string to have -gd
then the machine will boot to the dgb debugger stub by default..
this is mostly useful with the nextboot utility..
as it now allows you to remotely force a machine to reboot into
the debugger.
1996-09-04 18:28:36 +00:00
Andrey A. Chernov
89e01b4e03 Add g to flags help 1996-08-28 18:39:24 +00:00
Andrey A. Chernov
a6f2461bdf Add g option to usage line 1996-08-28 18:33:15 +00:00
Paul Traina
f8f0b4798e Support for GDB remote debug protocol.
Sponsored by: Juniper Networks, Inc. <pst@jnx.com>
1996-08-27 19:45:58 +00:00
Peter Wemm
64599735d8 s/ETHER_MIN_LAN/ETHER_MIN_LEN/ 1996-08-19 13:51:30 +00:00
Joerg Wunsch
8a4f8ad912 Fix a couple of typos that sneaked in with Poul's ETHER_* mega-commit.
Reviewed by:	phk
1996-08-18 07:58:13 +00:00
Poul-Henning Kamp
26a8b0bf7e Megacommit to straigthen out ETHER_ mess.
I'm pretty convinced after looking at this that the majority of our
drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(
1996-08-06 21:14:36 +00:00
Bruce Evans
ec275eb27f Moved the definition of DEBUGMSG() from asm.h to start.S. This macro
is only appropriate to use in the special environment of start.S (real
mode plus some conventions about not saving registers), and asm.h is
supposed to be for generic macros.

Removed some unnecessary parentheses.
1996-07-12 05:42:02 +00:00
Bruce Evans
18f63e25c1 Moved the definition of `bsize' out of a DO_BAD144 ifdef so that this
compiles when DO_BAD144 is not defined.
1996-07-12 05:35:47 +00:00
Bruce Evans
1cc273db90 Moved the definition of dflt_name to the correct file (table.c is only for
explicitly initialized data) and made it conditional on NAMEBLOCK.
1996-07-12 05:25:47 +00:00
Bruce Evans
b830e63502 Fixed some speling, punctuation.. and spac ing errors. 1996-07-12 05:17:37 +00:00
Julian Elischer
c9f36013e5 make the NAMEBLOCK changes conditional on that preprocessor variable,
and add more documentation of the option in the Makefile
also CORRECT the variable mentioned in the README.
1996-07-09 02:28:20 +00:00
Joerg Wunsch
960710e6ea Add the ability to specify bootflags. This is similar to boot_i386(8),
except for the root f/s options that don't seem to be useful.
1996-07-06 14:18:56 +00:00
Julian Elischer
9ed24653f7 Obtained from: Whistle Communications
Add code to the boot blocks to allow the user to place default boot strings
on block 1 of the disk (2nd block), should the correct magic numbers be present.

If the correct options are used it will 'delete' the name used from block1,
thereby assuring that if the boot fails it won't be stuck in an infinite loop.

the boot strings are set by the utility "nextboot"
(not yet checked in, but being tested.)
By default these changes should have no effect on existing installations
and if compiled without the NAMEBLOCK option should be essentially identical
to the old ones.
1996-07-05 19:55:05 +00:00
Martin Renters
3042aad3e1 Add a check in the SMC probe to verify that the card has an ethernet
address that starts with 0000C0xxxxxx.  This prevents the probe code
from finding GUS cards.

Pointed out by: Seppo Kallio <kallio@kanto.cc.jyu.fi>
1996-06-09 14:44:17 +00:00
Bruce Evans
a7c6885b3a Fixed BOOT_HD_BIAS. 1996-05-11 04:27:24 +00:00
Poul-Henning Kamp
f8845af0db First pass at cleaning up macros relating to pages, clusters and all that. 1996-05-02 10:43:17 +00:00
Bruce Evans
494908b12c Fixed timeouts. I broke them in rev.1.17 for the FORCE_COMCONSOLE and
(interactively set RB_SERIAL) && BOOTWAIT (serial i/o) cases.
1996-04-30 23:43:25 +00:00
Poul-Henning Kamp
3fc8f9c5af Now that I have started to use netboot, I see what is missing...
Load symbols and set boot args more nicely.
1996-04-14 09:54:14 +00:00
Jordan K. Hubbard
39cef8f8cb Document how to drop into DDB from a serial console. 1996-04-13 11:57:18 +00:00
Bruce Evans
0166c5c6b4 Allow specifying the BIOS drive number. Removed the hd drive type.
hd essentially wired the FreeBSD drive number to 0 without changing
the BIOS drive number.  Now the numbers can be specified independently.

Replaced the BOOT_HD compile time flag with with BOOT_HD_BIAS.  Defining
the new flag as 1 should give the same behaviour as defining the old
flag as anything.  I haven't tested defining these flags.
1996-04-07 14:28:05 +00:00
Poul-Henning Kamp
506c540bbb Improvementss to netboot
Initial but not yet functional PCI support.

Reviewed by:	phk
Submitted by:	Luigi Rizzo <luigi@labinfo.iet.unipi.it>
1996-04-03 19:01:37 +00:00
Poul-Henning Kamp
3a65e0a3de Align help screen.
add gateway command.
1996-04-02 15:17:36 +00:00
Bruce Evans
bb859b2bb8 Saved 14 bytes by avoiding gas braindamage and 8 bytes by better
instruction selection, for a total of 16 bytes after padding.  Whee.
1996-03-08 07:27:52 +00:00
Bruce Evans
cc494d0cce Probe the keyboard if PROBE_KEYBOARD is defined instead of when `notyet'
is defined and FORCE_COMCONSOLE isn't defined.

Don't compile any keyboard probing code if PROBE_KEYBOARD isn't defined.

Makefile:
Removed -I paths.  They weren't used, and the one to /sys hasn't worked
since the source directory was moved down one level.
1996-03-08 06:29:07 +00:00
Bruce Evans
27253a3d9c Made the timeouts in gets() machine-independent. Use the BIOS tick
counter instead of the BIOS time call to save space.

Reworked the anti-noise timeout to avoid duplicating code.  The timeout
in the outer loop is now restarted after every noise timeout, so it is
now possible for the total timeout to be infinite; previously, the maximum
total timeout was 150000 seconds.
1996-03-08 06:11:33 +00:00
Bruce Evans
0ae65c1a2b Load %fs with the flat data segment selector while in protected mode.
This will be used for convenient access to the BIOS variables.
1996-03-08 05:43:46 +00:00
Bruce Evans
c50f3ecf5a Fixed restoring segment descriptors in prot_to_real(). The descriptors
must have limit 0xffff and attribute G = 0 (byte granularity) as well
as other properties that they already had (see e.g., the Intel i486
manual section 22.5).  Not restoring them broke Ctrl-Alt-Del in the
bootstrap for my ASUS P55TP4XE system, probably because the Award BIOS
does anti-tracing stuff involving inaccessible %esp's.

asm.S:
Don't use lret in prot_to_real().  This reduces the risk of using an
incompletely intialized stack segment and saves space.

Submitted by:	"K.Higashino" <a00303@cc.hc.keio.ac.jp> (on 13 Jan 1995!)
		reworked by me
1996-03-08 05:15:54 +00:00
Joerg Wunsch
017ef5fdc2 Create symlinks for vnboot and bootvn, too. 1996-02-03 21:12:27 +00:00
Joerg Wunsch
85373d20b1 Implement an optional TIMEOUT value while entering the boot parameter
string.  This avoids indefinite hangs e.g. when used on a noisy serial
console.  It's not turned on by default.
1996-01-21 11:30:12 +00:00
Joerg Wunsch
301c758249 Document the ``BOOT_HD'' make option for the bootblocks. 1996-01-06 23:37:10 +00:00
Andrey A. Chernov
eb8421526c Remove -fno-strength-reduce, gcc bug recently fixed 1996-01-05 19:28:55 +00:00