OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Sep 20, 2020 2:52 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Loading Kernel
PostPosted: Fri Aug 12, 2005 11:00 pm 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 136
Hello everyone,

I load the kernel from floppy at boot time at some address
(say 0x8000). Everything goes fine for this implementation.

But I decided to Move the Loaded kernel to 1M.

So after boot, I entered Protected Mode with a Dummy GDT and Moved the loaded kernel code from floppy at 0x8000 to 0x100000 using REP MOVSB. and before switching, I loaded Final GDT with proper Base and Limit.

It went fine...... BUT :( some part of code doesn't
work properly,... like.... if control enters those parts of code, then the system Hangs/ Prints some Junk on Screen and Hangs/ Are crahses.....

The Behaviour varies with the size of kernel when i compile it.....

BUT BUT.... I tried Loading (Moving) at address 0x100300 or Above (say
0x108000)..... Everything Went Fine......

Can some one give suggesstions regarding this problem please....

NOTE:- 1) Don't Move Kernel after Load..... FINE
2) Load at ADDRESS 0x100000..... PROBLEM
3) Load at ADDRESS 0x100300 and ABOVE(tried upto 0x200000).... FINE.


I'm working on SUSE Linux OS.
GCC compiler. Plan Binary Format Kernel....


Top
 Profile  
 
 Post subject: Re: Loading Kernel
PostPosted: Sat Aug 13, 2005 11:00 pm 
Offline
Member
Member

Joined: Wed Nov 03, 2004 12:00 am
Posts: 132
Location: Austria
do you set up the a20 line correct ?


Top
 Profile  
 
 Post subject: Re: Loading Kernel
PostPosted: Sat Aug 13, 2005 11:00 pm 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 136
Yes.... There was a problem in the A20 Enable Code.....

Instead of sending 0xD1 to port 0x64, it was 0xDD.....

Thanks a lot to u......


At run time address 0x100 to 0x300 were used by DMA..... So
When kernel was loaded at 1MB it was actually wrapping up the address
and some Code at 0x100 - 0x300 was getting corrupted due to DMA
operation and hence the problem....
Know its solved.....


Top
 Profile  
 
 Post subject: Re: Loading Kernel
PostPosted: Fri Aug 19, 2005 11:00 pm 
Offline
Member
Member

Joined: Wed Nov 03, 2004 12:00 am
Posts: 132
Location: Austria
no prob, i had the same prob 3 years ago when i started, have a lot of fun ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: bloodline, mrjbom and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group