Making a small/simple OS in C - some errors

There are many different operating systems; which one will you choose?

Re: Making a small/simple OS in C - some errors

Post by Arightwizard on Sun May 29, 2011 12:10 am
([msg=57845]see Re: Making a small/simple OS in C - some errors[/msg])

fashizzlepop wrote:I like the enthusiasm as well. You also seem pretty knowledgeable for a beginner.

I think it's appropriate to call it an OS.


Thanks!

Although I'm not really a beginner to programming in general (I know a LOT of other languages), so some of this is kind of inferred from my knowledge of other languages. But I definitely could be considered a beginner to C and OS development.

I'll post again once I get more working. No idea why I will, but I will. lol
The universe is mind over matter, meaning that consciousness precedes existence in general.
This means that if enough people start thinking that the world will end...it will.
Cool.
***IRRELEVANT SCIENCE FTW!!!***
Arightwizard
New User
New User
 
Posts: 14
Joined: Thu Jun 25, 2009 12:20 pm
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by conscience on Sat Jun 18, 2011 6:58 pm
([msg=58709]see Re: Making a small/simple OS in C - some errors[/msg])

I hope you already know that you in no way will get away without ASM as vital low level parts cannot be carried out otherwise.
Loading the GDTR, LDTR (does anyone on earth use it?) or IDTR, handling exceptions and interrupts accessing the hardware, providing a basic RTL for the kernel all requires this beatiful low level coding.

Oh yep! And trying to learn a programming language via an attempt to create a kernel in it is considered a very bad idea as OS development is a very complex work and you should know the language of your choice inside and out in order to come up with a well-written, working code. If you're more familiar with - lets say - Pascal, try that one instead.
Let him who has understanding recount the number of the beast, for it is a human number: His number is 0x029A.
conscience
Poster
Poster
 
Posts: 250
Joined: Thu Jan 08, 2009 9:05 pm
Location: 127.0.0.1
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by centip3de on Wed Jun 29, 2011 2:16 am
([msg=59167]see Re: Making a small/simple OS in C - some errors[/msg])

conscience wrote:Oh yep! And trying to learn a programming language via an attempt to create a kernel in it is considered a very bad idea as OS development is a very complex work and you should know the language of your choice inside and out in order to come up with a well-written, working code. If you're more familiar with - lets say - Pascal, try that one instead.


While I would agree with you 100% here, a little person in the back of my head is telling me that your partially wrong. While under normal circumstances, yes you need to know the language up, down, left, and right, if you know at least 3 (random number, as long as it's more than 1) languages up, down, left, and right, you should be fine. As long as the syntax's aren't too different (i.e. Python and C would be too different, etc) you should be fine. Knowing 2 languages should make it to where you know enough about languages to do some OS Deving. And throughout the process, your going to be forced to know the languages so well that it doesn't really matter, all you need is a solid background in programming to start, regardless of the language.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1426
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by mShred on Wed Jun 29, 2011 2:23 am
([msg=59168]see Re: Making a small/simple OS in C - some errors[/msg])

conscience wrote:I hope you already know that you in no way will get away without ASM as vital low level parts cannot be carried out otherwise.

Um, well, no. Unix, which most of us here would agree constitutes the making of some pretty damn good OS's, was written in the language C. Without ASM, they created Unix. So i'm gonna have to bash that post and say i disagree.
Image

For those about to rock.
User avatar
mShred
Administrator
Administrator
 
Posts: 1740
Joined: Tue Jun 22, 2010 4:22 pm
Blog: View Blog (2)


Re: Making a small/simple OS in C - some errors

Post by fashizzlepop on Wed Jun 29, 2011 4:52 am
([msg=59171]see Re: Making a small/simple OS in C - some errors[/msg])

mShred wrote:Um, well, no. Unix, which most of us here would agree constitutes the making of some pretty damn good OS's, was written in the language C. Without ASM, they created Unix. So i'm gonna have to bash that post and say i disagree.

You can't build a kernel without knowledge of ASM and stuff on that low of a level. The bootloader, for instance, is highly ASM related. So, I'm going to have to bash that post and say, I disagree. ;)
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by conscience on Wed Jun 29, 2011 10:33 am
([msg=59177]see Re: Making a small/simple OS in C - some errors[/msg])

mShred wrote:
conscience wrote:I hope you already know that you in no way will get away without ASM as vital low level parts cannot be carried out otherwise.

Um, well, no. Unix, which most of us here would agree constitutes the making of some pretty damn good OS's, was written in the language C. Without ASM, they created Unix. So i'm gonna have to bash that post and say i disagree.


You can't load the GDT in C for example, mate. You also cannot inport/outport unless you first implement the ASM side of these rtl functions. The same goes for interrupts and basically the whole C RTL - you'll have to create those stuff in ASM first (type definitions not included of course) in order to use a higher level language no matter which one of the higher levels you choose. You need ASM for the bootloader also as pointed out by fash. The fact that Unix was written in C means that C was used on top of the basic, essential ASM stuff. So I'll have to duplicate that post and say that you in no way will get away without ASM as vital low level parts cannot be carried out otherwise. ;)

-- Wed Jun 29, 2011 5:57 pm --

centip3de wrote:
While I would agree with you 100% here, a little person in the back of my head is telling me that your partially wrong. While under normal circumstances, yes you need to know the language up, down, left, and right, if you know at least 3 (random number, as long as it's more than 1) languages up, down, left, and right, you should be fine. As long as the syntax's aren't too different (i.e. Python and C would be too different, etc) you should be fine. Knowing 2 languages should make it to where you know enough about languages to do some OS Deving. And throughout the process, your going to be forced to know the languages so well that it doesn't really matter, all you need is a solid background in programming to start, regardless of the language.


Basically, you're right. However you'll have to be familiar with your compiler's guts and little tricks when it comes to tossing some ASM under the hood as well as accounting what designs are possible for example (like most compilers do not support 32bit segmented pmode; yep, for portability though, so it's a bad example but it's real).
Let him who has understanding recount the number of the beast, for it is a human number: His number is 0x029A.
conscience
Poster
Poster
 
Posts: 250
Joined: Thu Jan 08, 2009 9:05 pm
Location: 127.0.0.1
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by canbees on Wed Mar 07, 2012 5:31 pm
([msg=64852]see Re: Making a small/simple OS in C - some errors[/msg])

canbees
New User
New User
 
Posts: 11
Joined: Wed Mar 07, 2012 2:02 pm
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by centip3de on Wed Mar 07, 2012 5:35 pm
([msg=64854]see Re: Making a small/simple OS in C - some errors[/msg])

canbees wrote:http://mikeos.berlios.de/write-your-own-os.html
i would say start here


The OP obviously got his answer, and there's no reason to revive this post. Please don't necro old threads.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1426
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: Making a small/simple OS in C - some errors

Post by canbees on Wed Mar 07, 2012 5:41 pm
([msg=64855]see Re: Making a small/simple OS in C - some errors[/msg])

k, sry didnt read through it all
canbees
New User
New User
 
Posts: 11
Joined: Wed Mar 07, 2012 2:02 pm
Blog: View Blog (0)


Previous

Return to Operating Systems

Who is online

Users browsing this forum: No registered users and 0 guests