Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!phigate!philica!adrie From: adrie@philica.ica.philips.nl (Adrie Koolen) Newsgroups: comp.os.minix Subject: Re: (PC/AT) why not include 'sync' in keyboard.c (for rebooting?) Message-ID: <792@philica.ica.philips.nl> Date: 17 Apr 91 11:43:17 GMT References: <3044@krafla.rhi.hi.is> <1991Apr16.111539.1287@syd.dit.CSIRO.AU> Reply-To: adrie@beitel.ica.philips.nl (Adrie Koolen) Organization: Philips TDS, Innovation Centre Aachen Lines: 28 In article <1991Apr16.111539.1287@syd.dit.CSIRO.AU> evans@syd.dit.CSIRO.AU (Bruce.Evans) writes: >In article <3044@krafla.rhi.hi.is> einari@rhi.hi.is (Einar Indridason) writes: >>Just a thought. Is there anything that prohibits one from putting 'sync()' >>somewhere inside 'keyboard.c', so that whenever you want (or need) to boot > >Yes. It might cause deadlock. FS is not designed to accept (non-reply) >messages from anywhere except user tasks and MM. (MM is not designed to >accept messages from anywhere except user tasks, but in special cases it >can accept messages from FS and from the kernel.) I've not thought about it too well, but following method popped into my mind. It should be possible to start a special daemon process which wait for the keyboard driver to signal a shutdown. When Ctrl-Alt-Del is pressed, the keyboard driver could send a signal to the daemon, which issues a sync() to the FS and notifies the keyboard driver when the FS buffers are sync-ed. After this, the keyboard driver can issue a software reset. I've not really thought about this well enough (how can the daemon notify the keyboard (tty) task?) and you're stuch when the daemon process (probably /etc/update), the FS or the disk task are blocked, but you're protected against an accidental Ctrl-Alt-Del. On Minix-Sparc, the system returns to the PROM monitor, which gives you an oportunity to continue the execution of Minix. Adrie Koolen (adrie@ica.philips.nl) Philips Innovation Centre Aachen