Page 1 of 2

Operating System

Posted: Thu Mar 15, 2007 3:40 am
by MERLiX
So I'm thinking about another project that I will never write, but since its still in my head and formulating other ideas with it I figured I post it just to what the scene thinks. (maybe someone can use this and since I've typed it hopefully my brain will go back to thinking about other matters)

So I've though about a limited OS for the megadrive for a while.

Mostly because I'm intrigued by such things and how it would work on a limited resources (at least compared to modern standards)

So I was thinking about Memory Allocation and Task Handling.

Memory, using the 68k I would divide it like so
4kb OS system ram
1kb for task stack (1 System Process input etc.. and 15 App process)
3kb for free memory map allocation(1kb for each 8,16,32 bytes)
8kb for single bytes (char)
16kb for words (int)
32kb for doubles (long)

For the Task handler I'd have it running on the Vint so technically I'd have 60(or 50) task slices in a second
The Vint Handler would need to push the current regs d0-d7 a0-a7 to the apps stack list check which process would run next, then pop it off the app stack into the regs so the reti should?? return to the new applications halt point.
Again how feasible this is I have Nooo idea.

So when making an app you would use the local stack (each process would get say 256 bytes of stack) for procedural vars and use the actual memory allocation for IPC and other stuff. Const's and data would of course be in ROM and should not be duplicated into RAM (unless modification is needed)

well theres my ramblings for another week, (what will next week hold? will it be a gui, or will it be a new file system (sadly I've thought about doing these too with this project -_- *sigh* wish I could just program random crap all day))

Posted: Thu Mar 15, 2007 9:08 am
by Stef
Actually, i though several time about turning my genesis libraries in a genesis OS. For now it's still "library" but i'm really close from the OS as i'm overloading V-Int handler to generate some controllers events. I plan to add timer event also (maybe with H-int overloading)...
I don't understand your byte, word, long allocation ?

Anyway i think in future my library will move to a mini OS with memory allocation functions, events, etc :)

Posted: Thu Mar 15, 2007 8:43 pm
by Mask of Destiny
I have the very early stages of a Palm OS clone running on the Sega CD. Memory allocation is done (though could use some improvements) and it has partial support for Palm Databases (which aren't much like what you would normally refer to as a databse). The very beginnings of process management are there. Processes can be started and their info gets added to the process list, but there isn't currently any multi-tasking support. Wouldn't be hard to add a simple round robin scheduler though. The syscall interface is mostly implemented, but register saving isn't done yet (I didn't have the 68K C ABI handy at the time).

The Palm OS clone is on hold at the moment, but I did recently use the memory allocator to get the interpretter for my programming language running on the Sega CD.

The Palm OS clone is an open source project. There's source up on Source Forge, but I don't think I ever committed the latest version. If anyone wants to take a look at it, just ask.

Posted: Fri Mar 16, 2007 6:44 am
by TmEE co.(TM)
Stupid question: why would you need an OS between your program and hardware ? I've always liked to manipulate everything directly

Posted: Fri Mar 16, 2007 9:42 am
by Stef
TmEE co.(TM) wrote:Stupid question: why would you need an OS between your program and hardware ? I've always liked to manipulate everything directly
See the OS as a library. Instead of doing all the weird stuff to initiate a DMA, you agree it's more convenient to just do :
DoDMA(source, destination, len);

As uploading Z80 data, i prefer use :
Z80Upload(datas, destination, len);
than doing all the stuff by hand.

Same goes for the controller check...

Also using only the "OS" functions permit you to keep a level of integrity :)

Posted: Fri Mar 16, 2007 10:27 am
by ob1
I'd rather see Merlix's idea as a true OS.
Somewhere further, you could plug your Genesis to an Ethernet, or attach it to an USB device.
Devster has done something intersting
http://devster.monkeeh.com/pictures.html

Posted: Sat Mar 24, 2007 11:35 pm
by commodorejohn
If someone could whip up a keyboard connector (or was there ever a Genesis keyboard like there was for Famicom?) we could have a Unix-y sort of OS for Mega CD.

Even better, with an IDE interface and a RAM cart, we could boot off a hard drive ;)

Posted: Mon Mar 26, 2007 2:18 am
by Mask of Destiny
AFAIK, the Saturn PS/2 keyboard adapter should be electrically compatible with the Genesis. I started hacking a DB-9 connector onto one, but never finished.

Posted: Mon Mar 26, 2007 7:23 pm
by evildragon
Sega did make a keyboard for the Genesis at one point.. They also made a mouse too..

Posted: Mon Mar 26, 2007 7:52 pm
by Mask of Destiny
evildragon wrote:Sega did make a keyboard for the Genesis at one point.. They also made a mouse too..
The mouse was released and I own one, but AFAIK a keyboard wasn't. They may have developed a prototype, but it was never available for sale.

Posted: Mon Mar 26, 2007 8:21 pm
by evildragon
Mask of Destiny wrote:
evildragon wrote:Sega did make a keyboard for the Genesis at one point.. They also made a mouse too..
The mouse was released and I own one, but AFAIK a keyboard wasn't. They may have developed a prototype, but it was never available for sale.
they did release a keyboard, it was only released in Japan though, no where else...

EDIT: This is the best information I can pull up right now.. When I get back later tonight I'll continue digging up information..

http://www.brouhaha.com/~eric/pic/segakb.html

Posted: Mon Mar 26, 2007 8:48 pm
by Mask of Destiny
According to this FAQ, it was never released even in Japan: http://www.classicgaming.com/museum/faqs/megadfaq.shtml

Given how infrequently it's mentioned compared to the Meganet Modem (which is quite obscure), I suspect it was indeed cancelled before release.

Anyway, last I checked the Saturn keyboard adapters were easy to find and quite cheap on eBay.

Posted: Mon Mar 26, 2007 8:55 pm
by evildragon
Mask of Destiny wrote:According to this FAQ, it was never released even in Japan: http://www.classicgaming.com/museum/faqs/megadfaq.shtml

Given how infrequently it's mentioned compared to the Meganet Modem (which is quite obscure), I suspect it was indeed cancelled before release.

Anyway, last I checked the Saturn keyboard adapters were easy to find and quite cheap on eBay.
i could have sworn i seen it.. it was black, kinda small, and i remember it having blue on it..

Posted: Mon Mar 26, 2007 9:52 pm
by commodorejohn
Perhaps it was the keyboard from a Sega Teradrive? Was it with a computer or a Genesis proper?

(I saw a Teradrive at a Wal-Mart in Mexico - had I known how rare they were at the time, I would've snapped it up, but sadly I thought someone had just thrown a Genesis into a PC case. Argh.)

Posted: Tue Mar 27, 2007 1:55 am
by evildragon
commodorejohn wrote:Perhaps it was the keyboard from a Sega Teradrive? Was it with a computer or a Genesis proper?

(I saw a Teradrive at a Wal-Mart in Mexico - had I known how rare they were at the time, I would've snapped it up, but sadly I thought someone had just thrown a Genesis into a PC case. Argh.)
i know it wasn't the terradrive...