summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
Commit message (Collapse)AuthorAgeFilesLines
* init_main.c subr_autoconf.c:gibbs1997-09-211-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for "interrupt driven configuration hooks". A component of the kernel can register a hook, most likely during auto-configuration, and receive a callback once interrupt services are available. This callback will occur before the root and dump devices are configured, so the configuration task can affect the selection of those two devices or complete any tasks that need to be performed prior to launching init. System boot is posponed so long as a hook is registered. The hook owner is responsible for removing the hook once their task is complete or the system boot can continue. kern_acct.c kern_clock.c kern_exit.c kern_synch.c kern_time.c: Change the interface and implementation for the kernel callout service. The new implemntaion is based on the work of Adam M. Costello and George Varghese, published in a technical report entitled "Redesigning the BSD Callout and Timer Facilities". The interface used in FreeBSD is a little different than the one outlined in the paper. The new function prototypes are: struct callout_handle timeout(void (*func)(void *), void *arg, int ticks); void untimeout(void (*func)(void *), void *arg, struct callout_handle handle); If a client wishes to remove a timeout, it must store the callout_handle returned by timeout and pass it to untimeout. The new implementation gives 0(1) insert and removal of callouts making this interface scale well even for applications that keep 100s of callouts outstanding. See the updated timeout.9 man page for more details.
* Removed unused #includes.bde1997-09-021-5/+1
|
* Clean up the SMP AP bootstrap and eliminate the wretched idle procs.peter1997-08-261-7/+1
| | | | | | | | | | | | | | | | | | | | - We now have enough per-cpu idle context, the real idle loop has been revived (cpu's halt now with nothing to do). - Some preliminary support for running some operations outside the global lock (eg: zeroing "free but not yet zeroed pages") is present but appears to cause problems. Off by default. - the smp_active sysctl now behaves differently. It's merely a 'true/false' option. Setting smp_active to zero causes the AP's to halt in the idle loop and stop scheduling processes. - bootstrap is a lot safer. Instead of sharing a statically compiled in stack a number of times (which has caused lots of problems) and then abandoning it, we use the idle context to boot the AP's directly. This should help >2 cpu support since the bootlock stuff was in doubt. - print physical apic id in traps.. helps identify private pages getting out of sync. (You don't want to know how much hair I tore out with this!) More cleanup to follow, this is more of a checkpoint than a 'finished' thing.
* The promised "better fix" for "Trap 9 When Boot SMP" problem.fsmp1997-08-151-2/+10
| | | | | | | | | | We now tsleep() in kthread_init() between start_init() and prepare_usermode() while waiting for ALL the idle_loop() processes to come online. Debugged & tested by: "Thomas D. Dean" <tomdean@ix.netcom.com> Reviewed by: David Greenman <dg@root.com>
* Fixes kern/3835: SMP kernel crash on enable "dumps on wd0"fsmp1997-08-071-4/+12
| | | | | | - SMP: set value of curproc in main(), before the SYSINIT stuff runs. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu ofdyson1997-08-051-1/+6
| | | | | a simple, clean zone type allocator. This new allocator will also be used for machine dependent pmap PV entries.
* Adds sysctl int for shutdown timeout.davidn1997-07-101-1/+5
| | | | Reviewed by: Poul-Henning Kamp <phk@dk.tfs.com>
* Preliminary support for per-cpu data pages.peter1997-06-221-6/+2
| | | | | | | | | | | | | | | | This eliminates a lot of #ifdef SMP type code. Things like _curproc reside in a data page that is unique on each cpu, eliminating the expensive macros like: #define curproc (SMPcurproc[cpunumber()]) There are some unresolved bootstrap and address space sharing issues at present, but Steve is waiting on this for other work. There is still some strictly temporary code present that isn't exactly pretty. This is part of a larger change that has run into some bumps, this part is standalone so it should be safe. The temporary code goes away when the full idle cpu support is finished. Reviewed by: fsmp, dyson
* Modifications to existing files to support the initial AIO/LIO anddyson1997-06-161-1/+7
| | | | kernel based threading support.
* Don't need "opt_smp.h" on these filespeter1997-05-291-2/+1
|
* Bring in some kernel bootp support. This removes the need for netboottegge1997-05-111-1/+8
| | | | | | | | to fill in the nfs_diskless structure, at the cost of some kernel bloat. The advantage is that this code works on a wider range of network adapters than netboot. Several new kernel options are documented in LINT. Obtained from: parts of the code comes from NetBSD.
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-1/+20
| | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
* The biggie: Get rid of the UPAGES from the top of the per-process addresspeter1997-04-071-36/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-221-2/+3
| | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function.
* Include copyright message from <sys/copyright.h>wosch1997-03-011-19/+2
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-7/+7
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Set the soft openfiles limit to maxfiles instead of to NOFILE.bde1997-01-271-2/+5
| | | | | | | | | | | | | | | | | | | The limit is now only used by init, so it may as well be "infinite". Don't use RLIM_INFINITY, since setrlimit() doesn't allow setting that value. Use maxfiles instead of RLIM_INFINITY for the hard limit for the same reason. Similarly for the maxprocesses limits (use the "infinite" value of maxproc instead if MAXUPRC and RLIM_INFINITY). NOFILES, MAXUPRC, CHILD_MAX and OPEN_MAX are no longer used in /usr/src and should go away. Their values are almost guaranteed to be wrong now that login.conf exists, so anything that uses the values is broken. Unfortunately, there are probably a lot of ports that depend on them being defined. The global limits maxfilesperproc and maxprocperuid should go away too.
* Reduced #include spam in <sys/sysproto.h> and fixed things that dependedbde1997-01-161-0/+1
| | | | | | | | | | | | | | on it. makesyscalls.sh: This parsed $Id$. Fixed(?) to parse $FreeBSD$. The output is wrong when the id is not expanded in the source file. syscalls.master: Fixed declaration of sigsuspend(). There are still some bogons and spam involving sigset_t. Use `struct foo *' instead of the equivalent `foo_t *' for some nfs and lfs syscalls so that <sys/sysproto.h> doesn't depend on <sys/mount.h>.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Typo fix.alex1996-12-171-2/+2
|
* init_main.c: pass -d to init if DEVFS_ROOTphk1996-10-281-1/+7
| | | | | kern_conf.c: gd driver is a disk. vfs_subr.c: include opt_devfs.h
* Fix signed/unsigned comparison warnings.alex1996-10-201-2/+2
| | | | Reviewed by: bde
* call srandom() during the boot to start the sequence with a slightly lesspeter1996-09-231-1/+9
| | | | predictable seed.
* Second phase of merge, get rid of more machine-independent-dependencies.asami1996-09-031-2/+1
| | | | | | Get rid of pc98/pc98/pc98_device.h. Submitted by: The FreeBSD(98) Development Team
* s/pc98/isa/g in struct *_device and *_driver. Resync along the way.asami1996-08-311-1/+2
| | | | Submitted by: The FreeBSD(98) Development Team
* Removed a ton of unused #includes. The introduction of SYSINIT() andbde1996-08-281-17/+1
| | | | possibly the cleaning up of extern declarations made them unnecessary.
* add FreeBSD Inc. to copyright stringwosch1996-08-221-1/+2
|
* Converted timer/run queues to 4.4BSD queue style. Removed old and unuseddg1996-07-311-1/+6
| | | | | | | sleep(). Implemented wakeup_one() which may be used in the future to combat the "thundering herd" problem for some special cases. Reviewed by: dyson
* The Great PC98 Merge.asami1996-06-141-1/+8
| | | | | | | | All new code is "#ifdef PC98"ed so this should make no difference to PC/AT (and its clones) users. Ok'd by: core Submitted by: FreeBSD(98) development team
* Change the symbol name used in the last commit from USRSTACK todyson1996-06-111-1/+1
| | | | | VM_MAXUSER_ADDRESS. Even though they are the same, the new name is more descriptive.
* Get rid of the unneeded upper address space.dyson1996-06-111-2/+2
|
* From Lite2: proc LIST changeshsu1996-03-111-8/+12
| | | | | | call kern_proc.c:procinit() to initialize LISTs call to usrinfoinit() subsumed by procinit() Reviewed by: davidg & bde
* Add more options into the conf/options and i386/conf/options.i386 filespeter1996-03-021-1/+3
| | | | | | and the #include hooks so that 'make depend' is more useful. This covers most of the options I regularly use (but not all) and some other easy ones.
* Garrett pointed out that the correct place for unix system call argspeter1996-02-231-2/+2
| | | | | | | is <sys/unistd.h>, with the prototype in <unistd.h>. sys/unistd.h is visible to the kernel compile, and is #included by unistd.h. Also, I missed a reference to a static int in the midst of my other diffs.
* Eliminated many redundant vm_map_lookup operations for vm_mmap.dyson1996-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
* Last commit this round: Staticize.phk1995-12-101-18/+18
| | | | | we are now down to about 1146 symbols being global, of which I estimate that about 100 are validly so.
* Untangled the vm.h include file spaghetti.dg1995-12-071-3/+9
|
* A major sweep over the sysctl stuff.phk1995-12-041-1/+6
| | | | | | | | | | | | | Move a lot of variables home to their own code (In good time before xmas :-) Introduce the string descrition of format. Add a couple more functions to poke into these marvels, while I try to decide what the correct interface should look like. Next is adding vars on the fly, and sysctl looking at them too. Removed a tine bit of defunct and #ifdefed notused code in swapgeneric.
* Finished (?) cleaning up sysinit stuff.bde1995-12-021-24/+23
|
* Removed all #includes of the unused file <sys/device.h>.bde1995-11-281-2/+1
|
* Remove prototype definitions from <sys/systm.h>.swallace1995-10-081-1/+2
| | | | | | | | | | | | | | Prototypes are located in <sys/sysproto.h>. Add appropriate #include <sys/sysproto.h> to files that needed protos from systm.h. Add structure definitions to appropriate files that relied on sys/systm.h, right before system call definition, as in the rest of the kernel source. In kern_prot.c, instead of using the dummy structure "args", create individual dummy structures named <syscall>_args. This makes life easier for prototype generation.
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofdg1995-09-091-25/+25
| | | | compiler warnings.
* devfs changes..julian1995-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | changes to allow devices that don't probe (e.g. /dev/mem) to create devfs entries this required giving 'configure' its own SYSINIT entry so we could duck in just before it with a DEVFS init and some device inits.. my devfs now looks like: ./misc ./misc/speaker ./misc/mem ./misc/kmem ./misc/null ./misc/zero ./misc/io ./misc/console ./misc/pcaudio ./misc/pcaudioctl ./disks ./disks/rfloppy ./disks/rfloppy/fd0.1440 ./disks/rfloppy/fd1.1200 ./disks/floppy ./disks/floppy/fd0.1440 ./disks/floppy/fd1.1200 also some sligt cleanups.. DEVFS needs a lot of work but I'm getting back to it..
* Fix benign type mismatches and nested extern declarations in new sysinitbde1995-08-291-4/+19
| | | | | | code. Fix old and new missing prototypes.
* Reviewed by: julian with quick glances by bruce and othersjulian1995-08-281-135/+269
| | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file.
* Converted mountlist to a CIRCLEQ.dg1995-08-111-2/+2
| | | | Partially obtained from: 4.4BSD-Lite2
* NFS diskless operation was broken because swapdev_vp wasn't initialized.dg1995-05-191-2/+2
| | | | | | | These changes solve the problem in a general way by moving the initialization out of the individual fs_mountroot's and into swaponvp(). Submitted by: Poul-Henning Kamp
* Changed swap partition handling/allocation so that it doesn'tdg1995-05-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | require specific partitions be mentioned in the kernel config file ("swap on foo" is now obsolete). From Poul-Henning: The visible effect is this: As default, unless options "NSWAPDEV=23" is in your config, you will have four swap-devices. You can swapon(2) any block device you feel like, it doesn't have to be in the kernel config. There is a performance/resource win available by getting the NSWAPDEV right (but only if you have just one swap-device ??), but using that as default would be too restrictive. The invisible effect is that: Swap-handling disappears from the $arch part of the kernel. It gets a lot simpler (-145 lines) and cleaner. Reviewed by: John Dyson, David Greenman Submitted by: Poul-Henning Kamp, with minor changes by me.
* Kludged around a problem with "cat /proc/0/regs" causing a panic bydg1995-05-041-1/+9
| | | | | | initializing proc0's frame base, too, using cpu_set_init_frame(). It's a kludge because that macro is intended to be used only for init, but does what we want nonetheless.
OpenPOWER on IntegriCloud