From owner-cvs-all Fri Aug 11 9:50:44 2000 Delivered-To: cvs-all@freebsd.org Received: from calcaphon.demon.co.uk (calcaphon.demon.co.uk [193.237.19.5]) by hub.freebsd.org (Postfix) with ESMTP id 4630937B819; Fri, 11 Aug 2000 09:48:48 -0700 (PDT) (envelope-from n_hibma@qubesoft.com) Received: from henny.webweaving.org (henny.qubesoft.com [192.168.1.5]) by calcaphon.demon.co.uk (8.9.3/8.9.1) with ESMTP id RAA02032; Fri, 11 Aug 2000 17:47:51 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Received: from localhost (localhost [127.0.0.1]) by henny.webweaving.org (8.9.3/8.9.3) with ESMTP id RAA05464; Fri, 11 Aug 2000 17:32:32 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Date: Fri, 11 Aug 2000 17:32:32 +0100 (BST) From: Nick Hibma X-Sender: n_hibma@henny.webweaving.org Reply-To: Nick Hibma To: Peter Wemm Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/i386 locore.s machdep.c mp_machdep.c vm_machdep.c src/sys/i386/include cpu.h md_var.h src/sys/kern init_main.c kern_descrip.c kern_kthread.c In-Reply-To: <200008110905.CAA38291@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG And the crowd goes wild! Nick On Fri, 11 Aug 2000, Peter Wemm wrote: > peter 2000/08/11 02:05:13 PDT > > Modified files: > sys/i386/i386 locore.s machdep.c mp_machdep.c > vm_machdep.c > sys/i386/include cpu.h md_var.h > sys/kern init_main.c kern_descrip.c kern_kthread.c > Log: > 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. > > Revision Changes Path > 1.136 +1 -46 src/sys/i386/i386/locore.s > 1.400 +20 -1 src/sys/i386/i386/machdep.c > 1.120 +3 -12 src/sys/i386/i386/mp_machdep.c > 1.137 +9 -8 src/sys/i386/i386/vm_machdep.c > 1.45 +1 -2 src/sys/i386/include/cpu.h > 1.36 +2 -1 src/sys/i386/include/md_var.h > 1.138 +62 -98 src/sys/kern/init_main.c > 1.88 +13 -7 src/sys/kern/kern_descrip.c > 1.6 +1 -5 src/sys/kern/kern_kthread.c > > -- Qube Software, Ltd. Private: n_hibma@qubesoft.com n_hibma@webweaving.org n_hibma@freebsd.org http://www.qubesoft.com/ http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message