Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Operating system for SMS

Reply to topic
Author Message
  • Joined: 06 Jun 2019
  • Posts: 4
  • Location: Quebec City, Canada
Reply with quote
Operating system for SMS
Post Posted: Thu Jun 06, 2019 12:24 am
Last edited by vdupras on Tue Jul 02, 2019 8:38 pm; edited 1 time in total
Hi everyone. I just discovered this website and it looks like a really good ressource for development targeting the SMS.

I'm developing a new operating system for z80 with extremely minimal system requirements and I'm looking into making the SMS and also the MD a viable target for it, I thought you might be interested in looking it up: https://collapseos.org/

It features a z80 assembler written in z80 assembler that weights less than 4Kb and self-compiles with less than 16Kb RAM (yes, I know, a bit too much for the SMS, but I hope to be able to pull some tricks up my sleeve to make it work). The shell/kernel itself runs on just a few bytes of memory.

The project is already pretty advanced and runs well on a RC2014 Classic ( https://rc2014.co.uk/ ) but I lack SMS knowledge. Of course, I expect to learn on the fly, but if the project is of interest to some of you SMS experts, then we can probably have some fun working on this together.

Update: it works! See https://github.com/hsoft/collapseos/tree/master/recipes/sms
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 487
  • Location: Spain
Reply with quote
Post Posted: Thu Jun 06, 2019 6:13 am
Wow, sound totally interesting, although my knowledge about OS's has decreased a lot since my college days...
In any case, taking a look at what Sega Basic does can be helpful to deal with the memory limitations.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12820
  • Location: London
Reply with quote
Post Posted: Thu Jun 06, 2019 6:42 am
Modern assemblers have a lot of helpful features but it should be possible to make a single pass assembler that only needs as much RAM as it needs to track forward references as it assembles - or you can disallow forward references. I'm not sure about typing assembly using a D-pad though...
  View user's profile Send private message Visit poster's website
  • Joined: 06 Jun 2019
  • Posts: 4
  • Location: Quebec City, Canada
Reply with quote
Post Posted: Thu Jun 06, 2019 10:57 am
An assembly without forward references is too barebone for me :) Having to jump with numerical offsets for every forward jump? ouch.

Also, I don't see how it would free the assembly from keeping symbols in memory: you still need to keep backward references in memory.

As for input, I wasn't planning on using a D-pad :) I was rather planning on hacking an existing keyboard, cut the cord, hook it to a 9-pin connector and develop a driver for this.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Sep 2018
  • Posts: 147
Reply with quote
Post Posted: Thu Jun 06, 2019 12:57 pm
Hmm interesting, I have quite a few questions.
Do you plan on using a cart or making some kind of floppy add-on?
Do you plan on using a memory management kernel and running drivers in on cart ram to keep system ram open for applications?
What about time keeping as well?
  View user's profile Send private message
  • Joined: 06 Jun 2019
  • Posts: 4
  • Location: Quebec City, Canada
Reply with quote
Post Posted: Thu Jun 06, 2019 1:17 pm
I'm happy to answer your questions, keep them coming!

The goal is not to make an OS for the SMS, but rather target the SMS as a proof of concept for something very minimal. Also (and maybe more importantly), the SMS/MD have been very widely sold and are very "scavenge-friendly". Post collapse people finding a SMS/MD will have much of what they need to build themselves a computer that can program microcontrollers (the end goal of this OS).

Considering this, it's possible that Collapse OS is of limited interest to many people here, but nevertheless, I thought that the idea of running a full z80 assembler on a SMS might tap into the interests of some of you.

To keep the code simple, compact and self contained, I limit the scope of it. This OS is strictly to edit text files, binary files, assemble code, program microcontrollers and flash memory.

I'm not planning on adding time keeping functions as I don't see how it fits in that scope.

I bought myself a used SMS, MD and a everdrive. For now, the everdrive will facilitate my work as I can use a SD card for the MD, but yes, soon enough I'll build myself a ROM cart by popping up the ROM of an existing cart and place a eeprom socket in there.

On-cart RAM was one of the things I wanted to try in the "tricks up my sleeve" in my first comment :)

As for memory management, if you mean paging to go over the 64K limit, I'd prefer avoiding this to keep things simple. If you mean a mechanism to allow "userspace" programs assembled independently of the kernel to run from RAM, Collapse OS already supports this.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Sep 2018
  • Posts: 147
Reply with quote
Post Posted: Thu Jun 06, 2019 3:12 pm
Interesting, I've had similar ideas for the Mega Drive but more for novelty rather than absolute functionality. It ran on the Mega CD and had things baked into its ROM like a simple game (snail maze clone lol), text editor, and paint program. Its features allowed reading incoming dump from the P2 port and saving them on a flash/sram cart, it could also save paint files or text documents in sram as well. I planned on having a Music Tracker and z80 asm compiler but at the time I couldn't get the flash/sram cart writes and reads to work very well and couldnt find the time to write a compiler or tracker. I called it Gemini DOS to fit the Sega space theme, but the projects pretty dead. I'm sure I could complete it now but the code is a mess and would probably need a total rewrite.

Either way, good luck on your project! stuff like this is always interesting and its fun to see people try and turn a lot of these old systems into full computers.
  View user's profile Send private message
  • Joined: 06 Jun 2019
  • Posts: 4
  • Location: Quebec City, Canada
Reply with quote
Post Posted: Tue Jul 02, 2019 8:38 pm
Update: it works! I've just finished making Collapse OS run on a Genesis with an Everdrive MD, controlled with a D-pad.

The system is a barebone shell, but otherwise fully functional. It can peek and poke memory and ports.

Using a D-pad to drive a shell isn't very fun, but I haven't finished my keyboard adapter yet.

Also, d-pad support means that soldering isn't a requirement to run Collapse OS on a SMS.

Instructions at https://github.com/hsoft/collapseos/tree/master/recipes/sms
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!