Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.os.minix,comp.sys.ibm.pc,comp.sys.intel Subject: Re: protected mode 80286 questions Message-ID: <30057@sun.uucp> Date: Mon, 5-Oct-87 19:34:20 EDT Article-I.D.: sun.30057 Posted: Mon Oct 5 19:34:20 1987 Date-Received: Thu, 8-Oct-87 07:23:58 EDT References: <93@rocksvax.UUCP> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 25 Xref: mnetor comp.os.minix:1806 comp.sys.ibm.pc:8698 comp.sys.intel:369 In article <93@rocksvax.UUCP> martyl@rocksvax.UUCP (Marty Leisner) writes: >I'm trying to get a protected mode implementation of Minix running. > >Programs using split I & D (max 64K code, 64K max combined data/bss/stack) >require a code segment (execute only), a data segment and a stack segment. >Using 16 bit pointers on a 286 requires the data segment to include the >stack segment. Actually, a rather nice way to implement this type of process is to duplicate the stack segment pointer in 'ES'. Then you allocate three segments, Code, Data, Stack. With stack growing negatively and the heap growing positively from the bottom. You will have to generate segement exceptions now and then to get stuff from ES:address rather than DS:address. >I don't see a way the hardware is going to generate an exception until the >stackpointer reaches 0xffff -- which is 32k beyond the limit of our initial >stack segment and probably in the address space of some other process. When you specify the size of the segment the '286 will trap any access outside that size. If you are sharing segments with different processes (not likely unless your forking) then you have a problem with your address space. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.