HardenedBSD/sys
Peter Wemm 37b087a645 Clean up some low level bootstrap code:
- stop using the evil 'struct trapframe' argument for mi_startup()
  (formerly main()).  There are much better ways of doing it.
- do not use prepare_usermode() - setregs() in execve() will do it
  all for us as long as the p_md.md_regs pointer is set.  (which is
  now done in machdep.c rather than init_main.c.  The Alpha port did it
  this way all along and is much cleaner).
- collect all the magic %cr0 etc register settings into one place and
  have the AP's call that instead of using magic numbers (!!) that keep
  changing over and over again.
- Make it safe to call kthread_create() earlier, including during the
  device probe sequence.  It doesn't need the callback mechanism that
  NetBSD's version uses.
- kthreads created this way are root-less as they exist before the root
  filesystem is mounted.  init(1) is set up so that it aquires the root
  pointers prior to running.  If other kthreads want filesystem acccess
  we can make this code more generic.
- set all threads start times once we have decided what time it is.
- init uses a trampoline rather than the evil prepare_usermode() hack.
- kern_descrip.c has a couple of tweaks to deal with forking when there
  is no rootdir or cwd etc.
- adjust the early SYSINIT() sequence so that a few prereqisites are in
  place. eg: make sure the run queue is initialized before doing forks.

With this, the USB code can easily create a kthread to do the device
tree discovery.  (I have tested it, it works nicely).

There are still some open issues before this is truely useful.
- tsleep() does not like working before the clock is running.  It
  sort-of tries to spin wait, but it can do more useful things now.
- stopping a kthread in kld code at unload time is "interesting" but
  we have a solution for that.

The Alpha code needs no changes for this.  It already uses pretty much the
same strategies, but a little cleaner.
2000-08-11 09:05:12 +00:00
..
alpha
amd64 Clean up some low level bootstrap code: 2000-08-11 09:05:12 +00:00
boot Add support to send the string 'PXEClient' as the Vendor class 2000-08-11 08:36:17 +00:00
cam
coda
compat
compile
conf activate via82c686 audio driver 2000-08-09 01:08:59 +00:00
contrib/dev
crypto
ddb
dev Fix the ICH2 ATA100 support, and proberly downgrade the chip setup when 2000-08-10 07:34:49 +00:00
fs
geom
gnu
i4b
i386 Clean up some low level bootstrap code: 2000-08-11 09:05:12 +00:00
isa Avoid a '"fd" is usurping ...' message. 2000-08-09 12:45:04 +00:00
isofs/cd9660
kern Clean up some low level bootstrap code: 2000-08-11 09:05:12 +00:00
libkern
miscfs
modules activate via82c686 audio driver 2000-08-09 01:08:59 +00:00
msdosfs
net
netatalk
netatm
netgraph Oops, previous commit fixed a bug that was already fixed before. 2000-08-10 23:04:46 +00:00
netinet - Do not modify Peer's Call ID in outgoing Incoming-Call-Connected 2000-08-09 11:25:44 +00:00
netinet6 Make ip6fw zero work. 2000-08-10 20:41:33 +00:00
netipx
netkey
netnatm
netncp
netns
nfs
nfsclient
nfsserver
ntfs
nwfs
pc98
pccard Add some infrastructure support for dealing with large attribute 2000-08-10 17:35:11 +00:00
pci
posix4
powerpc
rpc
svr4
sys
tools
ufs Initialize *countp to 0 in stub for softdep_flushworklist(). 2000-08-09 00:41:54 +00:00
vm
Makefile