Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!bruce!cechew From: cechew@bruce.cs.monash.OZ.AU (Earl Chew) Newsgroups: comp.os.minix Subject: Re: Loading in protected mode... (was Re: Received:) Message-ID: <3517@bruce.cs.monash.OZ.AU> Date: 22 Dec 90 22:52:47 GMT References: <39678@nigel.ee.udel.edu> <3492@bruce.cs.monash.OZ.AU> <1990Dec21.061152.22251@menudo.uh.edu> Organization: Monash Uni. Computer Science, Australia Lines: 67 In <1990Dec21.061152.22251@menudo.uh.edu> kevin@nuchat.UUCP (Kevin Brown) writes: >>you have more than 640k machine as most do these days). This limits the size of >>kernels to about 586k. >This is not strictly true. The segment registers have a resolution of 16 >bytes. That is, they form the upper 16 bits of a 20 bit base address (for >8088 mode, that is). With this in mind, you can place the loader such that >its end is within 16 bytes of the end of 640K (but make sure you have room >for any data space the loader might want to use at the end of the loader >image!). This is what I have effectively done. Yes. What you say is true. For shoelace I had to invoke the `64k dma rule' hence 640k-64k=586k. >Once I have 16 meg, the "need" for a protected-mode loader which dynamically >allocates uninitialized data segments will be greater. >Now, now, Earl...no need to be jealous. :-) :-) :-) I suppose that until I get another 1-3Mb, my need won't be so great --- so you might have to be patient :-) >Have you guys patched up the kernel in such a way that this behavior is >portable, i.e. not dependent on the existence of shoelace? It would be >very nice to be able to allocate arbitrarily large buffer caches and such. >In fact, it would be real nice to be able to grow the process table on >demand, too. I'm not really in a position to answer these are Bruce's mods and I am not using them yet (remember, I've got the `little' machine). >I was under the impression that, once Minix got started, it didn't use anything >in the BIOS space. I know it needs it for initialization, though, but that's >about it as far as I know. bios_wini uses the bios. tty uses the video page(s). >You can probably get away with using memory below 1Mb as uninitialized data >space for some of the kernel structures. Or you can cause mm to realize that >there's free memory there and it will allocate it when it can. This is painful. PC memory is already fragmented. Using paging to provide a clean map is easiest (until VM comes). >Well, how does the kernel switch to protected mode to begin with? I would >think you could use the same technique. Pardon my simplicity, but why can't >you simply move the code to do this from the kernel bootstrap procedure to >the loader? I suppose so, but there may be complications when the kernel wants to set up page tables then switch to paged mode when it's already in paged mode! >Ouch. No memory above 1M? I don't know if I would be able to live with >that. I can barely live with 8 meg. :-) I used to live in 16k many years ago. 1M is comparative bliss. Actually, those with C&T 386 chipsets can reclaim lots of shadow ram and get most of their lower 1M back. Merry Christmas Earl -- Earl Chew, Dept of Computer Science, Monash University, Australia 3168 EMAIL: cechew@bruce.cs.monash.edu.au PHONE: 03 5655447 FAX: 03 5655146 ----------------------------------------------------------------------