Getting started

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
flyingdoodltartz
Member
Member
Posts: 25
Joined: Fri Jun 05, 2009 11:46 pm

Getting started

Post by flyingdoodltartz »

Hey guys, i have been in a very creative mood lately and really want to build my own os. My usual programming is making homebrew games for sony's psp (most people shoot all my projects down just cuz im only 14 (age-ist retards)), but i want to take a shot at something a bit bigger. I decided to write my own programming language (you would love it :D), but then i wanted to go even bigger than that. So here i am, I understand c++ and pointers, classes, structures, variables, blah blah blah and my fair share of assembly also. I just need to know where to start. Like how to compile the files into an .iso computer i can boot to my computer from a cd. I have a decent test machine with absolutely no os on it, and frankly it sux so horribly that no os i try will work on it (it's ancient and never came with a preinstalled os). this made me think, hey, why not write my own. Anyways, if someone could maybe point me to a nice tutorial on creating a simple hello world os or something i would love you forever. I really want to tackle this. thanks in advance.

regards,

Teddy.
"I don't take advice from freshmen in high school" - when your programming, age doesn't matter

"if you think your running fast, run faster." - track coach

"Back in my day, I had a pimped out ride." - physics teacher
User avatar
JackScott
Member
Member
Posts: 1032
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
GitHub: https://github.com/JackScottAU
Contact:

Re: Getting started

Post by JackScott »

Main Page - Our Wiki
JamesM's tutorials
Bran's tutorials

Those are your three most popular links to beginner tutorials. Our wiki, of course, is an ever-expanding treasure trove of low-level programming goodness.

Welcome, and good luck with your kernel!
flyingdoodltartz
Member
Member
Posts: 25
Joined: Fri Jun 05, 2009 11:46 pm

Re: Getting started

Post by flyingdoodltartz »

thanks, man, found the wiki xD. i feel like such an idiot for making this topic with the wiki their and all, i just never saw it before... and thanks, ill need the luck ;). already got a simple hello world os up and running :). thanks.

regards

teddy
"I don't take advice from freshmen in high school" - when your programming, age doesn't matter

"if you think your running fast, run faster." - track coach

"Back in my day, I had a pimped out ride." - physics teacher
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: Getting started

Post by skyking »

I recommend that you consider the boot method and how that fits into your development cycle and available tools. I don't say that booting from CD is a bad choice, but unless you can easily create CD images and burn CDs it's a bad choice since you will repeat that procedure many times (consequently you will want to use CD R/W discs :wink:). If you're using linux you could use mkisofs to create the iso image (which makes it possible to batch compile and generate the ISO). I think you can use the ISO image together with an emulator also so you don't have to go through the burn and reboot cycle every time you want to try your changes.

There does not seem to be any information on either CD reading or ISO format on the wiki - you have to find it elsewhere (I guess you want your OS to read from the CD after you've booted).
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Getting started

Post by computafreak »

Bochs and Virtual PC will both boot from ISO images. To generate the ISO image on Windows under Cygwin, it's possible to use genisoimage. I think Combuster has a page about reading the file system on his user page on the wiki, and this page contains the file and directory structures which can be read from the ISO image (assuming it uses the ISO 9660 file system, I think it can also use UDF, but this is backwards compatible apparently)
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: Getting started

Post by mathematician »

flyingdoodltartz wrote:thanks, man, found the wiki xD. i feel like such an idiot for making this topic with the wiki their and all, i just never saw it before... and thanks, ill need the luck ;). already got a simple hello world os up and running :). thanks.

regards

teddy
http://visopsys.org/osdev/index.html
http://www.osdever.net/
http://www.nondot.org/sabre/os/articles
http://www.acm.uiuc.edu/sigops/roll_your_own/

Your sure to need this during the early stages:
http://www.ctyme.com/rbrown.htm

Especially this bit:
http://www.ctyme.com/intr/int.htm
The continuous image of a connected set is connected.
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: Getting started

Post by alethiophile »

To make a bootable ISO, I would recommend (on Linux, I don't know how on Windows) using mkisofs on the right files, losetuping the resulting ISO file to some loop device, then dd your 512-byte bootloader to that loop device (overwrites only the first sector).
If I had an OS, there would be a link here.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Getting started

Post by xDDunce »

IIRC, mkisofs has a windows binary too. Back when I was using Window$, I was using it to make my bootable cd's. I don't have a direct link, but google is your friend.

Good luck,
and happy programming!
James.
flyingdoodltartz
Member
Member
Posts: 25
Joined: Fri Jun 05, 2009 11:46 pm

Re: Getting started

Post by flyingdoodltartz »

wow thanks guys, you really are a great help. btw, im on linux and the reason i want to do cd's is cuz im on a laptop which doesn't have a floppy drive sadly (parents didn't want to buy me a desktop). And you can dd files to a cd??? i didn't know that :D. thanks again for your help.

EDIT: and also, thanks mathematician for the interrupts table :D. there's so many o_O.
"I don't take advice from freshmen in high school" - when your programming, age doesn't matter

"if you think your running fast, run faster." - track coach

"Back in my day, I had a pimped out ride." - physics teacher
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Getting started

Post by JamesM »

flyingdoodltartz wrote:wow thanks guys, you really are a great help. btw, im on linux and the reason i want to do cd's is cuz im on a laptop which doesn't have a floppy drive sadly (parents didn't want to buy me a desktop). And you can dd files to a cd??? i didn't know that :D. thanks again for your help.

EDIT: and also, thanks mathematician for the interrupts table :D. there's so many o_O.
Best plan to start with is to use an emulator. Bochs or qemu both work very well, and of course emulate floppy drives. Just create and feed it an image.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Getting started

Post by Brynet-Inc »

flyingdoodltartz wrote:And you can dd files to a cd??? i didn't know that :D. thanks.
No.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
flyingdoodltartz
Member
Member
Posts: 25
Joined: Fri Jun 05, 2009 11:46 pm

Re: Getting started

Post by flyingdoodltartz »

awe.... oh well. sigh.
"I don't take advice from freshmen in high school" - when your programming, age doesn't matter

"if you think your running fast, run faster." - track coach

"Back in my day, I had a pimped out ride." - physics teacher
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: Getting started

Post by alethiophile »

awe.... oh well. sigh.
You can't dd directly to the device, as you can with a floppy (as far as I know). However, you can make an ISO file, containing whatever data you want, and burn it using something like cdrecord/wodim. It works basically the same way.
If I had an OS, there would be a link here.
flyingdoodltartz
Member
Member
Posts: 25
Joined: Fri Jun 05, 2009 11:46 pm

Re: Getting started

Post by flyingdoodltartz »

well, i kind of gave up on the cd things :(. now i am trying to get a virtual floppy drive at /dev/fd0 for my bochs to work right (i tried mounting a virtual floppy in a directory i made myself, but it doens't work correctly.) but no matter how hard i google, i just can't find a floppy emulator for linux, they're all for windows. so for now ill just have to code without testing... i got it to work on my other windows desktop using bochs for windows and vfd and partcopy, but i want to do the deving on this laptop which has linux.
"I don't take advice from freshmen in high school" - when your programming, age doesn't matter

"if you think your running fast, run faster." - track coach

"Back in my day, I had a pimped out ride." - physics teacher
User avatar
kop99
Member
Member
Posts: 120
Joined: Fri May 15, 2009 2:58 am

Re: Getting started

Post by kop99 »

bochs can boot with binary file like floppy image.
Post Reply