Operating System

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

MERLiX
Newbie
Posts: 8
Joined: Mon Jan 15, 2007 10:45 pm

Operating System

Post by MERLiX » Thu Mar 15, 2007 3:40 am

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))

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Mar 15, 2007 9:08 am

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 :)

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Thu Mar 15, 2007 8:43 pm

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.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Mar 16, 2007 6:44 am

Stupid question: why would you need an OS between your program and hardware ? I've always liked to manipulate everything directly
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Mar 16, 2007 9:42 am

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 :)

ob1
Very interested
Posts: 463
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

Post by ob1 » Fri Mar 16, 2007 10:27 am

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

commodorejohn
Very interested
Posts: 70
Joined: Tue Mar 06, 2007 6:30 pm

Post by commodorejohn » Sat Mar 24, 2007 11:35 pm

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 ;)

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Mar 26, 2007 2:18 am

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.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Mon Mar 26, 2007 7:23 pm

Sega did make a keyboard for the Genesis at one point.. They also made a mouse too..

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Mar 26, 2007 7:52 pm

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.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Mon Mar 26, 2007 8:21 pm

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

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Mar 26, 2007 8:48 pm

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.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Mon Mar 26, 2007 8:55 pm

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..

commodorejohn
Very interested
Posts: 70
Joined: Tue Mar 06, 2007 6:30 pm

Post by commodorejohn » Mon Mar 26, 2007 9:52 pm

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.)

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Tue Mar 27, 2007 1:55 am

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...

Post Reply