Re:I spent 5 years writing my own operating system
by mryalamanchi on Sunday June 27, 2021 @07:33AM
(#27650690)
It's a tough ask but I would like to understand what will be the steps to go through.
[ Parent
| on HN ]
Re:I spent 5 years writing my own operating system
by halfer53 on Sunday June 27, 2021 @07:46AM
(#27650780)
It's certainly plausible
It's currently using wcc to compile the kernel https://github.com/wandwramp/wcc. We can swap it with gcc for sure, but require bit of work, especially the output format and backend.
Winix assumes the output file is in srec format https://en.wikipedia.org/wiki/SREC_(file_format), so we would need to tweak gcc to support this header format and add backend support for WRAMP architecture.
ELF is quite complicated, if I have to do this, I probably just copy some codes from linux.
Re:I spent 5 years writing my own operating system
by bregma on Sunday June 27, 2021 @08:20AM
(#27650998)
If you're not supporting DSOs (shared libraries) then ELF is pretty straightforward. In fact, from the kernel point of view it's still fairly straightforward since all you need to do is either load the (non-DSO) program and go, or else load the (non-DSO) program named in the interpreter entry and go, and leave the hard lifting to the interpreter. The kernel itself never needs to understand about DSOs or GOTs and PLTs or DWARF or any of the other fancy magic that ELF brigs to the table. Just how to find and load the LOAD segments and where the entry address is, or where the PT_INTERP string is.
It's really just that easy.