|
-
September 7th, 2003, 01:06 PM
#1
Junior Member
Need Help In Making A Simple OS
Heloo Guys,
I am Intersted in making a simple GUI based multitasking OS like win 3.11 i have coded all the user interface classes and now i am left with the mouse interaction and multitasking envirnomant can some guy of u help me in coding the multitasking envronment just give me a idea of how to code the multitasking env.in ms-dos os i want my os to run on ms-dos as a base OS any other usefull suggestions r also invited.
I am using Turbo c/c++ 3.0 as the compiler for my working and want my code to be in c++
thanx in advance
-
September 7th, 2003, 02:38 PM
#2
The most obvious implementation is to write a cooperative multitasking system whereby when one application has finished doing stuff with the CPU, it calls some kind of yield function, or calls a wait for message function.
In the implementation of that you then have to switch to another task if necessary - possibly by calling setjmp() and longjmp() to save the stack and the cpu context (Assuming this is in C)
Otherwise you'll have to switch stack and save the CPU context manually, which will be CPU specific and may involve assembly language.
Once you've figured out which process needs to run you can then call longjmp() back to the context of that process, and continue it from where it left off.
Of course you'll also need a loader for programs, some DOS C compilers provide a mechanism to do this like DJGPP's DXE format.
I hope you are running in a 32-bit addressing mode as this will make things much easier (I have no knowledge of borland's DOS compilers). I guess that if you're in 16-bit mode the memory management will get a lot more problematic.
Slarty
-
September 7th, 2003, 04:28 PM
#3
It sounds like a fun project, but it seems to me you are building a desktop environment/GUI not an operating system. With that said, if I may make a suggestion, try using a MACH base rather than a DOS base. Remember the whole system is limited by the functionality of the kernel, plus MACH will just make a lot of things much easier on account of it's messaging system being, well actually existing. This will enable you to not only easily develop software for it, but also to easily extend its functionality.
I know this doesn't answer your questions, but I figure slarty already did, plus this might be something you hadn't thought of that could make the end product far more valuable.
catch
-
September 7th, 2003, 05:50 PM
#4
Junior Member
If you want to build your own operating system, you must read 'Operating System: Design and implementation', by Andrew S Tanenbaum (The famous MINIX author).
Minix itself is written in C (and some ASM offcourse), but maybe you can make a C++ spinoff 
A must-read for the OS developer!
Grow a dope, burry a script kiddie
-
September 7th, 2003, 07:41 PM
#5
I got fasinated with the bootloader and other bits and pieces used in OS development, currently ive got a major interest in embedded systems OS dev, mostly for robotics,
The place I found most useful was this one: -
http://www.mega-tokyo.com/os/os-faq.html
also Although there are hundreads of homemade OS out there contiki was nicely coded
http://www.dunkels.com/adam/contiki/
one thing you gotta bear in mind if you didnt already is that you cant use include files, you gotta make them your self, i think thats what ive read and its certainly true with embedded systems.
Are you gonna put your code on the web so we can help debug it?, what sort of size is it at the moment?
sounds interesting project,
i2c
-
September 8th, 2003, 02:11 PM
#6
Junior Member
Thanx guys for ur gr8 suggestion here r thr details abt the project
1. i want my project to be like win 3.11 if some guys have used it the can very well understand my thoughts
2. As i have a gud experiscne of working with MS-DOS env. i will probabily not use other base OS. Also if MS hase done it with win 3.11 why cant' I 
3. I have coded the GUI for it and also a paint brush sort of program using the GUI classes i have coded and a text editor using the same GUI classes.
4. I am stuck with the mouse handing as to how to pass event messanger b/w varous running opjects of the GUI classes
-
September 8th, 2003, 04:44 PM
#7
MS-DOS is _not_ a multitasking OS. It, like Win 3.x just pretends to be by switching tasks back and forth quickly. (try doing simultanious disk writes for example) This essentially means that you will need to use the trick from the early 90's to achive any multitasking and that is circumvent DOS.
http://www.labtech.com/Reference_Lib...untitled1.html
This article talks about converting RT/multitasking software from MS-DOS to OS/2 and may be useful to you.
If you follow my suggestion you can run a MACH kernel, and run MS-DOS on top of that, heck you can run many iterations of MS-DOS on top of MACH (you can run linux at the same time if you wanted as well) and link them all together with the shell. Very cool indeed.
In addition to MS-DOS's lack of multitasking, your going to be using a third party IP stack? FAT16 doesn't support drives bigger than what? No security is availible at all... and prety soon the project starts to look like you are just working on a bad version of an obsolete product. Whereas one minor change allows you to actually have something neat and maybe even useful.
catch
PS. Just as land is the stuff with sky above it, operating systems are what talks to the hardware. You are wanting to make a GUI shell, not unlike X.
-
September 10th, 2003, 01:04 PM
#8
Junior Member
I searched For MACH kernel and gat MACH linux is this the Wht ur talking abt catch. I will try to run msdos over it is a problem encounter's i will post here thanx for ur cooperation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|