Live data from Hacker News

How to Make a Computer Operating System in C/C++

github.com

21–30 of 88 posts

Re: How to Make a Computer Operating System in C/C++

#21
post #11

It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?). The code is predominantly C++.

I used to put C/C++ in my curriculum until I realized that my C++ code was getting a lot less "C-like" each year. Now I put it separatedly, which also allows for a nice explanation whenever I'm asked about it in a job interview.

Re: How to Make a Computer Operating System in C/C++

#22
post #14

I am a graduate student, currently working on building a x86_64 unix like preemptive kernel from scratch, as part of a course. Most of the OS dev guides and books focus on 32 bit arch and I haven't found a single guide so far that is based on 64 bit arch. Since this this guide seems to be in its inception, I hope someone (hopefully me) will send a pull request for a 64 bit tutorial. Building an OS has been in my buck…

Building OS' is fun. I wish I could spend all day doing it but I've been pushed so far up the stack that I spend most of the time arguing with analysts and preparing documentation...

I've built two so far which were (and I think still were until recently) used in production equipment. One Forth system (all 8k of it) that ran a PLC system and a tiny (16k) kernel for an M68k system that was a router for a modbus-like protocol over RS485.

Nothing x86_64 but nevertheless the most fun I've ever had with a computer.

Re: How to Make a Computer Operating System in C/C++

#23
post #11

It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?). The code is predominantly C++.

> write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?) I'm going to use this as an opportunity to champion C++ for systems programming despite the fact that it wasn't really your argument. I feel obligated to do this because I agreed with you for a long time on this but have changed my mind over the past year or two. The argument against C++ as a systems programming languag…

[deleted]

Re: How to Make a Computer Operating System in C/C++

#25
post #11

It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?). The code is predominantly C++.

> write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?) I'm going to use this as an opportunity to champion C++ for systems programming despite the fact that it wasn't really your argument. I feel obligated to do this because I agreed with you for a long time on this but have changed my mind over the past year or two. The argument against C++ as a systems programming languag…

You can have generalized containers in C, using the intrusive pattern.

For example, Linux's list.h has an intrusive list that is far better than the abysmal std::list from the STL.

Re: How to Make a Computer Operating System in C/C++

#26
post #25

Earlier quoted context omitted.

> write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?) I'm going to use this as an opportunity to champion C++ for systems programming despite the fact that it wasn't really your argument. I feel obligated to do this because I agreed with you for a long time on this but have changed my mind over the past year or two. The argument against C++ as a systems programming languag…

You can have generalized containers in C, using the intrusive pattern. For example, Linux's list.h has an intrusive list that is far better than the abysmal std::list from the STL.

Any C++ programmer knows not to use std::list anyway.

Re: How to Make a Computer Operating System in C/C++

#27
post #25

Earlier quoted context omitted.

> write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?) I'm going to use this as an opportunity to champion C++ for systems programming despite the fact that it wasn't really your argument. I feel obligated to do this because I agreed with you for a long time on this but have changed my mind over the past year or two. The argument against C++ as a systems programming languag…

You can have generalized containers in C, using the intrusive pattern. For example, Linux's list.h has an intrusive list that is far better than the abysmal std::list from the STL.

I've only recently started C++ development...why is std::list abysmal?

Re: How to Make a Computer Operating System in C/C++

#28
post #7

I just wish more people dealt with ARM instead of x86. It's a far better architecture for people to learn system design.

Why?

(I'm curious as I know little of these kinds of things, and because citing sources or giving arguments is always a good thing)

Re: How to Make a Computer Operating System in C/C++

#30
post #14

I am a graduate student, currently working on building a x86_64 unix like preemptive kernel from scratch, as part of a course. Most of the OS dev guides and books focus on 32 bit arch and I haven't found a single guide so far that is based on 64 bit arch. Since this this guide seems to be in its inception, I hope someone (hopefully me) will send a pull request for a 64 bit tutorial. Building an OS has been in my buck…

I think that AMD Developer Guides & Manuals [1] are very good resources for x86_64 System Programming (better than Intel Manuals). They are better explained and focus on x86_64 arch. [1]: http://developer.amd.com/resources/documentation-articles/de...

I still have a soft spot for the intel manuals.. probably because I managed to get print copies right before they stopped giving them out :)
Post reply on HN