flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Making a simple OS. A Few questions...

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 05 Aug 2005, 20:49
Hello! To get me started in OS development (and in FASM all together), I've decided to make a simple OS that boots from a floppy and runs a system check on hardware. This would be a very useful OS for me, and for a few other people I know that work on computers. So, I've got a few questions:

1. 16 bit or 32 bit?
Yes, I know what they are, but what which one should I use for this type of OS? (It will be command line style)
2. Real mode or protected mode?
Again, I know what these are, but whihc one is best for this OS?
3. Putting simple graphics in this OS?
My motherboard shows a small logo at the top of it's loading screen, but the screen is command line style. How did they, and how could I, put a small graphic like this on my OS?
4. GRUB or custom?
I've used GRUB before and I like it, but should I go the other way and make my own bootloader?
5. The best tutorial?
I've read the Tajga (sp?) tutorial, but it didn't really help me. Does anyone know of another FASM tutorial?

That's all the questions I have for now, hopefully someone can answer a few of them. Thanks!
Post 05 Aug 2005, 20:49
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 05 Aug 2005, 22:05
Hi, I was developing a system checker some time ago, too. And I had all the same questions... Smile To my mind, if you only do the system check and work with floppy, then 16 bits will be enough. You can always use 32-bit instructions with 16-bit addressing. The minus is only 1Mb of memory, so the code should be tooooo compact and well-organized.
Real mode gives you an advantage of using BIOS interrupts, so you don't need to write your own keyboard driver and other stuff like that. Protected mode gives you 4GBytes of memory space. Graphics... it is good, but do you really need it? To keep things compact and simple I'd use text mode. It is possible to make very pretty interface even in text mode. Mouse support is welcomed.
If you create an OS to fit on floppy than no GRUB is needed, I think. You'll just waste your disk space.
That's what I think of it.
Post 05 Aug 2005, 22:05
View user's profile Send private message Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 05 Aug 2005, 22:33
Thanks for the reply!

So, i'm guessing I should do 16 bit real mode then? I'd like to write my keyboard driver later on, but I'm guessing that's too complex for me right now.

I didn't really NEED graphics, I just thought it would make it look cooler. Razz

And what do you mean by "mouse support is welcomed"? I didn't really plan on using mouse support since it was going to be using a command line style (EX: COS:> help)

I won't be using GRUB then, if it means i'll be wasting space.
Post 05 Aug 2005, 22:33
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 06 Aug 2005, 02:47
Your best bet is to go here and get bootprog it lets you boot a com bin or exe from a floppy makes testing very easy. you can get it here:
http://alexfru.chat.ru/epm.html#bootprog
Post 06 Aug 2005, 02:47
View user's profile Send private message Reply with quote
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 06 Aug 2005, 07:49
Well this is the way I'd do it:

32 bit
protected mode
VESA/VBE
own bootloader

Greetz.
Post 06 Aug 2005, 07:49
View user's profile Send private message Visit poster's website Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 06 Aug 2005, 16:12
I don't know how to use VESA at all, so I'll save that for a later project. Razz
Post 06 Aug 2005, 16:12
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 06 Aug 2005, 19:15
32 PM CLI for a first time...
Post 06 Aug 2005, 19:15
View user's profile Send private message ICQ Number Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 06 Aug 2005, 22:52
Quote:

And what do you mean by "mouse support is welcomed"?

It is better to use mouse to navigate the screen if you have a user interface with dozens of buttons and edit boxes. But, of cource, you don't need it for command promt only.
Post 06 Aug 2005, 22:52
View user's profile Send private message Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 10 Aug 2005, 00:07
That would depend entirely on what you're trying to do. OF COURSE Protected mode/32-bit (You can't have one or the other, they are mutually inclusive) is best but there are some circumstances where you would prefer real mode/16-bit. For one thing, real-mode is easier to program. If you aren't trying to do a "modern" OS, just a simple, basic barebones DOS-like OS, real mode is easier. However, linux uses protected mode and multitasking. Although linux is a commandline OS, it is a modern OS. So would you rather be like DOS (real mode) or linux (protected mode)?

The simple graphics is easy, just go into graphics mode and display text as pixels instead of characters. You have to display each pixel separately instead of characters. It's really very easy, I've seen this type of thing done often. You do have to make your own font, and I suggest returning to text mode when you aren't displaying any graphics, but other than that it wouldn't be difficult. However, this wouldn't be a top priority. Work on the OS itself, you can add these optional niceties later Wink

GRUB is very complex, so I don't plan to learn it until I need to. However, since you've used it before, you may as well use GRUB- it's a very good advanced bootloader, and if you're able to use it you should. Writing your own bootloader is more complex, and not really all that important. [b]A bootloader is NOT an operating system[b] so you should focus on more important things.

The last question is difficult to asnwer. If you already know assembly, you should be able to learn FASM quickly and easily. If you don't know assembly yet, you probably shouldn't be OS Deving, as OS Development requires knowledge of assembly. Even if you're writing your OS in, for example, C, you'll need to use assembly for some things, so don't fool yourself into thinking you don't need it.

Remember, it's your OS, so don't take my (or anyone else's) word as law: you are the ruler, not us! And good luck! Wink

_________________
FASM Rules!
OS Dev is fun!
Pepsi tastes nasty!
Some ants toot!
It's over!
Post 10 Aug 2005, 00:07
View user's profile Send private message AIM Address Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 10 Aug 2005, 19:27
Quote:

For one thing, real-mode is easier to program.

No! PM is no much complicated as RM. Only few descriptors, and it will work as RM, but with 4Gb memory. All rest(exc. IDT) stay same.
Post 10 Aug 2005, 19:27
View user's profile Send private message ICQ Number Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 11 Aug 2005, 00:05
Not exactly... now, I know you are probably more experience than I, but i've read (and heard) that RM is much easier to make a textbased OS in since printing text is only a few lines of code, while in protected mode, you have to write full functions to print text.

Again, I'm new to this, but I'm only saying what I've heard numerous times. So, back to the topic... I think I will use real mode 16 bits for now since I am only making a simple DOS-like OS to test hardware. I'll switch to PMode when I get more experience... and I don't need anything like multi-tasking or a video mode, and I'll only be including 3 functions. (test, sysinfo, and reboot). So, thanks for the posts everyone! This is why I like this forum... I can get help quickly, and get lots of it. Very Happy
Post 11 Aug 2005, 00:05
View user's profile Send private message Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 11 Aug 2005, 01:00
It's easier because you have BIOS for many things, so you don't have to write your own drivers, and you don't have to work with gate A20, and all the descriptor tables and selectors and everything. If protected mode weren't just plain better, I would be using real mode! But this guy doesn't necessarily NEED just plain better, so it's a lot easier to just use real mode unless he WANTS just plain better.
Post 11 Aug 2005, 01:00
View user's profile Send private message AIM Address Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 11 Aug 2005, 01:22
I'd rather it be EASY instead of BETTER since I'm only starting out. Razz Once i understand the easy stuff, I'll move to the better stuff. Crawling is easy, but walking is better. And you can't walk without learning to crawl first. lol


Last edited by DataHunter2009 on 11 Aug 2005, 01:24; edited 1 time in total
Post 11 Aug 2005, 01:22
View user's profile Send private message Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 11 Aug 2005, 01:24
I know, which is why I suggested real mode. Wink
Post 11 Aug 2005, 01:24
View user's profile Send private message AIM Address Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 11 Aug 2005, 01:51
Well, I was saying that to everyone else. Razz
Post 11 Aug 2005, 01:51
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 11 Aug 2005, 12:21
Quote:

is much easier to make a textbased OS in since printing text is only a few lines of code, while in protected mode, you have to write full functions to print text.

No. It depends on using BIOS or your own functions. You can use your ones without BIOS in RM too, and BIOS can be used via VM in PM too.(but it is long way)
Quote:

I'd rather it be EASY instead of BETTER since I'm only starting out
No, it will be ALMOST impossible to turn your cRM codes to PM after.
"I'll only be including 3 functions. (test, sysinfo, and reboot)."That can be easily done in PM. Don't afraid of PM. It ONLY SEEMS to be complicated, i thought so too ( and started coding RM too. But the i thought - what a*, i can use PM, i can ,i can. And after 2 days i recognised all "complicated" parts. They are easy in reality.
Imagine" you can make IDT table, GDT table with 2 descr. - for code and for data, but you will be able to use more features.
Post 11 Aug 2005, 12:21
View user's profile Send private message ICQ Number Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 11 Aug 2005, 16:47
But then you don't have the BIOS. If yu're only testing the system, rm should be fine (though if you want you can enter pm just to make sure pm works properly on your system as well... however, it's highly unlikely that it wouldn't, so it's not something to worry about)
Post 11 Aug 2005, 16:47
View user's profile Send private message AIM Address Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009 11 Aug 2005, 17:41
Actually, I think I'm going to make my OS in C. And asmdemon has a nice example with PMode and everything, so I think i'm ready to go. Razz
Post 11 Aug 2005, 17:41
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 11 Aug 2005, 19:07
Quote:

But then you don't have the BIOS.

You can use BIOS in PM. But it is quite complicated task. I said - use VM.
About testing - yes, but it will be hard to port RM code if you'l decide to use PM after.
Post 11 Aug 2005, 19:07
View user's profile Send private message ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 11 Aug 2005, 20:44
Switching to pmode and back to realmode for bios int is simple, quick enough for most int's Wink .
Post 11 Aug 2005, 20:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.