User Tools

Site Tools


start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start [2017/03/02 19:57]
admin
start [2017/03/30 08:56] (current)
admin
Line 1: Line 1:
 =====In the beginning...===== =====In the beginning...=====
- 
 So, I got the idea to write a kernel. You know... Just to see if I could do it. So, I got the idea to write a kernel. You know... Just to see if I could do it.
 Like me, you may have started reading stuff on the Internet to see what to do and what to learn and so on and so forth. I found lots of stuff to learn and to set up. Like me, you may have started reading stuff on the Internet to see what to do and what to learn and so on and so forth. I found lots of stuff to learn and to set up.
-Sifting through the myriad of ways to do it, this is how I progress through it. You may find many answers to your own roadblocks here.+Sifting through the myriad of ways to do it, this is how I progress through it. You may find some answers to your own roadblocks ​[[Progress|here]].
  
-====What I knew from the start==== +====Before you can begin==== 
-I do know how [[real mode]] ​works (and why).\\ +There will be things you need to know, and things you need to understand, and things you must be able to do, and so on.\\ 
-I've done a lot of C++ programming on Windows.\\ +\\ 
-I've done exstensive C programming for microcontrollers.\\ +__Things you must understand__:​\\ 
-I've done a lot of assembler for other architectures than x86.+[[Real mode]]\\ 
 +- Programming\\ 
 +- Computer hardware\\ 
 +\\ 
 +__Things you must be able to do__:\\ 
 +- Find information\\ 
 +- Have patience\\ 
 +- Learn\\ 
 +\\ 
 +__Things you must have__:\\ 
 +- Coffee\\ 
 +- Punching bag\\ 
 +- Beer\\ 
 +(usually in that order)
  
 ====Where to start==== ====Where to start====
Line 16: Line 28:
 ====When can you start==== ====When can you start====
 You need assembler basics and an understanding of what the x86 does to it. Also, an understanding of [[x86 memory aliasing]] will help in debugging.\\ You need assembler basics and an understanding of what the x86 does to it. Also, an understanding of [[x86 memory aliasing]] will help in debugging.\\
-The big issue is that you need build tool that does not consider [[user space]]. We're writing kernel, after all. User space is based on the kernel.+The big issue is that you need build tools that does not consider [[user space]]. We're writing kernel, after all. User space is based on the kernel ​- which you will have to create as well. 
 + 
 +====First code==== 
 +The Netwide Assembler ([[http://​www.nasm.us/​|NASM]]) will take you far in the beginning. It will create raw binary x86 code regardless of user space.\\ 
 +You can think of [[kernel]] as the code that talks to the hardware, and [[user space]] as the code that talks to the kernel.\\ 
 +At this point in the process, user space hasn't been created yet. We're in "​[[real mode]]",​ and no [[user space]] exists. 
 + 
 +=====Boot loader===== 
 +Many instructional articles on the net will assume existing boot loaders. That means adhering to conventions and so on. You don't need to. Learn by yourself.\\ 
 +If you strip it all down to the absolutely bare minimum, an x86 computer will - upon power-up - run through its BIOS (**B**asic **I**nput **O**utput **S**ystem) sequence. When BIOS is done it will give control to your code. From there it's all up to you.\\ 
 +You will see (on the Internet) many references to multiboot and partitions. The ugly truth is that you don't //need// any of that. Make your own.\\ 
 +When the BIOS is done, it will load the first sector of the boot drive and execute the code it just loaded. That's really all there is to it. From there, you decide what happens.\\ 
 +This means that when your code starts, you have 512 bytes of code loaded at address ''​0000:​7C00''​. From there, it's all your design. No multiboot. No drive partitions. No files. Nothing.\\ 
 +\\ 
 +Be creative. Make it better. 
 + 
 +=====My Vision===== 
 +I want to make everything from scratch. I will go as far as discarding the partitioning scheme in use today. Creating a system with no regard to existing systems.\\ 
 +\\ 
 +It will all be new. Now - I don't have any grandeur visions about being able to write better code than everyone else, but I do think that if you do not root yourself in previous thoughts, you will be able to create new paradigms - possibly redesigning how we view certain aspects of "​common knowledge"​.\\ 
 +After all - todays CPus are just souped up versions of what was created in the late 60's. Other schemes have been made, better ones, more efficient ones, but ... money talks.\\ 
 +\\ 
 +Think new. Be creative. Do better. Make a change. We sorely need it. 
 + 
 +=====Some code===== 
 +[[My makefile]]\\ 
 +[[My MBR]]\\ 
 +[[My loader]]
  
-====NASM==== +=====A note on bootstrapping===== 
-The assembler NASM will take you far in the beginningIt will create raw binary x86 code regardless of user space.\\ +You will see this mentioned "​everywhere",​ but almost never explainedwill explain it here.\\ 
-You can think of "​kernel"​ as the code that talks to the hardware, and the "user space" as the code that talks to the kernel.\\ +Bootstrapping is the act of lifting yourself up by pulling your shoelaces.\\ 
-At this point in the process, user space hasn't been created yet. We're in "​[[real mode]]"​.+What that means in a computer is that a system is capable of starting up on its own volition and sustaining itself.\\
start.1488484655.txt.gz · Last modified: 2017/03/02 19:57 by admin