I want to create a small OS with bare metal CLI. What should
I want to create a small OS with bare metal CLI. What should
I want to create a small OS with bare metal CLI. What should I do?
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: I want to create a small OS with bare metal CLI. What sh
nora23169 wrote:
I want to create a small OS with bare metal CLI. What should I do?
Perhaps you should define what you mean by a "small OS" and create a set of requirements for what that is. Beyond that, there needs to be some specific minimal hardware configuration that will be required to run it. Overall, a bit of a tall order, especially if you're not quite sure where to start.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: I want to create a small OS with bare metal CLI. What sh
There's also this one linked on this site's source-code repository page at http://6502.org/source/, under the heading "Operating System Kernels":
(Note: It's for the NMOS 6502, and could be made more efficient if you're using a CMOS 6502 (ie, 65C02) which has more instructions and addressing modes available.)
For multitasking ones that are not so small, check out our own André Fachat's index page on this site, http://6502.org/users/andre/, and page 18 of my 6502 stacks treatise, at http://wilsonminesco.com/stacks/potpourri.html
Operating systems are something I myself have not gotten into; but I have to agree with floobydust's advice above to search to see what's already been done in this area for the 6502, and then I would figure out a starting set of functions, always using an approach that allows for expansion and improvement without having to start over.
- Mini Multitasking Kernel by Joachim Deboy
This mini-kernel uses IRQ interrupts from a free-running 6522 timer for task switching. It supports four concurrent tasks, each receiving fixed time slices in a round-robin method.
(Note: It's for the NMOS 6502, and could be made more efficient if you're using a CMOS 6502 (ie, 65C02) which has more instructions and addressing modes available.)
For multitasking ones that are not so small, check out our own André Fachat's index page on this site, http://6502.org/users/andre/, and page 18 of my 6502 stacks treatise, at http://wilsonminesco.com/stacks/potpourri.html
Operating systems are something I myself have not gotten into; but I have to agree with floobydust's advice above to search to see what's already been done in this area for the 6502, and then I would figure out a starting set of functions, always using an approach that allows for expansion and improvement without having to start over.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: I want to create a small OS with bare metal CLI. What sh
Just a quick follow-up, here's some links to find some of the code I referenced in my initial post:
Dietrich's CPM-65:
https://github.com/Dietrich-L/CPM-65
David Given's CPM65:
https://github.com/davidgiven/cpm65
Rich Leary's DOS/65:
http://retro.hansotten.nl/6502-sbc/dos-65/
Fuzix:
https://github.com/EtchedPixels/FUZIX
Note that DOS/65 has had several releases over the years before Rich made it open source. The main versions are a 2.x release and a later 3.x release that has more function. I've done a fair amount of work on the 3.x release and made my own version of it, currently at 3.20. My github page details both hardware and software for a running system here:
https://github.com/floobydust/CO2-Pocket-SBC-2.5
Last, here's a link to some info about FLEX:
viewtopic.php?f=2&t=6085&hilit=flex
Good luck and have fun!
Dietrich's CPM-65:
https://github.com/Dietrich-L/CPM-65
David Given's CPM65:
https://github.com/davidgiven/cpm65
Rich Leary's DOS/65:
http://retro.hansotten.nl/6502-sbc/dos-65/
Fuzix:
https://github.com/EtchedPixels/FUZIX
Note that DOS/65 has had several releases over the years before Rich made it open source. The main versions are a 2.x release and a later 3.x release that has more function. I've done a fair amount of work on the 3.x release and made my own version of it, currently at 3.20. My github page details both hardware and software for a running system here:
https://github.com/floobydust/CO2-Pocket-SBC-2.5
Last, here's a link to some info about FLEX:
viewtopic.php?f=2&t=6085&hilit=flex
Good luck and have fun!
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
Re: I want to create a small OS with bare metal CLI. What sh
Hi nora23169,
Do you have a hardware platform you want to run this on (such as a Commodore 64 or Beeb or perhaps a single-board computer you built or purchased), or will you be running your small OS in a simulator? There are plenty of simulators for older machines, such as the C64, which would allow you to develop for "bare metal" on that machine even if you do not own one.
The reason I ask is that different hardware will have different ways to get input from the user and display the results of commands. You will want to start with very basic I/O, like getting a single letter from the user and printing it on the screen, so you will want to pick a platform to work with first. Once you get that working, you can start adding commands, one at a time.
If you are going to use a simulator, I recommend you play around with the simulator to get used to how it operates. You should be able to load a program and run it, and you will want to check out the features that let you look at memory locations and step through the code one instruction at a time.
-SamCoVT
Do you have a hardware platform you want to run this on (such as a Commodore 64 or Beeb or perhaps a single-board computer you built or purchased), or will you be running your small OS in a simulator? There are plenty of simulators for older machines, such as the C64, which would allow you to develop for "bare metal" on that machine even if you do not own one.
The reason I ask is that different hardware will have different ways to get input from the user and display the results of commands. You will want to start with very basic I/O, like getting a single letter from the user and printing it on the screen, so you will want to pick a platform to work with first. Once you get that working, you can start adding commands, one at a time.
If you are going to use a simulator, I recommend you play around with the simulator to get used to how it operates. You should be able to load a program and run it, and you will want to check out the features that let you look at memory locations and step through the code one instruction at a time.
-SamCoVT
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: I want to create a small OS with bare metal CLI. What sh
SamCoVT wrote:
If you are going to use a simulator, I recommend you play around with the simulator to get used to how it operates.
The Kowalski editor/assembler/simulator would be a good choice for this sort of thing, assuming one has a machine running Billy-ware on which to host the simulator. During simulation, one can observer the MPU “registers” in real time, single-step through instructions, get cycle counts, etc. That could be invaluable in developing the low-level grunt code of a kernel, and would be somewhat difficult to do running on a C-64 simulator.
x86? We ain't got no x86. We don't NEED no stinking x86!