Simple OS - Building from linux or scratch?
Simple OS - Building from linux or scratch?
I've been creating websites for a while now with both php and asp, but I want to digg more deeper.
I once created my own webserver and used visual basic as the serverside language.
I have created a Web based OS with javascript, opening folders, files, moving files at the "desktop" of the site, creating apps and games for the site with javascript.
My idea is to create my own simple OS, make it read the networkcard so i can get internet connection and create a webserver within the OS.
Do i need to use linux as backbone?
Waiting for answers so I can purchase some assembly books. Ether the ones involving linux, or just building the OS from scratch.
I once created my own webserver and used visual basic as the serverside language.
I have created a Web based OS with javascript, opening folders, files, moving files at the "desktop" of the site, creating apps and games for the site with javascript.
My idea is to create my own simple OS, make it read the networkcard so i can get internet connection and create a webserver within the OS.
Do i need to use linux as backbone?
Waiting for answers so I can purchase some assembly books. Ether the ones involving linux, or just building the OS from scratch.
Re: Simple OS - Building from linux or scratch?
No... Not if you start from scratch. You only need to use Linux if you decide to build a distribution of it instead. If you start from scratch, you dont need to use anything at all if you dont want to.Kurdistan wrote:Do i need to use linux as backbone?
Also, welcome to the site
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Simple OS - Building from linux or scratch?
Thanks =)
I've actually been a member for 2 years, but never been active, so this is my first post =)
I will be aiming at performance first of all, so should I use Assembly or C?
Like I said in my first post, the only app that will be running on my OS is a custom webserver, indexing compressed files, decompressing, searching..... Which language should i choose?
I've actually been a member for 2 years, but never been active, so this is my first post =)
I will be aiming at performance first of all, so should I use Assembly or C?
Like I said in my first post, the only app that will be running on my OS is a custom webserver, indexing compressed files, decompressing, searching..... Which language should i choose?
-
- Member
- Posts: 65
- Joined: Sat Jul 04, 2009 9:39 pm
Re: Simple OS - Building from linux or scratch?
This is a matter of personal preference. There are people here who only use assembly code. Also, when making an OS, a certain amount of assembly code is unavoidable. However, C shouldn't hurt performance very much (compilers are good at optimizing), and if it does you can always use a mixture of assembly and C. Only the most critical parts of your code will noticeably affect performance, so you can use whatever language you're comfortable with, and then use assembly for the important parts (if necessary).Kurdistan wrote: I will be aiming at performance first of all, so should I use Assembly or C?
See Languages.Which language should i choose?
EDIT: The design of your OS will affect the performance a lot more than the language you choose, so don't be afraid to use C if that's what you want.
Re: Simple OS - Building from linux or scratch?
I dare say that compilers are optimizing better than most programmers do manually, even more if they are beginners. So you would likely gain performance from using C.manonthemoon wrote:However, C shouldn't hurt performance very much (compilers are good at optimizing)
Re: Simple OS - Building from linux or scratch?
You can use assembler for the boot process and C (it's easier than asm) for the kernel. GRUB makes life comfortable, otherwise you have to work on bootloader, or you use this: http://www.brokenthorn.com/Resources/OSDevIndex.html
http://www.henkessoft.de/OS_Dev/OS_Dev3.htm (OSDEV)
http://www.c-plusplus.de/forum/viewforu ... is-62.html
irc.euirc.net #PrettyOS
http://www.c-plusplus.de/forum/viewforu ... is-62.html
irc.euirc.net #PrettyOS
Re: Simple OS - Building from linux or scratch?
The language is up to you, the one which you feel most comfortable with and know best is the one to use.
I use ASM only and my os can do what you want, but so can many C code ones, i do not use asm because it makes things faster, but because i like coding in its, its as simple as that.
My OS as a server.
http://www.youtube.com/watch?v=ErPDIG8HQno
I use ASM only and my os can do what you want, but so can many C code ones, i do not use asm because it makes things faster, but because i like coding in its, its as simple as that.
My OS as a server.
http://www.youtube.com/watch?v=ErPDIG8HQno
Re: Simple OS - Building from linux or scratch?
Kevin wrote:I dare say that compilers are optimizing better than most programmers do manually, even more if they are beginners. So you would likely gain performance from using C.manonthemoon wrote:However, C shouldn't hurt performance very much (compilers are good at optimizing)
I agree, most modern compilers can write better code than humans. Modern CPU's are very complex.
Re: Simple OS - Building from linux or scratch?
Although, you will still need to use some asm at times, but that should mostly only be for the lowest of the low level stuff (and generally inline asm will suffice).dude101 wrote:Kevin wrote:I dare say that compilers are optimizing better than most programmers do manually, even more if they are beginners. So you would likely gain performance from using C.manonthemoon wrote:However, C shouldn't hurt performance very much (compilers are good at optimizing)
I agree, most modern compilers can write better code than humans. Modern CPU's are very complex.
On the other hand, having at least a decent understanding of asm is often helpful when debugging (especially with that lowest of the low stuff I mentioned above )
Re: Simple OS - Building from linux or scratch?
Wrong, if you take a good asm programmer and give him the task of "write better code" than a modern compilers, the asm coder will win.dude101 wrote:Kevin wrote:I dare say that compilers are optimizing better than most programmers do manually, even more if they are beginners. So you would likely gain performance from using C.manonthemoon wrote:However, C shouldn't hurt performance very much (compilers are good at optimizing)
I agree, most modern compilers can write better code than humans. Modern CPU's are very complex.
But and this is a big but, most asm programmers do not try and do this, most just want to writter small code that works as it should.
But please do not think, this is because they can not, more we are lazy like the rest of you.
Re: Simple OS - Building from linux or scratch?
Thanks for all the great replies.
Dex, can your webserver only handle htmlpages?
I was thinking to make mine read ether BASIC code since i think vbscript is the fastest way to code a site, or read C++.
When it comes to the programming language of the OS, I'll use both Assembly and C.
Maybe use C++ for the webserver.
Dex, can your webserver only handle htmlpages?
I was thinking to make mine read ether BASIC code since i think vbscript is the fastest way to code a site, or read C++.
When it comes to the programming language of the OS, I'll use both Assembly and C.
Maybe use C++ for the webserver.
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Simple OS - Building from linux or scratch?
I'm in between the two. Some of the 'big' commercial compilers (VS, Intel) could take a horrendelously complex math algorithm that is spread across multiple functions, rearrange it (which it knows how to do so if you're using math.h intrinsically) so the constants are grouped, then optimise it away to one very short formula, and then there are more simpler optimisations like unrolling loops. These things could be very tedious and difficult to near-impossible to maintain (imagine changing a constant, and then rewriting a rearranged optimized math algorithm and inlining it into every place you use it). On the other hand, an assembler programmer would know constraints on certain variables (tricks that could be a lot faster than a C-style switch, as well as removing fall back cases and bound checks).Dex wrote:Wrong, if you take a good asm programmer and give him the task of "write better code" than a modern compilers, the asm coder will win.
But and this is a big but, most asm programmers do not try and do this, most just want to writter small code that works as it should.
But please do not think, this is because they can not, more we are lazy like the rest of you.
I personally don't think saving a few instructions by using a hand coded assembly function over an optimized C function is that much of a benefit, since most optimizations are done at a much higher level than the compiler can understand. So to me, I have more benefit to see my code abstracted away behind high-level classes so it is much simpler to understand the bigger picture, then reap the rewards of optimizing at that level.
But back on to the other topic, if you want to write on OS from scratch but want a solid fast foundation, you could look into using a microkernel and building your own services on top of that.
My OS is Perception.
Re: Simple OS - Building from linux or scratch?
The simple answer is yes and no, it as a full tcp/ip stack, so its just a case of writing the basic function to implement anyother task you want it to do, but as far as that demo goes it just htmlpages, files or images etc.Kurdistan wrote: Dex, can your webserver only handle htmlpages?
I was thinking to make mine read ether BASIC code since i think vbscript is the fastest way to code a site, or read C++.