Page 1 of 4

Over 1 Meg OS Loading

Posted: Sun Dec 29, 2002 10:32 pm
by jrfritz
[attachment deleted by admin]

Re:Over 1 Meg OS Loading

Posted: Sun Dec 29, 2002 11:00 pm
by Perica
..

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 6:01 am
by Pype.Clicker
if unreal mode doesn't seem to be reliable to you, you can also opt for a call to BIOS memory move function (it must be in INT15h, or something alike), which moves 64K blocks from any to any memory position (switching to protected mode, moving stuffes, moving back to real mode)

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 6:12 am
by pskyboy
Yeah, i just load my kernel in to a block of memory in real mode i then jump to P Mode and move it to where i want it using the movsd instruction. This moves DWORDS. All you have to do is put the amount to move in ECX, Put the destination address in EDI, put the source address in ESI and then MOVSD till it has moved it all.

here is the code

Code: Select all

;We're in protected mode so lets move the kernel down to 0
   mov ECX,Kernel_Size
   mov EDI,0x0
   mov ESI,0x40000
   REP MOVSD

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 6:21 am
by Pype.Clicker
stay aware that movsd requires ecx to be a *dword* count of the size, so better have
mov ecx, kernel_size/4 ...

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 7:42 am
by Perica
..

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 8:02 am
by jrfritz
Ok pskyboy...

I could load it into 0x40000 if I had more than 1 meg of room...how do I do this? Switch to PM and switch to RM with the GDT still intact or something? Also...could someone please post a GDT that lets the 4gig of mem?

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 8:06 am
by pskyboy
Im not quite sure what your trying to say. But basically you load your OS to 0x4000:0000 in real mode you then set you GDT tables up and jump to PMODE and then copy the kernel from 0x4000 to wherever you want it then jump to there.

Peter

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 8:34 am
by jrfritz
Yea but my GDT's data and codesel only have 0xFFFF...is that enough? How do I change that?

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 9:22 am
by pskyboy
Yeah that will be 4Gb as long as you have the bit set that enables 32bit segments ill have to check which bit that is.

Peter

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 10:39 am
by jrfritz
Some help with enabling 32-bit segments?

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 12:18 pm
by df
i used to have a boot sector that loaded a kernel off a FAT12, and read 1 sector, swhitched to pmode, moved 512bytes, switched to realmode, read 1 sector, etc and looped until it was all in 1mb mark.

then just switched to pmode and jumped to 1mb!

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 2:06 pm
by pskyboy
[attachment deleted by admin]

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 2:12 pm
by jrfritz
Compatible with a Pentium?

Re:Over 1 Meg OS Loading

Posted: Mon Dec 30, 2002 2:50 pm
by pskyboy
Yeah its only a IA32 bootloader at the moment im waiting for a x86-64 assembler before i make it into a 64bit bootloader.


Peter