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....
Loading Kernel
-
- Member
- Posts: 132
- Joined: Wed Nov 03, 2004 12:00 am
- Location: Austria
- Contact:
Re: Loading Kernel
do you set up the a20 line correct ?
Re: Loading Kernel
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.....
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.....
-
- Member
- Posts: 132
- Joined: Wed Nov 03, 2004 12:00 am
- Location: Austria
- Contact:
Re: Loading Kernel
no prob, i had the same prob 3 years ago when i started, have a lot of fun