Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks, so glad people like the code! I keep looking for ways to make it simpler and more obvious.

> - noticed krn_main() ends with `while (1);` [1]. I would've expected a "schedule" call or something. I assume there's no real busy loop burning CPU, maybe it's never meant to reach this code?

Yeah, `gui_main()` takes over and is not supposed to return, so the code is unreachable. The loop is just an old idiom used in such places (e.g. [1]), though I've now replaced it with a comment and a call to `halt()` to better convey the intention.

> - I'm reminded of the "bare metal OS" when I see one of the apps call `krn_*` functions directly [2].

Yeah... but at least the kernel doesn't call the apps... which it could ;^)

[1] https://github.com/freebsd/freebsd-src/blob/main/sys/x86/x86...

 help



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: