diff options
author | nyan <nyan@FreeBSD.org> | 2011-03-03 11:45:54 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2011-03-03 11:45:54 +0000 |
commit | 3edd099649d44a35387a343a1a109ca90bb8e017 (patch) | |
tree | 0b2f90db8238abaddc440f0b0fed2f6a8515591f /sys/boot/pc98 | |
parent | 817c148c9ff63d4afa0524c2e0460d9a07eb0142 (diff) | |
download | FreeBSD-src-3edd099649d44a35387a343a1a109ca90bb8e017.zip FreeBSD-src-3edd099649d44a35387a343a1a109ca90bb8e017.tar.gz |
MFi386: revision 219186
This patch shrinks boot2 a little.
o It switches kname to be just a pointer instead of an array.
o It changes ioctl to unsigned from uint8_t.
o It changes the second keyhit limit to 3 seconds from 5.
o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting.
Diffstat (limited to 'sys/boot/pc98')
-rw-r--r-- | sys/boot/pc98/boot2/boot2.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c index 9b63d87..bae7c9e 100644 --- a/sys/boot/pc98/boot2/boot2.c +++ b/sys/boot/pc98/boot2/boot2.c @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t nbyte) return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } |