OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 2:34 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Where to start to write OS?
PostPosted: Tue Dec 13, 2016 6:15 am 
Offline

Joined: Tue Dec 13, 2016 6:04 am
Posts: 2
Hi,my name is Nikita! I'm new. Where to start to write OS on C and assembler.?

_________________
I am not catnikita255, do not confuse me and him.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Dec 13, 2016 6:26 am 
Offline
Member
Member

Joined: Sun Oct 09, 2016 4:38 am
Posts: 273
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

_________________
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Dec 13, 2016 8:00 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7614
Location: Germany
I would start with the Wiki. No, seriously. That's what it is there for.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Dec 13, 2016 9:22 am 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
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.

_________________
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Dec 13, 2016 10:23 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 03, 2015 9:41 am
Posts: 492
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 :(

_________________
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Wed Dec 14, 2016 2:00 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7614
Location: Germany
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.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Wed Dec 14, 2016 5:47 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 03, 2015 9:41 am
Posts: 492
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.

_________________
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Thu Dec 22, 2016 8:03 pm 
Offline
Member
Member

Joined: Mon Sep 19, 2016 5:34 am
Posts: 27
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

_________________
https://github.com/irvanherz/jaura/


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Jan 10, 2017 10:33 am 
Offline
Member
Member

Joined: Thu Oct 13, 2016 2:07 pm
Posts: 27
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.


Top
 Profile  
 
 Post subject: Re: Where to start to write OS?
PostPosted: Tue Jan 10, 2017 1:16 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], FAST WebCrawler [Crawler], Google [Bot] and 97 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group