Making an Operating System
Blake_be_cool
Veteran

Joined: 6 May 2008
Age: 29
Gender: Male
Posts: 860
Location: Australia, NSW, Sydney
Hi every. Names Blake..
I'm a new guy to programming and all and I've always wanted to make my own operating system..
The first thing that goes to your mind is "The guy is crazy!". Well... Can't argue with that, but even though I am far from close to making an Operating System. I wanted to post this up for people who have more experience for tips, advise and all. Or maybe some one that has even tried them selves to make one.
I know I have no idea with this kind of stuff and I 100% do not understand the gravity of such a program but for the future far from now, It would be good to know what will be ahead.
_________________
"Not everything that steps out of line, and thus 'abnormal', must necessarily be 'inferior'."
- Hans Asperger (1938)
I'm more of a hardware guy please
forgive me not able to answer accurate.
I'd like to see an OS that is unix based,
won't cause me to have a seizure like windows
does because bluescreens make me seize and/or
meltdown.
and run any app made for whatever os,
it cood run its own of course, but also
unix mac and windows apps.
that wood be qule
_________________
A Boy And His Cat
When society stops expecting
too much from me, I will
stop disappointing them.
ValMikeSmith
Veteran

Joined: 18 May 2008
Age: 55
Gender: Male
Posts: 977
Location: Stranger in a strange land
POLL ANSWER none of the above (DEPENDS)
I've made 3.
In 1985 I made a KarateDOS
In 1988 I wrote an OS as a college entry essay, because for some reason
English teachers were always trying to flunk me. It was for an old Motorola
processor that they don't make anymore now.
In 1998 I wrote an internet access computer OS and built one computer
inside a keyboard, and another was about the size of a Palm Pilot and
was to be wireless (but not standard Wifi, which probably didn't exist then).
My reason for doing this was to demonstrate what a waste of power and
memory and time and money Windows 98 was going to be.
My computer's OS made its own video and sound so no weird cards were
needed. I never understood why PCs need video cards. No other kind of
computer ever had them.
The OS was programmed in Assembly Language and the Internet Access
Computer worked with only 64K or 128K (Just like Classic Mac).
It had color graphics but I think only 5 or 8 colors could be used at a time.
(I don't think there were very many pictures on the web then.)
It said YOU GOT MAIL the way AOL did at the time.
It accessed the internet using a dialup modem.
14400 baud was fast then. You don't realize how much of the data on
the internet is useless garbage slowing it down now.
It could be programmed in BASIC to do almost anything, but that is
the only way to get software. Software could be written in BASIC in
a few hours though.
The font had puzzle pieces for making "windows". Those were unnecessary
because it could be done just by programming the graphics to draw squares,
but it would sometimes be easier to use the font to make the windows.
Notice that I said my OS was incompatible with other OS and I needed to
write all the software for it.
These days, if you want to write your own OS, start with a Linux kernel,
and make it compatible with Linux.
Software that would be very hard to write would include:
-BROWSER (try to be compatible with an existing browser)
-MEDIA PLAYER (the formats of compression are very very complicated,
especially MPEG codecs)
-USB and TCP/IP drivers are a huge pain in the butt for no good reason.
If your hardware is PC, most of the driver work is already done in the BIOS.
I don't understand why Windows ever needs drivers, especially with printers.
Any printer works with the BIOS printer drivers.
Obviously the BIOS drives the video card or you wouldn't see anything
before the computer booted.
Your OS work is mostly done already in the BIOS.
It doesn't take a bit over 64K to write a fake Windows. (It won't
run any Windows software though, but whatever you write will
run faster than light.) Since it's impossible to write your own
better Windows (from scratch by yourself) you might as well
borrow WINE for your Linux clone.
I find the x86 processors most annoying,
and that C stands for Carpal Tunnel Syndrome.
Assembler is easier EXCEPT on PCs.
PCs are weird in lots of ridiculous ways.
PC keyboards make weird bunches of numbers when you push the keys,
unlike good old fashioned ASCII or the international equivalent. But the BIOS
keyboard driver translates that nonsense.
I sure hope the BIOS handles FAT disk format these days, since that is
the current standard on the PC and DOS is obsolete. Otherwise you
have to study the FAT format and write a filesystem driver. But once
you have that, BIOS should be able to read all kinds of media including
Hard drives and CDs and DVDs and USB and even boot from the network, I guess.
Knowing all that BIOS does, I really wonder what is hogging up megabytes
in Windows. Linux is also starting to get fatter than I think it should be, so
I don't know how small it can be. I guess the smallest Linux is somewhere
between 2 and 50 megabytes. PC DOS 6.22 was somewhere around 2 to 6
megabytes, PC DOS 3.3 I think was under 360 Kilobytes since that was
the size of the floppy it came on. I'm going to say that most C programmers
are idiots and wasting a lot of memory and killing their fingers, or the C
compilers really are awful. So I'll blame even megabytes of Linux on
crappy code. I have an old Palm Pilot with only 2 megabytes that I never
filled up, and the thing has a GUI interface, which doesn't need more than
360 Kilobytes (because I have 360K of C source code for a pretty good
"Windows-like" GUI... and I never compiled it but I'm sure it probably fits
in less than 64K after being compiled).
I said USB was annoying before, but since the BIOS already does it, it
probably is really good for making your PC OS because it is the current
standard for connecting things.
CD burning is not in BIOS. But the Linux drivers for it are pretty good.
The Windows drivers are awful as hell. I remember it being very typical
at least before 2005 that the burning software was only 50% reliable
(every other CD burned so wrong you could see where the laser skipped)
and always nagging to be updated until it decided to beg for money.
Linux was such a relief. I still use the CD burner program from
Knoppix 3.3 Linux and it just works with no screwed up CDs and no
nagging. I think some of the drivers are cdrecord, mkisofs... a few others.
Remember I said fiddle with WINE to still run Windows software; don't ask me
how, that's just what's used.
You can much more easily write an operating system for anything else
but a PC, and since there is very little out there but PCs, I would suggest
the Parallax Propeller, which has 8 cores but is very easy to program to
do things that Windows never could do and still can't, which is everything
I did on computers that were made before the PC and yet remained better
than the PC for most of the 1980s, for example, the APPLE II was a mature
PC throughout the 1980s and it took the PC all that time to catch up.
I have not heard of any chip thats 8 cores and 32 bits and if you have
electronic tools can get it running one or two monitors at the same
time (different graphics) within a day for only $8 except the Propeller.
Each core is capable of running its own monitor, so you could have
8 monitors on this chip. The compiler+assembler for the Propeller
is free to download and comes with plenty of free software that
people have written for it, including a DOS, and a Z-80 emulator
running CP/M (a 1970s DOS). There are keyboard and mouse drivers
and all kinds of monitor drivers. Propeller can be, but was not designed
to be, a computer processor. But for some reason they gave each
core minimal video capability, and people added software to that,
and the results look like all kinds of computers and game consoles.
What can the propeller do that Windows can't?
-Run on batteries
-not get hot and need fans
-actually operate tools and do some productive work without all the mouse-jerking,
make stuff you can sell, whatever you can program it to,
and whatever you can do with LEGO/knex/Erectorset/Fischerteknik/CNC/etc.
-Transmit video to a TV channel (like some game consoles do)
-Be programmed to receive radio waves
-Someone made it draw spirographs on an etch-a-sketch
-Be connected to various sensors, someone made a GPS.
-I think I will program one to squirt my cat if it "goes" outside the litter box,
using a camera to see the cat, now how can you do that with a PC?
-connect up to 8 different screens (TVs or VGA or other types) no videocard
-make music and graphics with no additional hardware except amplified
speakers and almost any kind of display.
-SING SONGS WITH 4 SINGING VOICES AT THE SAME TIME
-Synthesize Music without a sound card.
-The 8 cores each run whatever program you put in them,
so if you aren't running 8 screens or singing 8 songs you might not need
to use them all.
-Run all my old code from the early 1980s that is impossible for Windows
-Run my 3D projector that works in DOS but is incompatible with Windows
-Be a webserver, and easily make interactive websites
-Drive a remote controlled toy car
-Be the brain of a sexy female Android
-Be HAL from 2001 Space Odyssey (I wrote that program for it)
-Easily be programmed to play video games
(complete game console kit for $200 but you can build your own
using the chip and spare parts from old PCs and Nintendo joysticks)
This chip doesn't need an OS, but if you want to make lots of software
and hook up a flash drive to it, then you can make any OS you feel like
or just use one of the DOS for it, PropDOS is FAT so you can use the
same media in PC and Propeller. When I say make whatever you feel
like, I am thinking, how about the GUIs on alien spaceships in Sci-Fi?
It can look like Windows if you want, but I think it is a waste of effort,
although I did write a fake Windows that BSoDs constantly as
a joke. I wonder if WindowsRG still comes up if you google it. That
was a funny fake windows made in Flash.
I got tired and can't think of any more ideas.
If you like Parallax.com Propeller platform, and haven't soldered any
electronics before, the Hydra Propeller Game Console for $200
is all you need for a quick start. I hope that if you are interested
in the easiest way of making a computer from scratch that you
will be able to make more with the very inexpensive chip later
on if you want to.
The first time I built a computer from scratch it was a processor
and a memory chip and some switches and lights that were
flipped as binary numbers to program it.
I'm curious what different kind of OS you might have in mind,
because you might actually be able to write something
totally new and different and better and faster than Linux
and everything is faster than windows.
edit:
Attempting to program an OS from scratch on a PC is definitely
a challenge these days. Windows will probably BSoD a lot if you
try. You'll need to learn C or Assembly which are hard on the PC.
Lots of books to read. If you can do it you are very intelligent.
Imitating Linux is easier, but I think there is currently nothing
easier to program than Parallax Propeller. There is nothing easier
than that to make a computer from scratch with these days either.
Also, videogame programming is a complex but rewarding way to
program and there is currently no easier platform. Videogame programmers
are more likely to be able to write anything else, than any other kind
of programmer can write a game... There is way too much art and music
and imagination in games and way too little in business programs.
I suggest a test for yourself. If you have Windows, go to Paint, and
imagine how your OS will work and look, and draw the OS screen in Paint,
assuming its a GUI OS. Do that for a while, and change things until it
looks great, like exactly how your OS should look. I am not certain,
but I think that you need to be able to draw your OS screen if you have
any ability to program it. That exercise is something game programmers
probably do a lot, and if you can't draw a Graphical User Interface (if
that's the kind of OS you want) then you probably can't program a
computer to draw it either. I assume you had an idea of what it would
look like, and what it would do, and just didn't wonder what would happen
if you just wrote an OS. If you have a better drawing program than Paint,
use that. Choose the colors. If you are imagining something new and different,
and it isn't GUI, you can make some kind of plan instead of paint, as long as
it matches what you expect to make of an OS.
Last edited by ValMikeSmith on 02 Mar 2010, 8:53 am, edited 1 time in total.
This is one of my special interests. Task scheduling (how things multi-task) is what I'm really interested in.
I'm working on an operating system for an old 8-bit computer, the Commodore 64. That is much simpler to work on because the hardware underneath is much easier to understand than modern PC computers.
I also took a course in college. There we had a kind of simplified virtual machine specifically designed for the class to write the OS for. I learned alot in that class.
There are a few books on the topic. Andrew Tanenbaum (Minix) and Richard Burgess (MMURTL) I thought were good. MMURTL hasn't been updated to run on modern computers. but it works fine on mid 1990 era PC computers.
There are also some open source operating systems out there. It might be fun to poke around and look at the source code, make some changes here and there and see what happens.
If you want to learn the basics of writing your own OS without having to manually type every little bit of code, you can try the Linux From Scratch programme. It gives you all the basics of the kernel, but allows you to fully customise all the built in modules. So maybe not exactly what you're looking for, but if you've never done an OS before, it'd be an excellent jumping point.
The hardest part about an OS is a GUI. Getting the parts to play along and do things is quite simple now, but making it so the user can see what those parts are doing, that's where you get into the sticky part. Also, a pretty GUI is the largest resource hog on a computer, easily taking up 90% of the processor usage all by itself. That's why a lot of the computers you see that are doing something intensive, they are often command line. It frees up resources. So if you're working on something older with limited ram/proc/HDspace, drop the GUI element.
If you're more interested in the theory behind writing an OS, look into the source code of something like Linux. You can see why it's doing what it's doing, how it is going about it, and even possibly some ways you could make it better. But try not to go into it with an idea of what current OS it should be like. The best ones are nothing like what's out there, usually because if you've hit the point of wanting to write your own, it's because nothing else suits your needs.
_________________
Every time you think you've made it idiot proof, someone comes along and invents a better idiot.
?the end of our exploring, will be to arrive where we started, and know the place for the first time. - T.S. Eliot
LordoftheMonkeys
Veteran

Joined: 15 Aug 2009
Age: 36
Gender: Male
Posts: 927
Location: A deep,dark hole in the ground
Do you want to make your own operating system by yourself? That would be nearly impossible. Most operating systems are written by thousands, even tens of thousands of people. For one thing, you need a thorough knowledge of the underlying hardware, and if you want your OS to be portable, this means you need a thorough knowledge of every hardware platform you would want to port it to. Then there's dynamic memory management, coherency and synchronization, paging and queuing, process management, interrupt handling, security, the user interface, and drivers for every single device on the computer.
If programming in Java or C++ seems easy, it's because the operating system does pretty much everything for you. If there is no operating system to work on, things will be a lot harder. If you think programming in Java or C++ is difficult, forget it.
I'd think that in fact, most operating systems were the brainchild of one or two individuals. After all, the basic routines that handle interrupts, queue requests and allocate memory aren't at root, terribly complex. Testing the buggers can be a nightmare, especially once you factor in the eighteen million combinations of hardware and software they'll be faced with in the wild, but a lot of that can be left to the customers to learn for themselves.
It depends on the scope of what he considers an OS. If he just wants a command line shell like DOS, one person can probably do that in a couple of months if they have prior knowledge and stands a little on the shoulders of those who came before them. If he wants to add a protected mode memory manager, add another few weeks/couple months. If he wants a process/thread scheduler, add some months. If he wants to add a desktop windowing environment, add a few months for something very basic. All of this assumes a pretty talented programmer.
Depends. From scratch pretty much impossible or very very hard if you want a good for the market. (not as a hobby)
You can piece together a unix like os pretty easy. You get all the software from GNU. And for a kernel you can use linux or bsd or even gnu/hurd. The work's already done for you though all your doing is putting together the pieces.
Similar Topics | |
---|---|
An Interstellar Object Like Oumuamua Enters Our Solar System |
04 Jul 2025, 7:02 am |
Making Friends |
10 May 2025, 6:26 pm |
Making up for lost time |
27 Jun 2025, 1:14 am |
Short Film Making |
12 Jun 2025, 5:20 pm |