I'm sorry about that. Or rather, I want to make my own OS, but what should I do? , risc-v or arm or x86
I'm sorry about that. Or rather, I want to make my own OS, but what should I do? , risc-v or arm or x86
I'm sorry about that. Or rather, I want to make my own OS, but what should I do? , risc-v or arm or x86
-
- Member
- Posts: 430
- Joined: Tue Apr 03, 2018 2:44 am
Re: I'm sorry about that. Or rather, I want to make my own OS, but what should I do? , risc-v or arm or x86
All and none.
Write the majority of you code as if you don't care.
Then use machine independent abstractions to hide the machine differences.
For example, when you want to map a virtual address to a physical address, the different CPUs have different ways of doing that mapping, so you expose the mapping in a manner that doesn't assume a particular method of encoding the page table:
Code: Select all
#define MAP_NONE 0x0
#define MAP_READ 0x1
#define MAP_WRITE 0x2
#define MAP_EXEC 0x4
/**
* Map virtualaddress to a physical page
*/
void arch_map_virtual(void * virtualaddress, paddr_t physicaladdress, unsigned prot);
/**
* Map virtualaddress range to a physical page range
*/
void arch_map_virtual_range(void * vfrom, void * vto, paddr_t physicaladdress, unsigned prot);
But do also read:
Required_Knowledge
Re: I'm sorry about that. Or rather, I want to make my own OS, but what should I do? , risc-v or arm or x86
x86 hardware is easy to get and setup. Limine barebones is also a good start for a new OS kernel.