X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: HimemX patch (was Re: Rebuilding 2.04 from source) Date: Sun, 21 Jul 2013 22:05:11 -0400 Organization: Aioe.org NNTP Server Lines: 62 Message-ID: References: <713e6460-511d-4b27-a9a5-b07cc63fd02d AT googlegroups DOT com> <2042449e-bcff-4329-a1e2-fd4e67e46446 AT googlegroups DOT com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-Priority: 3 X-MSMail-Priority: Normal Bytes: 3578 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com wrote in message news:ec04489e-817a-435a-82f8-fcd6f5b0aa88 AT googlegroups DOT com... > On Saturday, July 6, 2013 10:55:26 AM UTC-5, Rod Pemberton wrote: > > wrote in message > > > > news:2042449e-bcff-4329-a1e2-fd4e67e46446 AT googlegroups DOT com... > > > > > BTW, I also mailed a quick message to freedos-devel > > > > (Of course, the announcement probably need to be posted to > > Freedos.org news to get anyone to try it... ;-) > > I'm skeptical about how many people read such things, > but nevertheless, I've gone ahead and announced it > there too. Hope it helps. Thanks. I did find a bug. If you use the /MAX= parameter and set it to 4GB exactly (in KB), then it won't clamp to 4GB correctly. I.e., this line, and AFAICT, only this line, won't work: /MAX=4194304 Changing 4194304 to 4194303 (or lower) does work. This is a 32-bit overflow of eax by a shl. I think the value just needs to be decremented by one for Himemx to work correctly. But, this "new" machine (2009 parts just assembled) is only mapping 2.8GB of my 4GB below the 4GB boundary and pushing the remainder above 4GB! Unfortunately, the original Himemx code *only* supports memory below the 4GB boundary. So, this machine's third 001 E820 memory block above 4GB can't be mapped by Himemx. The E820 map supports 64-bit addresses and offsets. Himemx only support the lower 32-bits. Since this machine isn't mapping a full 4GB below 4GB, I still can't confirm if Himemx is clamped correctly to 4GB or not, just that it's not clamping incorrectly for the /MAX=4194304 anymore. So, maybe in the next week, I will adjust my fake BIOS E820 code and attempt to see if I can confirm correct clamping by HIMEMX. Sorry, I have yet to get the other old machine with AGP reassembled to test it. Anyway, for now, the one line code fix is indicated by FIX comment: ; clamp e820 memory to /MAX= memory limit, if set, and exit mov eax,[_xms_max] or eax,eax je @@e820_loop ; no maximum XMS set shl eax,10 dec eax ; FIX cmp esi,eax jbe @@e820_loop ; at or below maximum Rod Pemberton