Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I expand upon the foundation I've built through this blog? #1341

Open
nothing2code opened this issue Sep 1, 2024 · 9 comments
Open

Can I expand upon the foundation I've built through this blog? #1341

nothing2code opened this issue Sep 1, 2024 · 9 comments

Comments

@nothing2code
Copy link

nothing2code commented Sep 1, 2024

I have a few specific goals in mind for further development:

  • Implementing a framebuffer
  • Building a simple terminal to execute commands
  • Attempting to run Doom (which I realize might be more challenging than I anticipate)

Is it feasible to achieve these with the groundwork I've laid by following this blog? Additionally, where can I find the necessary resources to guide me through these next steps?

@nothing2code nothing2code changed the title How to build on top of this? Can I expand upon the foundation I've built through this blog? Sep 1, 2024
@l3gacyb3ta
Copy link

The OS Dev wiki is a great place to look! And you can totally expand on this.

@ChocolateLoverRaj
Copy link

Implementing a frame buffer

Just use edition 3, the bootloader crates give you a frame buffer. ez

Building a terminal

When you have a frame buffer and keyboard input, making a terminal is simply a matter of putting it together. If you want to execute arbitrary programs through the terminal then that would require loading elfs, and you would probably want to have the terminal run in user mode.

Porting Doom

Idk how to do this, idk what doom is even like. I am guessing that in addition to having frame buffer + keyboard input + mouse input, you would have to build doom with functions specifically for your OS and then run the elf.

@ViktorPopp
Copy link

Implementing a frame buffer

Just use edition 3, the bootloader crates give you a frame buffer. ez

Not quite. Some parts of the paging needs ti be rewritten.

@tsatke
Copy link

tsatke commented Feb 14, 2025

@ChocolateLoverRaj to port doom, you set up a gcc toolchain that works with your os and compile doom from source, then fix all the problems you encounter. I'd assume that your os would need to be POSIX compatible for that, I'm not sure, as I've never attempted it.

@ViktorPopp
Copy link

@tsatke it is easier just creating a linux/posix compatible elf and syscall abi

@tsatke
Copy link

tsatke commented Feb 14, 2025

Can you rephrase the question to be more precise?

Easier than what?

create an elf abi

You can create your own formats based on elf (apple did this for example), but that's not needed here

create a Linux compatible syscall abi

In case you actually mean ABI, use C or sysv64, no need to create your own. Don't know what Linux uses, but I'd assume one of those.

create a posix compatible syscall abi

In case you actually mean ABI? Posix doesn't care for all I know. Your syscall abi is between your Kernel and your OS.

In case you mean syscalls, posix specifies them for you. This is stuff like read, fopen or mmap that you know from for example the C stdlib.

@bjorn3
Copy link
Contributor

bjorn3 commented Feb 14, 2025

You can create your own formats based on elf (apple did this for example)

Mach-O and ELF are entirely unrelated. They were created roughly at the same time and have a quite different structure.

@ViktorPopp
Copy link

Sorry for the misunderstanding. I meant creating a Linux compatible syscall ABI and an elf loader (or elf compatible). Then DOOM and other applications can be compiled for linux and run natively on your own OS.

@tsatke
Copy link

tsatke commented Feb 14, 2025

Unfortunately syscalls are not the only way the OS interacts with the kernel. There's also files (which is basically everything), so you'd also have to replicate that (if you want to run programs that were compiled with a linux toolchain). This is still very simplified.

Some resources for your reading:


@bjorn3

You can create your own formats based on elf (apple did this for example)

Mach-O and ELF are entirely unrelated. They were created roughly at the same time and have > a quite different structure.

TIL. I recall somebody writing that somewhere, but didn't double check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants