-1

https://github.com/mengchaobbbigrui/Linux-0.11code/blob/master/boot/head.s

I want to modify it based on this head.s

There is a problem that has been bothering me here, that is, the default paging in the Linux 0.11 source code is equal mapping, that is, the virtual address 0 is mapped to 0, and 0x1000 is mapped to 0x1000. Since head.s needs to be linked with the subsequent main.c and references the variables of main.c, it is related to the memory of main.c. It turns out that the heads of Linux 0.11 only need to set the virtual address of 0-16mb in the page table to map to the virtual address of 0-16mb, but now I want to map the kernel space from 0xc000000 to the continuous 16mb of kernel space. I am very confused now. I changed the address of the jump main function, but there is still a user_stack used as a stack in head.s, but it is a variable belonging to main.c. It's even worse when I do this. I am really confused about how to set up the page table to realize my idea. Now I have no idea at all. I just want to change the mapping position to high 3g, but I can’t figure it out now. Is there any expert guidance? Let me tell you how to change the code in such a complicated situation to realize my idea. My thoughts are in a mess now. Should I map all virtual addresses to the kernel space, but this is very strange. In this case, how to modify it so that it can jump to the main.c program and execute it correctly.

CHAOSYD
  • 15
  • 1
  • 5
  • You were advised your question was a mess over on [meta] when you [posted](https://meta.stackoverflow.com/questions/426238/how-to-modify-head-s-in-the-linux0-11-source-code-to-support-4gb-paging-and-map#comment970781_426238) it there. It's still a mess. That huge paragraph is basically unreadable. Also any code you have needs to be in the question, not some off-site resource. – Thom A Aug 30 '23 at 13:23

0 Answers0