From: "Michael Stewart" Newsgroups: comp.os.msdos.djgpp Subject: Re: 13h forerver (heyy) Date: Wed, 28 Jul 1999 10:13:41 +0100 Organization: (Posted via) Netcom Internet Ltd. Message-ID: <7nmhk8$dr9$1@taliesin.netcom.net.uk> References: NNTP-Posting-Host: hgty.capgemini.co.uk X-Trace: taliesin.netcom.net.uk 933153224 14185 194.42.240.2 (28 Jul 1999 09:13:44 GMT) X-Complaints-To: abuse AT corp DOT netcom DOT net DOT uk NNTP-Posting-Date: 28 Jul 1999 09:13:44 GMT X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Lines: 34 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote in message ... > >On Wed, 28 Jul 1999, conrad wrote: > >> info.size = 320*200; >> info.address = 0xa0000; >> __dpmi_physical_address_mapping (&info); >> my_ds = __dpmi_allocate_ldt_descriptors (1); >> __dpmi_set_segment_base_address (my_ds, info.address); >> __dpmi_set_segment_limit (my_ds, (320*200+5)|0xfff); > >This is the wrong way of creating a selector for the video RAM. >__dpmi_physical_address_mapping is for mapping in addresses above 1MB >mark that by default aren't mapped by the DPMI server. See section >18.4 of the DJGPP FAQ for a description and an example of working code >that sets up a selector for video RAM. > >Also, your code doesn't even check for error returns from the DPMI >functions you call. No offence, but IMHO such programs really deserve >to crash... I wrote (with an awful lot of help from Eli) a small bit of code which may help here. If you search for the thread 'Selector code' then for a message posted about 21 June, it should contain the code we produced. Use it like this: if (make_ds (my_ds, 0xa0000, 64000)) { //error } As far as I know it is bug free and fully working.