How to specify certain location in memory

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
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

How to specify certain location in memory

Post by gabemaiberger »

Hello, I would like to know how to specify a certain location in memory in my disk address packet so it will load my kernel at the address 0x100000 above the first megabyte of memory. Here is my disk address packet:

Code: Select all

dap:
dapsize db 0x10
db 0
numsectors dw 64
memory dd end
startsector dq 3
I am using extended read int 0x13 ah=0x42. Also, how would I specify that location in memory using db in order to jump to my kernel.

Code: Select all

var myCat="marshmallow"
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

Re: How to specify certain location in memory

Post by Nessphoro »

You can't load above 1 megabyte in real mode.
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Re: How to specify certain location in memory

Post by gabemaiberger »

Thanks for the help. However, I have a dilemma. If I cannot load my kernel above 1mb in realmode and I can't use interrupts in protected mode what do I do?

Code: Select all

var myCat="marshmallow"
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: How to specify certain location in memory

Post by Mikemk »

Load it in real mode, then move it in protected mode; or switch to unreal mode, load it, move it and switch to pmode.
The first method is easier if you're only loading one file, or multiple files that fit within 640k. otherwise, the second method is easier.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Post Reply