I'll put it to you this way, If your going to be learning on your own, your better off KNOWING assembly. TRUST ME ON THIS!!!
Makeing a Bootstrap is not the easiest thing in the world in C/C++... Also, you would need to make sure you create RAW BIN files and it's tough to do in C/C++. UNLESS you know how to do it. I don't.
I know assembly, so makeing the OS in ASM is much easier to me.
Knight, have you ever written your own os? I tried but the only info i could find was on bootstraps, so i never get past that. I would love to write a small one with basic features just to learn.
Funny you ask that.. Yes, I am in the middle of my own OS. In fact, if you goto not only my website, but www.stengineer.com you will see that a bunch of us are making a WHOLE new computer based off of my OS. It's called LOS, or LCARS Operating System. You know those panels you see on Star Trek? Well, LOS is based off of that look and feel. We have PDFs and Manuals written up on the subject. We are working toward the same goal. To have a computer that will plug into the net but with beauty and style.. LOL
So in answer to your question, YES, I am making my OWN OS..
In fact, on my website, if you download BOTH of my BOOTSTRAPS 1 and 2, you can then compile both of them. The first one just sets up for the boot-signature. The second file is called by the first and then executed. It's a simple interface, but it will give you something to play with if you need. The LCARS OS however, will NOT have that interface. It's not been released to the public yet.
You can get a windows version of what it will look like at www.stengineer.com though. STEngineer owns the site, I used to be a part of LCARS Technology, but I decided to branch out on my own.. I hope this answers your question..
2. Operating Systems... ISBN 0-13-638677-b this book covers the basics of operating systems and uses examples from minix. This book is recommended by most people when starting to leran about or write OS's.
"Let's all join forces, rule with an iron hand...and prove to all the world, metal rules the land..."
-- Judas Priest
I been to that site many times. I use it like a bible. However, if you want to create a GOOD OS you have to create it in NASM first. Then you can port over to C or create your own C compiler. I know its a lot of work, but if you want your OS to be good, you have to do this. That is the one thing that site doesn't show you. I had to figure out all of this on my own. ALSO there are mistakes at that site. For example, it says in one tutorial that the starting memory address is 7C00:000 while another one says it's 0000:7C000 and still another one says 0000:07C0. So wich is it? Well, after some research I found that it's 0000:07C0. But unless you had someone to show you, you would have not known and your code would end up buggy.
Like I said, it's a greate site, but watch out for the errors.
Yes, it''s a good site but I need a web site that teaches you how to make a "hello world!" OS. and then it start with the mouse support and other ****...
If you goto my site, I have a BOOTSTRAP tutorial 2 I think it is called, that will boot up with a message. Then it hangs. You can just change the string to "Hello World!" if you want.. LOL
Either way, it works. ALSO, I JUST added some really neat routines to my site to make your life a lot easier. Things from PRINT to LOCATE.. Just like in BASIC.
The mouse support is not done yet. I have source code on my site for a Mouse driver, but it's still buggy. You can compile it and even try to move your mouse in a program. But your computer will hang do to a stack overflow. It will force you to reboot. However, once I solve this glitch, it will be a fully functional mouse driver that can be ported over to any OS.
This is the way i'm doing it. I am writting the foundation of the OS in Assembly. That's everything from the bootstrap, to the FAT table. Once those two are done, I am working on my own compiler. This compiler will be in BASIC first. Then I will make sure it can handle ANSI-C code. I'm not going the C++ route.
Eitherway, my interface will be simple to create. All that really needs to be done is the actual code behind it if you ever write software for my OS.
I beleive in the KISS method.. "Keep It Simple Stupid"
Warmaster199 - Hell yea, I remember you son.. How you been man? I have loved making an OS. So yours is going good? Just need a Kernal ehh? Yea, I know the feeling. You do know how to branch into upper memory corrrect? If so, then it's a matter of splicing the time of what each program will need so that you can multi-task it. Remember, EXEs in DOS are setup so that the EXE can tell the OS how many 64K segments are going to be needed. Think of an EXE as a multitasker. (I know it's not). But it jumps from one segment to another and almost simultaniously. Ok, now make a Kernal that can handle Multiple segments at once. In otherwords, think simple.
I know I know... Don't hit me.. LOL I try to explain and I sound like a lot of hot air.. but you know.. It sounds good in theory at least.. LOL
Hang on...there's just one thing here I don't quite get.
If he's writing an OS, why does he need to implement segment:offset handling? Surely it would be better to kick the CPU into protected mode and then work from there?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You". -- Linus Torvalds
I don't quite get protected mode... I need to do some research on that, but I do know that it's needed if I am to make the kernel 32-bit - And I am definitely going to have a 32-bit kernel!!! This thing is, I need a protected mode handler to be integrated into the kernel itself. I don't know how to do that, but I do know that I will be using Assembler for that - definitely. ASM is fast, small(compile size, HUGE amounts of code to do simple things), and is best for talking to the hardware. You probably think "This guy's nuts!", but I know what I am doing.
I do want to be able to run DOS executables using CTOS, so I'll need to organize the segments, like you said, Knight_Vision. I've got the source code to a DOS imitation called DOS-C and based on that info, I'll be able to set up the EXE header and such. I got the multitasking part ready... But right now, I gtg, cya
Designer/Programmer of the Comtech Operating System(CTOS)
Ok, Knight_Vision, I got the Pre-Emptive multi-tasker code now! That's basically the core of the kernel. I just need a keyboard handler(I got the mouse covered - serial mice), need to check the FAT filesystem out, need segmenting and then, for the most part, I am finished the kernel.
The multi-tasker runs each thread for a clock tick on the timer. 18.2 clock ticks = 1 second. If also has support for "critical sections". These are good, because they can pause the tasker so that the current thread has all of the CPU's power. I got messaging as well: threads can send messages to eachother. Sort of like windows' SendMsg() API call.
Designer/Programmer of the Comtech Operating System(CTOS)
Yes, but that has to be incorporated into the code. Actually, If I wanted it to, it wouldn't have to use a thread. I'd put it in the kernel and if something really has to be done, I could put it in a critical section in the tasker.
Designer/Programmer of the Comtech Operating System(CTOS)
Originally posted by abdul I am learnig asm at this time. Do you know how much should I learn asm and then start writting my own os. I want to work more with C\C++ than asm.
Ha! About the beginning topic of this thread;
C/C++ are very good languages. ASM is good too, but mainly because it's the fastest running language running. A good thing about C/C++ is that you can incorporate ASM into it.
My advice is:
Learn C/C++ first to establish programming fundamentals and syntax. After that, start learning Assembly(ASM). I am just starting ASM, myself. It seems complex, but my background in other programming languages helps SIGNIFICANTLY.
It is VERY good if you comment. The analogy my teachers have told me is "Comment all of your code. That way, if you come back to it in a few months, you know exactly what's going on.". Also, if you plan to have a team of friends help you, it's good to comment as it helps them understand what you're trying to do.
C: /* This is a comment */
C++: // This is a comment
ASM: ; This is a comment
Designer/Programmer of the Comtech Operating System(CTOS)
Originally posted by Warmaster199 The analogy my teachers have told me is "Comment all of your code. That way, if you come back to it in a few months, you know exactly what's going on."
I dont think thats an analogy, just good advice.
Originally posted by Warmaster199 C: /* This is a comment */
/* */ Isnt a valid c comment. At least not really. Its probably in some c compilers though. I made that mistake before too.
Originally posted by Knight_Vision ...However, if you want to create a GOOD OS you have to create it in NASM first. Then you can port over to C or create your own C compiler. I know its a lot of work, but if you want your OS to be good, you have to do this.
Can't you just do make it with GCC? ( http://www.DJGPP.com - Click on Zip Picker). With GCC, you can include a VERY large amount of assembler. Many operating systems such as LINUX, SKYOS, Several other versions of UNIX, and even CTOS(My OS) made compiled with GCC(Gnu C Compiler - It also does C++!)
Designer/Programmer of the Comtech Operating System(CTOS)
Hey guy, you said in a message up there earier that you got the serial mouse to work in your OS? Is this true? And HOW did you do it? I have source code on how to talk to the PS/2 Port mouse, but my code is buggy, and I have had it for everyone to get, but no one has taken it and fixed it for me. Got any ideas on this? I cannot figure out where I went wrong.. I think I am seeing stars.. LOL
Here is my problem, my OS is on hold because I NEED the mouse to work for the OS to work. But since I can't get the mouse to work, i'm screwed... HEEEELLLPPPP!!!!
Ahhh... I am good! The driver is actually a simple C source. Simple in deed. All you have to do is constantly communicate with the mouse(Outputting / Inputting different ports) and get it to update certain variables... Then use the variables that you modify as the location for your cursor! It is so simple that you will hit yourself(I did when I saw it) once you figure it out... here: straight from CTOS. There are actually 2 files in the zip... mouse.c(the driver) and system.h. The code is messy, but CTOS isn't finished yet
This will be helpful :
Designer/Programmer of the Comtech Operating System(CTOS)
Warmaster - Thanks budd. I'll look at it when I get home.
Chimpface - You ok guy? You been really negative lately. First you dis BASIC, then you talk negativly about Warmaster's Sig.. What gives? It's not like you. You ok?
Don't get me wrong, I agree that he needs to change his sig, but it is HIS sig. So what should it matter to us what he does with it as long as it's within the rules of ettiquete.
Either way you feel, I hope things are ok for you...