Flat binary,does it fly??

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Nemo

Flat binary,does it fly??

Post by Nemo »

HI I was wondering. Is it possible to multitask if your entire system is compiled as flat binary..meaning do you have to reallocate according to symbols inside executables or can you just switch code and data values in the gdt? i mean windows can run multiple com files at once??
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Flat binary,does it fly??

Post by Pype.Clicker »

i mean windows can run multiple com files at once??
MS ".COM" files are usually small enough to fit one real-mode segment, meaning that, even if they're a flat binary, they can just work nicely in CS:0000 .. CS:FFFF regardless of the value of CS.

That makes DOS able to load and run them anywhere, but for the purpose of running 3 COM files at the same time, Windows uses virtual addresses: each COM file runs in its own copy of DOS, completely ignoring the other running programs, and believing that 0xB8000..0xBFFFF is video memory while it's just an area of memory MS Windows reads back to render the "console" window.
meaning do you have to reallocate according to symbols inside executables or can you just switch code and data values in the gdt?
The problem is not to multitask (e.g. switching tasks): the problem is about sharing the memory. Indeed, you could ignore paging, have segments defined in the LDT that describe what each program has access to, or you could give each program its own virtual address space (which is the case in linux, windows, and virtually all "major" OSes i know).
hendric

Re:Flat binary,does it fly??

Post by hendric »

Yes but paging 's already provide a powerful enough mechanism.Why not use it?
Post Reply