Bootloader side changes:
- make boot command parse boothowto flags (-ads etc.)
- pass boothowto and bootdev info to the kernel via %d7 and %d6
as the old 4.4BSD/luna68k kernel expected
- remove unused and now unnecessary "howto" (how_to_boot) command
- export and tweak make_device() in devopen.c to prepare bootdev info
- remove unused and commented out get_boot_device()
Kernel side changes:
- use %d7 (boothowto) and %d6 (bootdev) to pass info and also use
old macro in <sys/reboot.h> as ancient 4.4BSD did for simplicity
- add <machine/bootinfo.h> to define values as API to pass these info
- save boothowto and bootdev in registers right after zero'ing bss
- add MD device_register(9) to check booted_device per passed bootdev info
- merge old bootarg checks in rootconf() and luna68k_init() with
tweaks for backward compatibility
(direct boot a.out kernel from ROM monitor without bootloader still works)
It looks the device is mapped at both regions.
4.4BSD/luna68k probes it at 0xf1000000, but UniOS-Mach for LUNA-II
attaches the lance at 0xf0000000. It is probably because
the UniOS needs to map DS1220 NVRAM (mapped at 0xf1000004 and
used to store the MAC address) to the different kernel page,
but there is no reason for us to use different addresses.
(Note our bootloader already use the same address for both machines.)
This change will make (forthcoming) booted device check easier.
instead.
Include linux_socketcall.h to bring missing socket syscall
arguments/prototypes on arches that have socketcall(2).
Finally, cleanup rump linux syscall wrapper, to remove linux syscall
argument/prototype local copy.
This file is only intended to be included from the other rules files like
bsd.lib.mk or bsd.prog.mk. If you need things to be defined early, use
bsd.own.mk.
- remove kernel-like autoconfiguration to probe bootable devices
- initialize SCSI and Ethernet controllers statically instead
- reorganize device softc structures per autoconf removal
- probe and print all SCSI disks (but don't assign unit numbers)
- make sdopen() to recheck the device and allocate softc dynamically
- use controller number and SCSI target ID (ctlr * 10 + id) to specify
the boot disk on the "boot" command arg
- bump version to denote changes
Now bootloader works as the following:
---
>> NetBSD/luna68k boot, Revision 1.8 (Wed Jan 8 22:13:12 JST 2014)
>> (based on Stinger ver 0.0 [Phase-31])
Machine model = LUNA-II
Physical Memory = 0x4000000 (64 MB)
sc0 at 0xe1000000: async, parity, ID 7
ID 3: TEAC FC-1 HGF 10 rev , 512 bytes/sect x 2879 sectors
ID 6: IBM DPES-31080 rev S31Q, 512 bytes/sect x 2118143 sectors
sc1 at 0xe1000040: async, parity, ID 7
ID 6: MELCO DSC-G rev 1.00, 512 bytes/sect x 62533295 sectors
le0: Am7990 LANCE Ethernet, mem at 0x71010000
le0: Ethernet address = 00:00:0a:03:42:77
Press return to boot now, any other key for boot menu
booting sd(16,0)netbsd - starting in 0 seconds.
auto-boot sd(16,0)netbsd
1911696+96040 [280480+159179]=0x255a30
:
rest of the code is not executed.
Note that the cleanup routine is executed in a separate shell so environment
variables are not propagated and need to be set again.
shell so it can't cleanup stuff set in the environment of the first shell.
There are 2 problems:
- calling the test routine directly does not cleanup (not using
atf-run)
- when using atf-run, the cleanup routine needs state from the
running code which can only be stored in files. This will never
allow us to run tests in parallel since we need to keep a known
place to pass state.
relative to uname output when running in emulations: the magic links
are *not* affected even though uname output changes.
(This means @machine magic links can be used for e.g. amd64 vs. i386
device nodes. There's also an @emul magic link for emulation.)
Noted by apb.