Commit Graph

581 Commits

Author SHA1 Message Date
mycroft 7ecc7a3071 Make awaitkey() poll once even if the timeout is 0. This also fixes a problem
where a keypress within the last polling interval would not be noticed.
Add a new function, conisshift(), which is used to detect whether a shift key
is pressed.  Use this via awaitkey() to allow interrupting the boot by holding
down shift (similar to LILO).

This allows setting the timeout to 0 and still being able to use the boot
program.
2005-01-27 18:20:45 +00:00
dsl 02a6e19ef1 Fix comment, code is requesting CHS geometry, not max LBA sector 2005-01-17 21:28:51 +00:00
christos aae3f73769 include sys/types.h to make this compile again. 2004-11-25 08:30:52 +00:00
thorpej 0798da74ba Add support for passing booted wedge information to the kernel. 2004-10-23 17:20:04 +00:00
dsl 4b313d03d3 Need %ah == 0 (not 0xff) in order to find the correct partition table entry
when simulating a key press in the non-interactive mbr code.
Fixes bug introduced in rev 1.10 - older versions worked because %ah
happened to be 0!
Fixes PR bin/26919
2004-09-12 08:41:47 +00:00
thorpej 9946bbdb7a Use CPUFLAGS for codegen options. 2004-09-06 23:41:21 +00:00
dsl 4a83eca5d5 Save 2 more bytes (by adjusting the ERR_NO_LBA setup).
Use up all the space by adding a short banner message.
'Fn diskn' for bootsel and 'NetBSB MBR boot' for the non-bootsel code.
2004-09-05 21:42:43 +00:00
thorpej e489b76d88 More complete fix for overriding CPUFLAGS and also apply fix to bootxx,
from Valeriy Ushakov.
2004-09-03 21:55:17 +00:00
thorpej f340ce91f0 Override CPUFLAGS to empty so that a CPUFLAGS setting in the user's
mk.conf don't affect the C options we need to build the boot loader.
2004-09-03 18:25:04 +00:00
dsl ab6077db18 Remove the functionality added in rev 1.7.
With no menu items the mbr_bootsel code will wait for the timeout (default
10 seconds) and then boot the default device - usually the active partition.
Forcing the 'active' partition was wrong - jmmv has a system which needs
to boot from hd1 where hd0 has no mbr partition info.
I suspect the problem I though rev 1.7 fixed was actually caused by
disklabel copying sector zero of the disk to sector zero of the partition!
Gains another 9 bytes of free space, mbr_bootsel now has 20 free bytes.
2004-09-01 20:31:20 +00:00
uwe af4511cccc Force STRIPFLAG to be empty after bsd.own.mk is included, so that
any value set in /etc/mk.conf is overriden.
2004-08-31 22:57:13 +00:00
junyoung b13abba3f6 Include libi386.h for function prototypes. 2004-08-23 09:45:53 +00:00
junyoung 26231e86a1 * Nuke __P().
* No need to use 'extern' for function prototypes.
2004-08-23 09:41:59 +00:00
dsl 3a67f25b17 Use := when saving ${.OBJDIR) - then we get the correct value! 2004-08-23 06:54:04 +00:00
dsl c48b68dc4d Need to use := when evaluating ${.OBJDIR}, then the correct value
is passed into the subdir builds and the 'lib' objects are correctly shared.
Fixes PR/26554
2004-08-23 06:52:04 +00:00
dsl 5084a397e4 Increase space for boot parameters - needed for specifying serial port
IO address and long keyboard translation map.
2004-08-23 06:50:21 +00:00
junyoung 3d45791c36 Rename bootparams to boot_params for consistency. 2004-08-19 10:34:36 +00:00
dsl 523a1fe90e Define CONSADDR for pcio.c (continuing the same hack use for the other
parameters).
2004-08-15 22:10:50 +00:00
dsl c1eeebc3dd Allow the com port base address to be specified by the user (via installboot)
rather than taking the value from the bios.
Should allow the system to use a serial console that is also a 'bios serial
console' and isn't in the bios serial port table.
Probably fixes (with a few other changes) PR port-i386/9236
2004-08-15 22:04:45 +00:00
dsl c68c45c975 I challenged mycroft to optimise this code - and he found a spare byte... 2004-08-14 21:03:23 +00:00
dbj 1abd4b8f46 fix several related bugs that cause sysctl machdep.diskinfo to
lose when booted from pxeboot.
. make sure that i386_alldisks gets initialized even if
  bios geometry information is not available in the bootinfo
. if i386_alldisks is not initialized, have sysctl return EOPNOTSUPP
. compile pxeboot with -DPASS_BIOSGEOM and I386_INCLUDE_DISK=yes
  this may increase the size of pxeboot which is required to run
  in 64k.  However, it seems to be working ok on my system
2004-08-05 18:04:35 +00:00
mycroft 66760f9d8c Change MAXDRV to 0x8f, to fix El Torito booting problems on some machines.
See PR 22647.
2004-07-04 00:38:51 +00:00
dsl 5cf67adbc4 Change interface between bootxx.S and boot1() - always linked together.
This allows boot1() to change the sector number (of the boot partition)
that bootxx.S passes through to boot2().
This means that boot2() will find the correct partition when boot1()
reads /boot from the 'a' partition instead of the mbr boot partition.
This all happens when you update a system that used a small 'wd0h' partition
to boot a raid1 set to the new bootcode.  Deleting /boot from the 'wd0h'
partition will make the new bootcode find /boot and the root filesystem
inside the raid set.
2004-06-27 15:37:11 +00:00
jmc 84fafa3db5 Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
2004-06-21 18:20:08 +00:00
dsl 17bfe85dd3 Make mbr_bootsel boot active partition if/when no menu items are output.
Stops users sitting in front of a system that is waiting for a keypress.
Just don't ask how I added more functionality AND got an extra 7 free bytes!
2004-05-08 21:18:22 +00:00
dsl 5d3e088ee0 Put the 'mbr has bootselect table' marker into all versions of the mbr code.
Having the table in the 'standard' mbr allows fdisk to write in bootsel
menu items and only ask about updating the mbr code before exit.
Sysinst validates that the mbr code contains the bootselect table for
all the mbr code variants it reads - because it might want to write the table
and doesn't really want to make the validation dependant on what it is
going to do later.
Fixes install/25235, but sysinst needs some changes (like reporting the
failure to write the mbr) before the pr itself is closed.
2004-04-23 06:21:21 +00:00
groo f2d334068a Let's try that again... one comes from .CURDIR, another set of files
comes from .OBJDIR.
2004-04-03 18:18:21 +00:00
groo 291203c667 Don't cd ${.CURDIR}, it's not where the uudecoded objects are. 2004-04-03 17:45:19 +00:00
lukem e7b4b99d58 Convert to using UUDECODE_FILES instead of using -kb in the repository. 2004-04-02 08:54:04 +00:00
drochner 566efeb685 remove license clauses 3 and 4 from my cpoyright notices 2004-03-24 16:46:27 +00:00
drochner 091c877e12 remove license clauses 3 and 4 from my cpoyright notices 2004-03-24 16:34:29 +00:00
lukem 455da8e60b Move mbr_bootsel from offset 404 to offset 400 in struct mbr_sector to
leave 4 bytes for the Windows NT Drive Serial Number (DSN) at 440-443
(as mbr_sector.mbr_dsn).

Ensure that all the MBR & PBR code reserves space for mbr_sector.mbr_dsn.

Leave the bootsel magic number at 444-445 as mbr_sector.mbr_bootsel_magic
(instead of mbr_sector.mbr_bootsel.mbrbs_magic), but use 0xb5e1 (MBR_BS_MAGIC)
instead of 0xaa55 (MBR_MAGIC) to indicate that this change has occurred.

Rework MBR_BS_NEWMBR to mean "mbr_bootsel has moved to 400".

Modify fdisk(8) to automatically relocate the mbr_bootsel from 404 to 400
if mbr_bootsel_magic is the old value (0xaa55), and unset MBR_BS_NEWMBR
to flag that new mbr_bootsel code must be used if updating the MBR.


These changes fixes a problem where Windows 2000 or Windows XP would corrupt
the last 3 bytes + NUL of MBR partition 3's bootsel name if the bootsel name
was 5 characters long, replacing bytes 6-9 with the DSN.
Also, by explicitly reserving the space for the DSN we prevent problems in the
future if non bootsel MBR or PBR code had other information at bytes 440-443.
2004-03-22 07:11:00 +00:00
dsl ae7b924322 Translate ascii keycode to help those with azerty keyboard type straight. 2004-03-13 22:41:37 +00:00
dsl 44eaa39982 Report errno value from boot1() - even though the standalone FS code
seems to translate everything into ENOENT.
2004-02-28 23:01:55 +00:00
dsl da7ffa3cbe Look for /boot in the 'a' partition (from the label in the mbr partition)
if it can't be found in a filesystem (or raid set) at the start of the
mbr partition.
2004-02-28 22:32:23 +00:00
wiz 516a72484d Spell through with two hs. From Peter Postma. 2004-02-24 15:24:35 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
dsl 4bf8ba6f30 Fix problems booting disks with extended partition from grub (and other
non-netbsd mbr code) - thanks to Joe Thiemann for finding this...
2003-12-21 20:56:40 +00:00
dsl b31c4f649a Fix speling mistake in commennt. 2003-12-07 20:11:11 +00:00
dsl 91f5ee90a4 Add .WAIT after first subdirectory to ensure we don't build the libraries
twice.
2003-11-20 16:16:41 +00:00
drochner 038b8b6573 Uhm - the last change broke everything but very simple setups.
(it only allowed to boot an nfs /netbsd automatically)
To make it work for people who can't tell the DHCP server to pass
the right kernel file to pxeboot, without losing flexibility for
people who can, do the following:
Use the filename given by the DHCP server if it contains a ":". A ":"
was already used to seperate filesystem and filename, so we don't
lose anything. Otoh, a path to pxeboot usually doesn't contain a ":",
so it should still work if we got the old pxeboot filename again.
2003-11-12 18:44:08 +00:00
wiz ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
dsl fcb78a6640 Remove depencency of vers.c on ${LIBLIST} - it messes up the depends and
I'm not sure why I added it now!
Default NWEVERSWHAT back to "BIOS Boot" - look better on boot banner page.
2003-11-08 00:02:02 +00:00
dsl a7e45c127a stand/lib/crt/rom is no more, no need for it in .PATH 2003-11-07 23:44:56 +00:00
dsl 80e537250b Make 'dependall' generate the dependencies 2003-11-07 23:39:27 +00:00
dsl 6074f35279 Change getextmem2 to return 'configured' values from cx/dx if ax/bx zero,
make absolutely high the top 16bits of returned values are zero.
Ralf's list says that some BIOS need %eax = 0x0000e820 in getmementry.
Add a few comments.
Might fix problems with memory size detection on some systems.
2003-11-07 11:34:28 +00:00
dsl a8af374602 Adjust location of 'extmem2' diagnostic print. 2003-11-07 11:30:39 +00:00
mycroft 06eb56a853 So, on other platforms we use the BOOTP/DHCP file name for the boot program
and use a default file name of "netbsd" for the kernel.  Do the same thing
here, as it hardly makes sense any other way.
2003-11-05 04:18:26 +00:00
hannken ef301d7a07 Remove memset prototype. Already present in sys/lib/libsa/stand.h. 2003-10-31 10:49:25 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00