Problem loading OS code

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
znewsham
Posts: 9
Joined: Sat Sep 01, 2007 6:16 am

Problem loading OS code

Post by znewsham »

Hello,

I have been working on an OS for quite some time, and it has grown quite a lot since the start, I am now finding some problems. the OS code is around 11KB in size. and the boot code loads it into memory address 0x1000, using int 13, here arises the first problem, you would have thought that to load something into address 0x1000, I could set es to 0x100 and bx to 0, and load it into that (int 13 using es:bx) but no, it will only load if the address is 0x1000 and is set in bx.

Second problem, it will only load to 0x1000, not 0x2000 or anywhere else.

I can post any code that you would like in order to help with this, its driving me mad, cant seem to get it..the only reason I discovered this problem, is that my memory manager that had a memory "map" of 2048 bytes (can assign 1024, 1024 byte chunks) wasnt large enough to load an entire FAT table from a HDD, so I tried making it larger, and hit a problem, I cant make the table that large, or I get a stack fault... This implyes that 12000 bytes after 0x1000 + 10000(what i set my mem map size to) is the stack...but I set that up to be in 0xffff...

As I say its driving me mad, any help would be great.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

99.999999% chance it is *not* the bios' fault. Most likely you have a bug elsewhere.

Could you please post code for reference?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply