flat assembler
Message board for the users of flat assembler.

flat assembler > OS Construction > New version of SOLAR OS available

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Gomer73



Joined: 29 Nov 2003
Posts: 151
Did you mean so that the jump will never get executed?

When I test the code, the jump never gets executed.
I thought that might be the reason, but wasn't sure why the jump just wasn't commented out, the realities of modifying code until it works like you want.
Post 24 May 2004, 03:16
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
Yes the jump never gets executed
Post 24 May 2004, 06:40
View user's profile Send private message Visit poster's website Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
Thanks--that was really bugging me.Smile

I think your SolarOS makes an excellent tutorial for how to make an OS though---with your comments and all. A few more comments might make it better for those not familiar with what hardware exactly is at various ports that you output bytes to (and which functions you are calling from that hardware when you do that).

I found a bunch of places that could be optimized but I didn't think those were errors since I take it this is a "work in progress" and you don't want to start optimizing until it is finished or close to it, yes?

Yeah...that bugged me though because it looked like a serious error to me--either that or I was thinking you knew something I didn't--maybe about some out-of-order execution at that exact point after switching into protected-mode or something along those lines---thank goodness it wasn't! Protected mode is confusing enough as it is:D BTW, isn't there a different kind of protected mode which the 80286 uses vs what 80386 and up use?....which exponentiates the confusion!Very Happy
Post 24 May 2004, 14:05
View user's profile Send private message Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
2bogdanontanu:
hi! what is new? you say that app work in ring 0.. in news ver it is?

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 25 May 2004, 08:41
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
Hi CodeWorld

I have just finished (2004-05-25) all routines and tests for making 24 and 32 buts resolutions up to 1280x1024

So the startup menu options are many now Wink

I am working a an method to execute external applications and some binary exeutable formats for SolOS.

I guess it will be a new version released soon (at least for the new resolution options)

Yes it is true, curently all SolOS applications run in Ring0 at the same priviledge level as the kernel itself.

_________________
"Any intelligent fool can make things bigger,
more complex, and more violent.
It takes a touch of genius -- and a lot of courage --
to move in the opposite direction."
Post 25 May 2004, 19:36
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
To ShortCoder

Yes there is a 286 protected mode that uses 24 bit instead of 32 bits for maximum address ranges and a slightly smaller descriptor structure...well that is why the selectors descriptore are so much mixed up: because they had to keep compatible with 286 ones.

Basically the 286 protected mode is very similar to 386 one just that you can not return to real mode (not with ease)... Anyway i do not own a 286 anymore...

And again you are true: I do not want to start optimizing SolOS yet. It is fast already and i favour simplicity and easy understanding over superoptimized but complicated to understand code.

I will try to constantly improve comments on source code and update the documentation about API and internal workings of SolOS.

However if you find any trivial easy/simple optimization ...esp algorithmical but code also ... that will have a big impact on OS speed I will give it a try

Do not think that i know something that you do not, it is most likely that i do not, and i am making mistakes also Wink

_________________
"Any intelligent fool can make things bigger,
more complex, and more violent.
It takes a touch of genius -- and a lot of courage --
to move in the opposite direction."
Post 25 May 2004, 20:12
View user's profile Send private message Visit poster's website Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
what about kernel.. monolith? what consist in it?
all os on the fasm?

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 26 May 2004, 04:05
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
CodeWOrld,

The SolOS kernel is monolithical, but since all applications run in ring-0 at the same priviledge level as the kernel this distinction is not very important anymore.

Any application can act as a kernel add-on and in fact it can improve the kernel if it likes to do so.

Current Kernel is made by the IRQ handlers that produce events for the kernel queues. Then the System Executor consumes the events and generates messges for applications.

On their turn Applications generate events/requests for the Kernel.

Whenever a long operation is requested (for example a read from a floppy disk) a kernel state machine takes over. The "State Machine" breaks the application's request into smaller atomic operations and it executes each atomic operation one at a time. If a busy waiting is detected then the state machine releases CPU time and will execute the curent atomic operation next time arround.

But yeah i should write some articles on the inner workings of the SoloOS Kernel also Wink

And NO... not all OS are in FASM Wink
For example SOlOS and AFAIK V2OS use TASM
and hopefully i will use SOL_ASM someday

Also i have seen many OS using NASM and many using plain C ...
Post 26 May 2004, 06:16
View user's profile Send private message Visit poster's website Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
clear... what about multitasking? hardware/programm? what elements in GDT/LDT? how with memory? not virtual memory? how you control memory?

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 26 May 2004, 07:44
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
SolOS multitasking is cooperative, so i guess you can call it "software" multitasking
I have plans to add preemptive multitasking later on aka "hardware" but this is not on the top list of my prioritys... esp because i dislike switching tasks at arbitrary moments in time

GDT contains only 2 used elements a CODE and a DATA selector, yeah there are other selectors there but they are not curently used.

So the memory model is FLAT with selector ranges beeing 0 - 4G.

It is my intention to add new selectors via API calls IF an application requests separation / protection from the Kernel and other applications Very Happy. Applications could do that also... This will be done for helping debugging and testing applications that might crash a lot until finished...

IDT mainly contains the IRQ handlers for Timer,Keyboard,Mouse,Flooppy and eventually HDD. More IRQ handlers will be added as new devices are implemented:network, sound card, USB, other PCI cards, eventually video.

The Traps and Exceptions are plain hang loops (not implemented)... but this will change soon.

There is no virtual memory and no paging; if and when there will be paging it is most likely to be identity maped (for AMD 64 long mode?).

Memory is allocated by OS via the API_Memory_Allocate and released via API_Memory_Release functions. Allocation is done in chunks of 4K; you get a handle and an address(pointer) of the memory block. OS keeps track of allocated blocks and memory free space using a bytemap 00h for free block and 0ffh for allocated block.
This will soon be changed to use dwords instead of bytes, the ideea bbeing that each dword will represent the ID of the "task" that allocated memory.

As you can see i prefer a very simple approach to most problems and improve things only on a need to do basis...
Post 26 May 2004, 08:38
View user's profile Send private message Visit poster's website Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
>GDT contains only 2 used elements a CODE and a DATA selector, yeah there are other selectors there but they are not curently used.
where TSS?
>So the memory model is FLAT with selector ranges beeing 0 - 4G.
funny..you dont have shared memory?

>There is no virtual memory and no paging; if and when there will be paging it is most likely to be identity maped (for AMD 64 long mode?).
i dont mean.. in long mode not exists virtual memory?

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 26 May 2004, 16:42
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
1)Since I use cooperative multitasking i have no use for TSS, so there is no TSS used

2) Funny but i do HAVE shared memory, ALL memory is shared Wink . There will be an option for applications NOT to share memory... but default is all shared.

3)Oh yes there is virtual memory in long mode (64bits). But what i wanted to say was that in long mode you must use paging (i do not like this) ...

So i guess that when i will implement 64bits long mode i will use identity mapped paging / pages.
Post 26 May 2004, 17:57
View user's profile Send private message Visit poster's website Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
>2) Funny but i do HAVE shared memory, ALL memory is shared Wink . There will be an option for applications NOT to share memory... but default is all shared.
brrr... no virtual memory - clear.. ok.. my question finished =)

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 26 May 2004, 18:06
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
Ok i am glad i have answered your questions Wink

About "virtual memory":

I consider it one of the bad designs in today OSes Very Happy

I have seen modern OS like WIndows and Linux / Unix gooing on their knees and then to a crawling halt because of virtual memory usage.

OSes have existed before without this trick of generating a page fault everytime you need more memory that you really have... this combined with preemptive multitasking and swaping applications to disk are the MAIN reasons in today computer CRASH. (well not counting VX)

So virtual memory is BAD IMHO.

I know that it helps programmers and OS designers and that they are lazy (like me), but with a little thinking you can move things arround in memory (with a few rep movsd) and avoid havoc and crashes and this is more important IMHO.

Applications that need more memory that the OS has physically available can be honest and recomend it to the user and then use a private swap file on HDD for additional memory... after all the Application programmer knows better when and waht to swap... OS can only guess and it is badly guessing IMHO.

This kind of application based personal swapfiles have been used before and in fact have been pretty stable... and they contributed to the public acceptance of the virtual memory...

A semi good thing (as it is better to be honest and have more RAM) moved things into a much worst situation of "virtual memory" trick IMHO

The wider speread usage of paging has its "theoretical advantages" as it presumably avoids moving memory arround and memory fragmentation... but in fact trashes cache and adds the need of extra calculations at every CPU operation and extra TLB cache that coud have better usage... but at least "theoretically" it is good, not to my likeings ...

However the virtual memory (offten associated with pagins and GP exception handlers) is just a commercial trick that appeals to the average programmer because he dosent have to do things "right" anymore... and this has critical bad results in memory usage, speed and stability of today moders OSes...


BTW i am also using virtual memory in my Game Hostile Encounter RTS because i was lazy ... As a matter of fact i will have problems running HE game on SOL OS with only 256M of RAM as i have in my box Wink

But if i will make use of a private swap file it will result in a betetr programemd and more stable game

So i criticize myself also in above rant
Post 27 May 2004, 04:14
View user's profile Send private message Visit poster's website Reply with quote
Gomer73



Joined: 29 Nov 2003
Posts: 151
Totally agree with you on the virtual memory.

It's my opinion if a program can't exist in memory it shouldn't be run and that programs would best know what could be swapped to disk.

I know from myself, I would rather open less explorer windows and run everything fast than running more explorer windows than I have memory for and running 1/10 speed or less just because it is disk swapping.

You have some good principles, can hardly wait to see how the development of you OS goes.
Post 27 May 2004, 18:57
View user's profile Send private message Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
Bogdan described my sentiments about virtual memory, precisely. Thanks also to Code World for this useful exchange and clarification. Regards, tom tobias
Post 27 May 2004, 19:50
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2019, Tomasz Grysztar.

Powered by rwasa.