Page 1 of 1
Where to start to write OS?
Posted: Tue Dec 13, 2016 6:15 am
by NewOSdever
Hi,my name is Nikita! I'm new. Where to start to write OS on C and assembler.?
Re: Where to start to write OS?
Posted: Tue Dec 13, 2016 6:26 am
by NunoLava1998
Nikitka555 wrote:Hi,my name is Nikita! I'm new. Where to start to write OS on C and assembler.?
Welcome to OSDev!
You should start on Bare Bones. If you're running Windows and don't feel like making a cross-compiler, use ghost-i686-elf-tools, which works.
Though, you will need some dll's for that.
The zip is too large (600 KB), so i'll upload it on mediafire:
http://www.mediafire.com/file/a5k9nzkb4 ... ll%27s.zip
Re: Where to start to write OS?
Posted: Tue Dec 13, 2016 8:00 am
by Solar
I would start
with the Wiki. No, seriously. That's what it is there for.
Re: Where to start to write OS?
Posted: Tue Dec 13, 2016 9:22 am
by SpyderTL
Specifically, I would start by setting up a virtual machine, like VirtualBox.
Then, if you are going to be coding in assembler, I would download NASM, and try to create an OS that simply displays text to the screen when you boot it up in your virtual machine.
If you can get that far, then everything else is just adding more features.
Good luck. Let us know how it goes.
Re: Where to start to write OS?
Posted: Tue Dec 13, 2016 10:23 am
by osdever
He's going to write OS in C. I know him and real cause he went there is to get help with setting up cross-compiler on Windows. By the way I don't believe that his project will get more advanced than just a toy
Re: Where to start to write OS?
Posted: Wed Dec 14, 2016 2:00 am
by Solar
Given that his next post was to ask "how to write a 'hello world' in C", I implore you, talk him out of OSDev. This is really not the place to start learning your first programming language. That is just setting up for failure and frustration -- not only his frustration, I might add.
Programming should be learned in user space, not by writing kernel startup code.
Re: Where to start to write OS?
Posted: Wed Dec 14, 2016 5:47 am
by osdever
Solar wrote:Given that his next post was to ask "how to write a 'hello world' in C", I implore you, talk him out of OSDev. This is really not the place to start learning your first programming language. That is just setting up for failure and frustration -- not only his frustration, I might add.
Programming should be learned in user space, not by writing kernel startup code.
Yep, I thought the same when he asked his last question. I'll talk to him.
Re: Where to start to write OS?
Posted: Thu Dec 22, 2016 8:03 pm
by irvanherz
Level 1 :
Print hello world boot sector using NASM. Run it.
Level 2 :
Prepare virtual disk. Load other files from your boot sector. Do something from that file.
Level 3 :
Do simple experiment, related to protected mode; GDT, A20, IDT, etc
Level 4 :
Install bootloader, or develop your own bootloader. With protected mode support
Level 5 :
Convert your ASM to C
Re: Where to start to write OS?
Posted: Tue Jan 10, 2017 10:33 am
by andrewthompson555
Welcome to the world of OS development!
We encourage you to start OS development.
Start learning DOS assembly first. It's a great way to start! Learn Assembly and the interrupts. That's how I'm learning right now and I understand most of the code I do. YouTube will have nice tutorials. Boot DOS from a floppy or VirtualBox and use MS-DOS DEBUG. Do your research. I don't think C is really good when you're a beginner. Start learning Assembly!
Remember. Use NASM as the assembler. Don't forget that you can't use INT 21 (MS-DOS API) on your OS. You can look on Wikipedia for references. I know things look hard but don't give up. I nearly did but I didn't.
Here's something to get you started:
BITS 16
org 0x7C00
jmp start
Print:
lodsb
cmp al, 0
je Done
mov ah, 0eh
int 10h
jmp Print
Done:
ret
start:
mov si, msg
call Print
msg db 'Hello World!', 0
times 510-($-$$) db 0
dw 0xAA55
Save it as boot.asm (it doesn't have to be boot.asm, you can make it myos.asm
Then, install nasm (search it)
And do:
nasm -f bin boot.asm -o boot.img
Install VirtualBox and create a virtual machine. Then, test it.
Re: Where to start to write OS?
Posted: Tue Jan 10, 2017 1:16 pm
by glauxosdever
Hi,
andrewthompson555 wrote:Start learning DOS assembly first. It's a great way to start! Learn Assembly and the interrupts. That's how I'm learning right now and I understand most of the code I do. YouTube will have nice tutorials. Boot DOS from a floppy or VirtualBox and use MS-DOS DEBUG. Do your research. I don't think C is really good when you're a beginner. Start learning Assembly!
DOS assembly isn't really relevant. YouTube tutorials shouldn't be followed, since they can't be community-edited and tend to be made by those who don't know well. Whether C or assembly is better for a beginner, it's debatable, but let's rather not discuss it here.
andrewthompson555 wrote:Remember. Use NASM as the assembler. Don't forget that you can't use INT 21 (MS-DOS API) on your OS. You can look on Wikipedia for references. I know things look hard but don't give up. I nearly did but I didn't.
There are valid reasons to use another assembler, for example if you use GCC, then it's easier to use GAS since the OS will have less dependencies.
andrewthompson555 wrote:Here's something to get you started:
BITS 16
org 0x7C00
jmp start
Print:
lodsb
cmp al, 0
je Done
mov ah, 0eh
int 10h
jmp Print
Done:
ret
start:
mov si, msg
call Print
msg db 'Hello World!', 0
times 510-($-$$) db 0
dw 0xAA55
Save it as boot.asm (it doesn't have to be boot.asm, you can make it myos.asm
Then, install nasm (search it)
And do:
nasm -f bin boot.asm -o boot.img
Install VirtualBox and create a virtual machine. Then, test it.
I don't think you are qualified to give advice.
Regards,
glauxosdever