Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Writing your own toy OS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Config
Retired Dev
Retired Dev


Joined: 25 May 2003
Posts: 187
Location: Zurich, Switzerland

PostPosted: Sat Aug 09, 2003 8:07 am    Post subject: Writing your own toy OS Reply with quote

I found these articles quite some time ago and I still love to play around with it (Like Linus when writing his first codes on his "brand new" 386 8) )
So this is for everybody who likes to know how things are REALLY working behind the scenes!

http://www.tldp.org/LDP/LG/issue77/krishnakumar.html (Basic introduction on how things work at boot)
http://www.tldp.org/LDP/LG/issue79/krishnakumar.html (Now we start using interrupts - Some BIOS fun 8)
http://www.tldp.org/LDP/LG/issue82/raghu.html (Now we start using protected mode :D )

Happy coding!
P.S: may I suggest that you post your improvements here, so we get a nice collection :)
_________________
Config - caught by a chronic disease called tuxmania....
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Sat Aug 09, 2003 10:28 am    Post subject: Reply with quote

Thats kinda cool!!! :)
Back to top
View user's profile Send private message
Anacific
Apprentice
Apprentice


Joined: 05 Jun 2003
Posts: 210
Location: Toronto, Canada

PostPosted: Sat Aug 09, 2003 3:25 pm    Post subject: Reply with quote

Oh, very nice!! Something to do when I have free time :D
_________________
warning: `class GroveImpl' only defines a private destructor and has no friends.
Back to top
View user's profile Send private message
MooktaKiNG
Guru
Guru


Joined: 11 Nov 2002
Posts: 326
Location: London, UK

PostPosted: Sun Aug 10, 2003 7:15 pm    Post subject: Reply with quote

If i do make a new OS, i'm gonna call it Mine-Nux :D:D:D:D:D:D
_________________
http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Mon Aug 11, 2003 4:30 am    Post subject: Reply with quote

I hate the bizzareness of 386 protected mode...

Enable A20 line? Why? Compatibility...
Segment descriptor fields split into pieces? Why? Compatibility...

etc.

But otherwise, after dealing with all that, the 386 seems like a nice place to build an OS...

But I think that nothing beats reading source code of an existing kernel.. Pick one from: MINIX, Linux, *BSD, Mach...

I wonder, can anyone point me to PowerPC kernel development resources? Even a reference manual from IBM would be fine...
Back to top
View user's profile Send private message
verbatim
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 223

PostPosted: Mon Aug 11, 2003 2:44 pm    Post subject: Reply with quote

Very cool, thanks for the link. :)
Back to top
View user's profile Send private message
chris4linux
Apprentice
Apprentice


Joined: 13 Nov 2002
Posts: 210
Location: Germany

PostPosted: Mon Aug 11, 2003 6:26 pm    Post subject: Reply with quote

here is one more link with more stuff about wrting your own os:
http://www.nondot.org/sabre/os/articles

- Chris
_________________
NOTICE: alloc: /dev/null: filesystem full
Back to top
View user's profile Send private message
Config
Retired Dev
Retired Dev


Joined: 25 May 2003
Posts: 187
Location: Zurich, Switzerland

PostPosted: Tue Aug 12, 2003 11:03 am    Post subject: Reply with quote

Wow, thanks for this link!

Yeah, the i386 protected mode is a bizzareness - but yet, it gives you a good view on how processors can or should(n't) work and is interesting overall if you don't like reading 600 pages reference manuals of a processor... :wink:
I'm still trying to make something out of part two - extending the code but I just don't get how to do it... I'll figure :roll:
_________________
Config - caught by a chronic disease called tuxmania....
Back to top
View user's profile Send private message
chris4linux
Apprentice
Apprentice


Joined: 13 Nov 2002
Posts: 210
Location: Germany

PostPosted: Tue Aug 12, 2003 11:10 am    Post subject: Reply with quote

Config wrote:
I'm still trying to make something out of part two - extending the code but I just don't get how to do it... I'll figure :roll:


not only you, me too ;-)
(if you want you can send me a mail an we could together make something out of the code...)

- Chris
_________________
NOTICE: alloc: /dev/null: filesystem full
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Tue Aug 12, 2003 12:59 pm    Post subject: Reply with quote

Extending sample code?

Don't.

It uses BIOS interrupts, which are usually unavailable in protected mode. Especially if you forgot to load the IDTs... Drop into v86 mode if you must.

Learn how to write a IDE driver using the in and out instructions...
Back to top
View user's profile Send private message
cselkirk
Apprentice
Apprentice


Joined: 09 Jun 2003
Posts: 199
Location: NL

PostPosted: Sat Aug 30, 2003 7:42 pm    Post subject: Reply with quote

zhenlin wrote:
I wonder, can anyone point me to PowerPC kernel development resources? Even a reference manual from IBM would be fine...

here is a series of IBM and Motorola reference manuals, plus other powerpc development resources.

There is also the PowerPC Open Platform Reference Design.
_________________
cn=cselkirk,dc=xs4all,dc=nl
Back to top
View user's profile Send private message
halenger
n00b
n00b


Joined: 30 Apr 2004
Posts: 2

PostPosted: Fri Apr 30, 2004 8:20 pm    Post subject: Reply with quote

Is anyone able to convert the A86 assembly to Nasm??

I've been trying and failing miserably.

The main problem is of course seg es which isn't supported in the same manner as it is in A86. The lines following it are also a problem, to me anyhow.

Any help would be appreciated...

The lines in question are:

Code:

seg es
mov [0],#0x41

_________________
-Halenger-
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Fri Apr 30, 2004 10:11 pm    Post subject: Reply with quote

Don't know about nasm, but in masm (sorry, that's what they taught us in school), it would be this IIRC:
mov es:[0], #0x41
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
halenger
n00b
n00b


Joined: 30 Apr 2004
Posts: 2

PostPosted: Sat May 01, 2004 1:14 am    Post subject: Reply with quote

Didn't work unfortunately...

"expression syntax error". Nasm doesn't support es:[0] as far as I know.

I don't know what to do about the "seg es" part either. :?

I'll keep looking googling, trying and hoping someone eventually tells me! :p
_________________
-Halenger-
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Sat May 01, 2004 2:41 pm    Post subject: Reply with quote

Got it... in nasm it is like this:
mov [es:0], ax
More info here: http://nasm.sourceforge.net/doc/html/nasmdoc3.html#section-3.3
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum