|
Find the smallest code base.
As much as I love QNX, it is not small. You want to learn mastering the CPU first, then learn about hardware-drivers. Then, you start with the smallest you can find.
You focus on getting it to work, not on having it run on any CPU. Make it work.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
I had a class on OS design in college and the labs and textbook used MINIX. It's as good a place as any to start learning.
There is a textbook on OS design using MINIX here: Operating Systems: Design and Implementation[^]
There are no solutions, only trade-offs. - Thomas Sowell
A day can really slip by when you're deliberately avoiding what you're supposed to do. - Bill Watterson (Calvin & Hobbes)
|
|
|
|
|
Just saw this post and I think a great place to start is with Linux (systems programming) and understanding what the OS does. It'll provide a good foundation to maybe later "writing your own little os" -- booting up hardware and running a little kernel of some type.
So, to reiterate, really learn about Linux systems programming because you'll get a lot of understanding the challenges that other devs had to solve.
And to really learn in depth that systems programming take a look at the fantastic book which will guide you through writing programs in Linux, The Linux Programming Interface: A Linux and UNIX System Programming Handbook[^] by Michael Kerrisk.
That book will help you get a foundation so you don't feel overwhelmed by the huge topic of OSes
|
|
|
|
|
There are emulated CPU's with reduced function sets, specifically so you can practice opcode instructions.
You can buy an FPGA board with some basic RAM and a DSP to practice VHDL and low level drivers loaded into RAM, which helps to explain the role of hardware VS machine instructions.
After that you can take a look at actual PC hardware. Do some MASM, some C, some C++ and some C#. Then roll your own "Linux from scratch" and make it compile and run those 4 languages.
That should cover everything, I think. Might take a while though.
|
|
|
|
|
If you start from scratch, master your C and at least some assembler programming in your platform of choice, as it will be needed for some of the startup code.
As for books, I studied on the Silberschatz / Gagne / Galvin Operating Systems Concepts. It is a monster doorstopper of a book and it costs a kidney but it's worth it.
If you start practicing on some embedded stuff with ARM you should be able to see the lowest level of controlling the CPU without much overhead, in this day and age it's definitely simpler than trying to wrestle with full kernels like Linux and it's not expensive.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Well, easy to ask but somewhat hard to answer... I had almost the same question roughly 35 years ago. Here's what I suggest: Read The Design and Implementation of the Unix System V by Maurice Bach. Dive into the sources of Minix 1.5 (the first one leveraging protected mode) and read Tannenbaum's documentation on this OS (I guess that's what Linus did as well before he coded his first kernel...). Read the INTEL 80386 PROGRAMMER'S REFERENCE MANUAL 1986 to gain an understanding of how HW supports OS design ideas. Sure, these resources are old, but the basic concepts they tell about are still valid. While studying you will certainly encounter new questions, and grasping the answers (with help of Google) will lead you step-by-step into the present of OS design.
|
|
|
|
|
|
Go for books by
Andrew S Tanenbaum
It is *the* book on this subject. I cannot praise it enough.
This guy wanted his students to learn this subject so bad that he wrote an operating system from scratch (Minix, the actual birthplace of Linux).
|
|
|
|
|
If you are looking at ESP8266 then Linux is too big by far. I'd suggest looking at FreeRTOS. It is not a full featured OS but it does have a scheduler that you have a hope of understanding, code for task switching and the bonus of exploring a real-time OS, and it fits on a ESP8266.
|
|
|
|
|
I've been working through a course on Udemy called Developing a Multithreaded Kernel From Scratch by Daniel McCarthy. This course is kind of a walkthrough and you will have to put in work on the side to fully understand some of the topics. Develop a Multithreaded Kernel From Scratch. Much of the material seems to come from OSDev, but for me that is okay. I'm fine with repackaging content so I can code along because more important than reading about stuff is doing stuff. When I want to know how something works in more detail I can go read more details on OSDev and other sites.
I think this is my first interaction on Code Project. I've been lurking for a couple decades I'd imagine. This topic is something that I think is so beneficial these days I was compelled to provide more information. If you're familiar with the Udemy game then play it and wait for course to be lower price. I don't know or am not affiliated with Daniel, but I've enjoyed a couple of his walkthrough style courses.
“The purpose of thinking is to let the ideas die instead of us dying.” - Alfred Whitehead
|
|
|
|
|
Hi,
Go check out grc.com.
The entire site is written in assembler and does provide a means of getting in to assembler.
That will get you familiar with a language that works the bits and bytes directly.
Regards,
Cegarman
document code? If it's not intuitive, you're in the wrong field
|
|
|
|
|
|
I started by learning about IBM OS/360 and IBM System\370 Principles of Operation.
Everthing was based on Linked Lists.
If modern processors included certain features that were used in these machines, we would not have nearly as many hacking successes.
|
|
|
|
|
You're going to have to do some reading on your own ... a superficial knowledge of a complex subject will mean you won't understand much of what you are told to do. Things like: Operating Systems Fundamentals.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
You could look at uC/OS by Jean Labrosse. It's a small real time kernel developed back in the early 90's. He's got a few books out on uC/OS versions (version 1, 2 and 3). I've got the original book and it explains how things work pretty well. I actually used uC/OS in a project at work way back when. It pretty much got me started using RTOSes.
|
|
|
|
|
You already have a lot of indications on how to do it.
I just say... tough topic, brave intention. Go for it, work hard and good luck
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Here's a reimplementation of Unix V. 6 for modern hardware that was made precisely for the learning of operating system design. Called XV6, it's all in C so it's very simple.
6.1810 / Fall 2022[^]
Some reference:
xv6 - Wikipedia[^]
|
|
|
|
|
If there was an obscure question that had one (wrong) answer, and people (somehow) started asking that same question, would AI respond with the wrong answer until it became "the" answer?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I tried asking ChatGPT this, but it's at capacity right now.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: it's at capacity right now.
Too many school kids getting the wrong answer ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Jeremy Falcon wrote: I tried asking ChatGPT this, but it's at capacity right now. It said this:
Quote: No, AI would not respond with the wrong answer until it became "the" answer. AI systems are designed to provide accurate and reliable answers, and they would not be programmed to provide wrong answers. AI systems are programmed to use algorithms to analyze data and provide the most accurate answer possible. Heh, and I believe it? Nope!
|
|
|
|
|
It’s good at sales at least. But we know how that goes. =D
Jeremy Falcon
|
|
|
|
|
Yes. But so do humans, and not just for obscure stuff.
40 countries help Turkey; 3 countries help Syria.
What do you think "religion" is? Ghosts, Angels?
Ask ChatGPT for me which religion is "correct" and post me the answer If you want a real riot, ask it who blew up the gaslines to Germany.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
"There is no definitive answer to this question."
|
|
|
|