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.
i am beginner and i am trying to write kernel and i wrote a kernel which print hell but when i add gdt for it restart my comp i used grub loader, but i cant solve this problem from couple of week please help me, i so frustate from this problem i link 3 files asm,c and ld and make elf file i send my code with this, if any info want i ready to send thnx,
nil
[[email protected]] : :-[
at what address did you asked GRUB to load it ? and at what address is it supposed to be run ?
You do not ignore the GDT.base value is quite sensitive to that kind of details (while your data are DS-relative, the base address of the new GDT is not)
Pype.Clicker wrote:
at what address did you asked GRUB to load it ? and at what address is it supposed to be run ?
You do not ignore the GDT.base value is quite sensitive to that kind of details (while your data are DS-relative, the base address of the new GDT is not)
hello Pype.Clicker ,
i am loading my kernel at 1mb
in my linker script,
physical mem 1mb
virtual mem is 3mb
when i use both physical and virtual same it work properly
but when i change it cant work
is this is gdt problem ?
please reply me urgently if possible
wait for reply
i u want i again send my code
the main problem that i see is that you stick in the multiboot header before a jump to start, so when your kernel is loaded is tries executing the header values. try:
iirc, GRUB is not able by itself to handle virtual address/physical address stuff. If you want to have the kernel at a physical address different from the virtual address (for instance to have upper-half kernel), you need to perform the 'remapping' yourself, either by switching to another GDT that has different based-segments, or by turning on paging.
bkilgore wrote:
The main problem that i see is that you stick in the multiboot header before a jump to start, so when your kernel is loaded is tries executing the header values.
Nope. This isn't your average flat binary where offset #0 gets executed after loading - he's using GRUB, which means that he's probably using a linker script to build an ELF executable from this assembly. As long as that linker script declares "ENTRY = start" so that GRUB can find the correct entry point, everything is fine. (Or maybe "start" is even the default ENTRY? I don't know, I played it save in *my* linker script. )
Every good solution is obvious once you've found it.