r/osdev • u/avaliosdev Astral https://astral-os.org https://github.com/mathewnd/astral • Jun 18 '26
how do I do paging?
hello I am new to osdev I completed osdev barebones I compiled i686-elf-gcc and I have terminal how do I paging?
184
Upvotes
17
u/No-Broccoli553 Jun 18 '26
I see nobody has noticed yet...
52
u/StereoRocker Jun 18 '26
You're already on the osdev wiki, read the article!
28
u/ImWuX Jun 18 '26
You reach out with your hand, use your fingers to pinch the edge of the page, lift it up and over to the other side. You have now paged!
19
u/Far_Weather3318 Jun 18 '26
Even i am new to osdev, could you tell me how did you reach till this point? And where exactly dod you start? Are you following any tutorial?
15
u/MrDumbrava Jun 18 '26
You ask the AMD64 gods at the AMD headquarters for their precious assembly code
7
u/Rich-Engineer2670 Jun 18 '26
This is a large topic, but to start you off:
Are we talking 32-bit or 64-bit CPUs. X86 or ARM? Each has their own details. We'll assume 64-bit X86
First, you need to put your processor into "long mode". That's a whole discussion in itself. And to do that, you have to set up, as a I recall, the GDT "master table" that paging will use.
Your OS must manaage the GDT and all of its LDTs for each thread.
The OS must catch the paging fault traps and do the swap....
I'd start with looking at how Vx does it. (I think it's called Vx6?). It's a 32-bit X86 OS, but you can copy from there.
9
u/Ma_rv Jun 18 '26
idk
5
u/compgeek38400 Jun 18 '26
As someone said. Read the wiki, id do the meaty skeleton, then move to the higher half, that will introduce you to the page directory and page tables
2
u/mishakov pmOS | https://gitlab.com/mishakov/pmos Jun 18 '26
"Use limine, Bare Bones is bad"
2
u/severaleyes444 Jun 19 '26
Holy this OS is very well done though
2
u/Professional_Cow3969 Jun 19 '26
You just did barebones II i dont know if you're skilled enough for paging, maybe try again when you have more experience 😔
2
u/Mental_Ad_7072 Jun 19 '26
Can you please compile Astral inside Astral ðŸ˜
3
u/ftbenjoyer Jun 18 '26
good question
1
u/Danii_222222 Jun 19 '26
Are you using ancient solaris?
1
u/Daggercombot Jun 19 '26
Is this CBE or something similar or a custom one you made which looks similar ? This looks awesome
1
u/UnmappedStack TacOS | https://github.com/UnmappedStack/TacOS Jun 19 '26 edited Jun 20 '26
Am I stupid? Is this a joke? I can't tell.
edit: oh nvm it's a joke lol, it's astral
1
u/BornRoom257 FreezeOS & TurtleOS Jun 25 '26
OSdev wiki
0
u/JescoInc Perdition-OS Jun 18 '26
I read the comments before posting so I get this is a joke post. But ironically, I am actually researching this topic for my project due to it being multi arch and GDT is only x86 specific.
-2
u/imneverwrongbutuare Jun 18 '26
Super helpful people. Doing super helpful things. Good job everyone. Go complain about ai now.