loading the kernel to 1MB

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.
mr. xsism

loading the kernel to 1MB

Post by mr. xsism »

hello all,
when i try to load my kernel to 1MB (0xffff:0x10) it works in bochs and on a gateway. But when i try it on my celeron and pentium it reboots, and doesn't display anything like it should. Are there any guesses as to why this is happening? Maybe it's the A20 gate? Note: when i load the kernel to 0x9000 it works fine on all of the PCs. Wierd huh?!

Thx in advance.

regards,
Mr. xsism


---
check out my attachment, it is my working bootloader that loads to 0x9000. Again, is it the A20 gate code?


[attachment deleted by admin]
DynatOS

Re:loading the kernel to 1MB

Post by DynatOS »

Just because you enable the A20 line in Real Mode doesn't mean you are going to have the kind of access to memory over 1MB that you want. You have to remember how the 16-bit SEGMENT:OFFSET mechanism works. The Segment and Offest altogether is only a 20-bit address (0 - 1048575), which is only 1 MB. (0xFFFF:0x10) equals 0010:0000 and should not work at all because it is trying to address the 2nd MB of Memory which is beyond the 20-bit addressing range.

You must jump to 32-bit Protected Mode (Unreal if you really must) before trying to actually access memory over 1MB.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:45 pm, edited 1 time in total.
mr. xsism

Re:loading the kernel to 1MB

Post by mr. xsism »

question, did you look at my boot.asm that i attached? If you did, you should have seen that i do jump to pmode and then jump into my kernel. How come it would work on one PC but not the other? And tell me, what exactly is the A20 gate for? I thought it was for enabling all memory over 1MB. One more thing, if 0x100000 is over the 20bit max bus address size, how do you access any memory over 1MB??

---
I think i am really confused now. How can i load my kernel to 1MB if 1MB can't be achieved on the 20bit bus!? Please, someone needs to explain this, and tell me how to load my kernel to 1MB :'(

---

Regards,
Mr. xsism
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:45 pm, edited 1 time in total.
mr. xsism

Re:loading the kernel to 1MB

Post by mr. xsism »

lol @ perica,ok i'm goin there perica. You really want some publicity, huh? Well, isaw this tut before(you showed it to me). Hopefully there-in lies the answer to my problem. I'm readin it right now. Thx

Regards,
Mr. Xsism
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:46 pm, edited 1 time in total.
mr. xsism

Re:loading the kernel to 1MB

Post by mr. xsism »

well, that didn't answer my question :-\ So what now? Can some more people please look over my boot.asm file! It's in my first post at the top ofthis page.

---
0xffff:0x10 = 1MB - does anyone disagree? What am i doing wrong!!!! :-X IN NEED OF HELP!!!!
---
Regards,
Mr. xsism
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:46 pm, edited 1 time in total.
mr. xsism

Re:loading the kernel to 1MB

Post by mr. xsism »

strangely enough that's what i did just after i posted this topic. Here is the new code. Check it out and tell me what is wrong or right with it :0

thx

Regards,
Mr. Xsism

[attachment deleted by admin]
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:46 pm, edited 1 time in total.
mr. xsism

Re:loading the kernel to 1MB

Post by mr. xsism »

OK,i did the a20 debug and apparently the a20 isn't enabling on the 2 PCs. And, how do i move the stack over 1MB? can u give me an example, i know how, but i want to make sure. Tanhks again.

Regards,
Mr. Xsism
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:46 pm, edited 1 time in total.
DynatOS

Re:loading the kernel to 1MB

Post by DynatOS »

Perica Senjak wrote: 0x00100000 is NOT over the 20-Bit Bus Address Size;
Essentially, it is. 20 bits can only address upto 1048576 Bytes (0-1048575).

Pat is right about one thing though, the A20 enables a change in how things are addressed on an 80286+, it expands beyond the 20 bit addressing limit set by the 8088/8086.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:loading the kernel to 1MB

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:46 pm, edited 1 time in total.
Post Reply