OS Development Log

Jan 16, 2016 at 4:57 PM
Part-Time Perfectionist
Pixel Cut-Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location:
Posts: 1615
Age: 123
This is a simple log of my thoughts, feelings and experiences while learning to code and coding an operating system.
Just remember that...
Some twat said:
Once an idiot, always an idiot

1 AM:
Wow, OK I'm definitely jumping the gun a bit here, over the course of 4 days I've gone from learning to program in Zeno, to C, straight to Assembly.
My previous history with Assembly is -- put simply -- traumatic, I tried to learn the language for the sake of hacking Dokutsu.exe

1 hour later:
Tada, pure shit! I have created possibly the worst fucking .com files the world has ever seen! But it's a step, if that of a child. (Although legally I am a child, so... Shit.)

After some sleep:
I thought I was going to go mad getting debug to acutally write the program I made to a .com file last night, it was working so fine until a point, but then it just started printing random ASCII characters.
Wanna know why? I told it to write the file as "HELLO6.asm" instead of "HELLO6.com"
Bauls.

A few hours later:
OK so I've been trying to make my basic addition/subtraction calculator work for some time now, it can only give results from 1-9 because of how it's coded. But I just want to prove I can make something of any worth with this programming language, which, so far, has only allowed me to make things I've been told how to do, unlike C where I can usually make about 10 new things with every command I learn.
The good thing is that I'm crazy, and crazy people can do much more than those with sanity... Whoops -- I just accidentally save d the page's HTML file to my computer, lemme delete it.

1 hour later:
OK I give up, I'll do that later when I can make it better by allowing it to calculate a wider variety of numbers.
I think that might be it for the day, perhaps I might do some later when the new day rolls around.
Wow, yesterday felt really long.
I haven't gotten any sleep since I woke up yesterday afternoon, or much progress really.
Now... Before you call me out on not learning anything in TWO DAYS let me give a disclaimer that it's 1:06 AM, and yesterday I didn't really learn much from the tutorials I watched.
That out of the way: I'm finally using a proper god-damn assembler, not the inbuilt debug function in Windows XP.
Anyway: my next tutorial in Assembly is called "Creating Your First Operating System (OS)," it sounds kind-of promising, but that's probably because I've been waiting to watch this video for 4 days now.

Later:
Wow everybody, I think I'm well on my way to creating a perfect Operating System:
Zscreen01.png
Yeah, I know, I've outdone myself.
I have accomplished the hardest task ever ...
Get an operating system that prints the number 7 and then freezes indefinitely because of a jmp $ command.

On a serious note; I am quite excited that I actually coded something that could (in theory) boot. I.e. I could start my pc with a floppy disk and have it display the number 7 forever.
Now the name; I've called it Zillion, why? Well, long story slightly less long... When someone I knew got a new horse they we're trying to think of new names and I said they we're the colour of a Brazil Nut, and that could somehow be incorporated into the name. Guess how I came up with Zillion from that? Zillion is a shortening of Bazillion... Yep.

What next? No fucking idea.

After some sleep:
How the fuck does anybody even learn Assembly? I haven't been able to find a half decent tutorial.
It's been a while since I've made any updates here.
Learning C is going smoothly, I gave up on Assembly.

I am beginning to plan the OS out more; not the OS itself, rather the business, the website, etc.
Here's a blog for the development: http://zillionproject.blogspot.com.au/, it will remain empty of posts until Zillion's actual development kicks off.
 
Last edited:
Jan 16, 2016 at 5:02 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I mean, if you're into it then great, but why an operating system
 
Jan 16, 2016 at 5:34 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
well, have fun I guess
 
Jan 16, 2016 at 5:56 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Aug 15, 2015
Location: 0xDEADBEEF
Posts: 111
I have no fucking idea, I just wanna make one...
It's going to be a heck of a lot of work. It's more than just knowing C++ and Assembly. (You need to know C, not C++) You need to know the computer at a /very/ low level. Which board, hardware, and architecture? 32 bit or 64 bit? How will you map the memory? How will you manage the memory? Memory allocation algorithms? How will the scheduler work? Processes and/or threads, and priority? How to do interprocess communication? Mailboxes, synchronous vs asynchronous? How will you handle interrupts? How to hande kernal vs user mode? What of things like keyboard process, monitor output, and timing? How to even load user processes and run them? Implementing debug hotkeys to see the memory and see what goofed up? (Raw data, no fancy "Here's the error in your code right here!", think BSoD) What about basic system features, such as user logins, command prompt, web browser (Very hard, read about it and you'll see that massive companies spent years and millions designing even working browsers like Chromium and Firefox; even then, they reuse old code, over years, Microsoft's Windows included), installer/uninstaller, basic text file reading, basic image viewing, networking, file manager and files and folders, disk defrag, keyboard shortcuts and context menu, taskbar, drivers, graphic drivers (Read about how OpenGL works), designing your own programming language and compiler so that you can program stuff easier (Which itself is already an ultra massive undertaking, with so much design theory; the first compiler took a few decades with a large group of people, most modern compilers today hitchhike off of C or C++ {Which your OS won't have the leisure of using}, which are incredibly complex and require serious skill to htilize to their fullest extent of strength).

Either way, it's your decision.
I would recommend trying to do something else first, like make a browser or a programming language, IDE, and compiler. And definitely make a massive design guidelines first above all.
Have fun! ^_^
 
Last edited:
Jan 16, 2016 at 6:07 PM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
I would recommend trying to do something else first, like make a browser or a programming language, IDE, and compiler.

"Oh you learned how to swim 4 days ago and now you want to cross the Pacific Ocean by swimming? I would recommend you start with the Arabian Sea or the Indian Ocean first"
 
Jan 16, 2016 at 6:19 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Aug 15, 2015
Location: 0xDEADBEEF
Posts: 111
"Oh you learned how to swim 4 days ago and now you want to cross the Pacific Ocean by swimming? I would recommend you start with the Arabian Sea or the Indian Ocean first"
Web browsers is just about interpreting HTML efficiently and correctly.
And compilers is simply interpreting your custom language into Assembly.
While neither are easier tasks (In a gist), they are child's play to an OS.
Of course there are lower steps that can be taken, I just didn't cover them.
 
Jan 16, 2016 at 11:28 PM
Senior Member
"Huzzah!"
Join Date: Aug 24, 2013
Location: 0xDEADBEEF
Posts: 211
It's going to be a heck of a lot of work. It's more than just knowing C++ and Assembly. (You need to know C, not C++) You need to know the computer at a /very/ low level. Which board, hardware, and architecture? 32 bit or 64 bit? How will you map the memory? How will you manage the memory? Memory allocation algorithms? How will the scheduler work? Processes and/or threads, and priority? How to do interprocess communication? Mailboxes, synchronous vs asynchronous? How will you handle interrupts? How to hande kernal vs user mode? What of things like keyboard process, monitor output, and timing? How to even load user processes and run them? Implementing debug hotkeys to see the memory and see what goofed up? (Raw data, no fancy "Here's the error in your code right here!", think BSoD) What about basic system features, such as user logins, command prompt, web browser (Very hard, read about it and you'll see that massive companies spent years and millions designing even working browsers like Chromium and Firefox; even then, they reuse old code, over years, Microsoft's Windows included), installer/uninstaller, basic text file reading, basic image viewing, networking, file manager and files and folders, disk defrag, keyboard shortcuts and context menu, taskbar, drivers, graphic drivers (Read about how OpenGL works), designing your own programming language and compiler so that you can program stuff easier (Which itself is already an ultra massive undertaking, with so much design theory; the first compiler took a few decades with a large group of people, most modern compilers today hitchhike off of C or C++ {Which your OS won't have the leisure of using}, which are incredibly complex and require serious skill to htilize to their fullest extent of strength).

Not necessarily for all this - at the bare minimum an operating system has a way to use some of the basic functions of a computer, which basically just means being able to run a program on the CPU. My dad programmed one, along with its programs, entirely in Assembly in college. It ran a few very basic programs, but still of course qualified. The only thing it really needs to be an OS is executing instructions on the CPU and executing programs, which could be as simple as printing "hello, world!" (which is still complicated on some level, but not like a full-fledged program). It could be completely autonomous and always do the same thing when you run it.

I've never programmed a line of C++.

Use it - it's great.
 
Jan 16, 2016 at 11:50 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I think the general consensus on C++ is actually that it's hell
 
Jan 17, 2016 at 2:10 AM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
Web browsers is just about interpreting HTML efficiently and correctly.
And compilers is simply interpreting your custom language into Assembly.
While neither are easier tasks (In a gist), they are child's play to an OS.
Of course there are lower steps that can be taken, I just didn't cover them.

way to oversimplify
keep in mind the dude literally began learning how to code four days ago

EDIT: and also that we're talking about fuckin assembly right here

Use it - it's great.

why do people with no programming knowledge keep giving advice on programming to people with even less programming knowledge
and then we lament the existence and omnipresence of pieces of shit like javascript, c++, php or the jvm
 
Jan 17, 2016 at 3:05 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Aug 15, 2015
Location: 0xDEADBEEF
Posts: 111
way to oversimplify
To be frank, it's irrelevent whether it was or wasn't oversimplified. It's still extremely hard.

keep in mind the dude literally began learning how to code four days ago
I must've missed where that was mentioned. With that in mind, he should learn the logicality of programming first before doing things of grand proportion.

EDIT: and also that we're talking about fuckin assembly right here
I realize that, it's still not a good idea to start with at first with little programming knowledge.
 
Jan 17, 2016 at 4:30 PM
Senior Member
"Huzzah!"
Join Date: Aug 24, 2013
Location: 0xDEADBEEF
Posts: 211
How's that complicated?
Code:
printf("Hello, world!");
Code:
a 100
mov ah, 09
mov dx, 200
int 21
mov ah, 08
int 21
int 20

a 200
db 'Hello, world!$'
Maybe in binary it's complicated?

I said "one some level" because while it's very easy to do in C, depending on how low-level you go it can get complex. I guess it's easier in ASM than I thought. but it's still more complex than a printf() call.
 
Jan 17, 2016 at 7:58 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
what's that even supposed to mean
it was too easy so you didnt like it?
 
Jan 17, 2016 at 8:40 PM
Junior Member
"It's dangerous to go alone!"
Join Date: May 26, 2014
Location: on the Internet
Posts: 43
I wish you best of luck, zxin
I see you are taking the masochistic approach to learning, as I often do: "Work on something you want done without prior knowledge, learn along the way. Hammer it till it works."
Be careful that you don't pick a task waaaaay over your budget. You might bite off more than you can chew.

I don't see an OS being a feasible task for your skillset.
Then again, I've been told by someone that I am not going to manage porting C to ActionScript 3 and that it's never going to bloody work.
And you know what, he was wrong. In 6 months, I successfully got my first port. This without prior learning required for what I am getting myself into.
Any C -> AS3 porting project done after this took a fraction of that time. I had learned along the way.

Now, returning to your desire to write an OS.
The code I ported that took me 6 months was circa 3000 lines of code. The code was mostly self-contained(little external dependencies besides a bunch of Math calls and file reading).
I strongly expect your OS writing attempt to highly exceed complexity of that which took me 6 months.
Amount of code, dependencies, work done understanding(I worked on code that was already written, so I got off easy).
You are setting yourself up for complex and potentially unforgiving task.

Beware.
 
Last edited:
Jan 17, 2016 at 9:55 PM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
To be frank, it's irrelevent whether it was or wasn't oversimplified. It's still extremely hard.

I must've missed where that was mentioned. With that in mind, he should learn the logicality of programming first before doing things of grand proportion.

I realize that, it's still not a good idea to start with at first with little programming knowledge.

I'm glad you've come to agree with me.

Woah, calm down, I've been coding for a little more than four days, I've worked with Java a bit in the past -- found it was a pain in the ass -- and I've done some pretty basic HTML & CSS stuff.

So not really then.

Sound like I've tired a ton of different programming languages? Yes, I have, in search of one I don't hate -- which is C by the way, C is the best, and honestly Assembly is just about as good. I like low-level programming, I guess...

My history coding:
HTML+CSS: Don't mind it, don't care much.
JavaScript: Don't care either, not my thing.
Java: Confusing, not that fun.
Qbasic: Meh. Too high level to do anything interesting.
Zeno: I dunno, I learned a lot learning it but it's not good for much else.
C: When can I marry you?
Assembly: Not bad, impressive even.

You think you've tried a lot of different programming languages, but you really haven't.
- HTML and CSS are not programming languages. They are presentation languages (a markup language and a style sheet language, respectively).
- Javascript is a very badly designed, untyped, object-prototype-oriented procedural and imperative language.
- Java is a badly designed, statically-typed, object-class-oriented procedural and imperative language.
- QBasic is an old, badly designed, statically-typed procedural and imperative language for educational purposes.
- Zeno is an old, statically-typed procedural and imperative language for educational purposes.
- C is an old, statically-typed procedural and imperative language.
- Assembly is not a programming language but an instruction set, but that's a detail. It's a very old, untyped procedural and imperative instruction set.

As you can probably see, there are a lot of oft-recurring words in this list (like "old", but mostly "procedural" and "imperative"). What I'm saying is you've tried a lot of the same stuff. And bad versions of it, at that.

A wise man once said that, in order to have a good general idea of programming, one had to learn and master at least six different paradigms:
- a low-level language (C)
- an object-class language (Java)
- a reflective language (Ruby)
- a statically-typed functional language (Haskell)
- an assembly language
- a stack language (Forth)

I will assume that you have never actually used Java's object-class paradigm, which means you pass two of those items.
On top of those six items, we could add:
- logical languages (Prolog)
- languages based on relational algebra (SQL)
- dynamically-typed functional languages (Lisp)
- actor-model-based languages (Scala)
- concurrent languages (Erlang)
- dependently-typed languages (Agda)
- proof assistant languages (Coq)
- and many more.

Your thinking that C is the best language and that Java is too complicated (which it is, but not for the reasons you're thinking of) shows that you still lack perspective over the discipline. If you wish to find a language that you'd like, I'd recommend that you keep searching, that you document yourself on the characteristics of languages, and that you persevere in the use of new programming languages, at least for a few days or weeks. It will be infinitely more productive than trying out a language for three hours, deciding it's not worth it, and then proceeding to start out a gargantuan project in a language you barely know.

How's that complicated?

If you need nine lines to print a string, it's complicated. The low-levelness of assembly makes tasks (that would otherwise be incredibly trivial with a high-level programming language) extremely difficult and sometimes borderline impossible. Making anything relevant (like, I don't know, a language (which is not brainfuck) interpreter, a web browser, or a fucking operating system) in an assembly language can take years for well-experienced people. You seem to be adamant on using low-level languages, which is fine, but you should learn more language theory and high-level practises, and most of all, learn how to determine the scope of a project before getting started.
Then again, as I was saying elsewhere, as long as you are perfectly aware that you have absolutely no chance to build anything even remotely consistent before a long long time, then you can try writing an OS now. You will (have to) learn a lot of things, which is always good.

TL;DR: You're still a newbie. You have to learn before you make anything relevant. I'm not saying you're going to fail making an OS, I'm saying that if your ultimate goal is not to build an OS but to just learn stuff, you're going to give up. There are, thankfully, better ways to learn.
 
Top