problems with address 0x00100000

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DIGIT4L_PUNK

problems with address 0x00100000

Post by DIGIT4L_PUNK »

hi
I'm working on kernel image loader for DOS. I use flat-real mode to copy the image to the destination memory address (pointed by ES:EDI) when EDI = 0x00100000 (beginnig of the 1st megabyte) after the mem-copy is done, system hangs. and e.g. if EDI = 0x00200000 everithing works fine.
so, what's the problem? ???
keep in mind, I have Compaq DeskPro
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:problems with address 0x00100000

Post by kataklinger »

Flat real mode? Memory area from 0x100000 to 0x10FFEF is known as HMA maybe DOS puts some drivers or TSRs there.
GLneo

Re:problems with address 0x00100000

Post by GLneo »

try the deleting the command in config.sys:DEVICE=C:\WINDOWS\HIMEM.SYS
that should stop dos from puting things in hma, mabey?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:problems with address 0x00100000

Post by Candy »

DIGIT4L_PUNK wrote: hi
I'm working on kernel image loader for DOS. I use flat-real mode to copy the image to the destination memory address (pointed by ES:EDI) when EDI = 0x00100000 (beginnig of the 1st megabyte) after the mem-copy is done, system hangs. and e.g. if EDI = 0x00200000 everithing works fine.
so, what's the problem? ???
keep in mind, I have Compaq DeskPro
If your A20 doesn't enable properly, you're memcpy'ing to the IVT and further on. The very next interrupt (random-ish) will crash your system then.

If your DOS uses a HMA driver, that crashes your system if the A20 does work.

If neither of these, it should work.


Note, 0x200000 doesn't use A20 but A21 (and A[19..0]) so it does work if the A20 enable failed.
DIGIT4L_PUNK

Re:problems with address 0x00100000

Post by DIGIT4L_PUNK »

I made a test of A20. here it is:

Code: Select all

mov word [ES:DWORD 0x001b8000],'! '
It shoud print '!' on the screen if the memmory-wrapping was active.
... and I've got a question: when enabling A20 GATE, only 20th bit is enabled? :o I knew that entire >=20 bits were enabled when toggling A20 GATE. Am i wrong ???
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:problems with address 0x00100000

Post by Candy »

DIGIT4L_PUNK wrote: ... and I've got a question: when enabling A20 GATE, only 20th bit is enabled? :o I knew that entire >=20 bits were enabled when toggling A20 GATE. Am i wrong ???
AFAIK, the A20 gate ONLY controls the A20 line. That means, the A21..A31 line are always on, but that doesn't matter since you can't access them from real-mode anyway.

So, if you can't get the A20 enabled, you'll have half your memory in 1M chunks with gaps.
Post Reply