N
N
ninacarrot2011-05-30 22:24:04
ZX Spectrum
ninacarrot, 2011-05-30 22:24:04

ZX Spectrum + *nix

For those who are in the tank, I explain: there are even nix-systems for coffee makers, but there is still none for Speccy, adored by many.

For experimental purposes, you can write a simple unix-like system for Speccy (with a minimum of 48 KB of RAM - 16 KB for the OS and another 16 KB for running processes), but the question is: is it necessary / interesting for someone else besides me ?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tzlom, 2011-05-30
@tzlom

it is necessary - no, the realities are such that units have specs (emulators do not count)
interesting - very, the process is non-trivial and there may be many unexpected solutions and approaches
, so if you want - go for it, but do not hope that they will use it, they will just say "Wow, cool"

V
vinxru, 2011-05-31
@vinxru

Find some old version of UNIX written in C and using no more than 48 KB of RAM. I think it's real. It remains only to implement four drivers (screen, keyboard, sound) and compile.
Only the standard ZX-spectrum does not have a disk and a local network. I have no idea what this UNIX will do :)
We need to take the newer Spectrum, for example, my +3. It has both RS-232 for LAN and a floppy drive.
I foresee an offer to take the latest creations of NedoPC (processor of tens of megahertz, megabytes of RAM, hard disk, high screen resolution). Personally, I do not consider them Spectrum.
And I do not advise writing your own UNIX. Since we will not succeed in anything similar to modern Linux. Very little can be programmed in 16 KB. 16 Kb will not even fit the help displayed by the --help key.

J
Jazzist, 2011-05-31
@Jazzist

Interesting, probably for scientific purposes.
You don’t have to “write” much, you can port ready-made solutions. For example DSL

Y
Yoel, 2021-10-15
@Yoel

There are two options here: reproduce or port Lunix for Commodore 64 or UZIXfor MSX ("Yamaha"). The first option corresponds to the resources of a conventional Sinclair, and the Sinclair is even more powerful: in the Commodore 64, the MOS 6510 processor operates at a speed of 1 megabyte, although with a lower average number of cycles per instruction, the ROM takes 20k there, although there is a video card with a text mode, which in principle allows reduce the video memory to 1k, however in normal graphics mode only 38k of memory is available. The second option probably makes sense to rewrite for the ZX Spectrum 48, and even better on the Scorpion ZS-256 Turbo + or another model with a memory of 256k or more. The processor on the Yamaha is the same Z80, and the memory pages are switched through the port, as in the ZX Spectrum 48, so it should be relatively easy to transfer this.
It is necessary to make a reservation right away that only a minimal subset of Unix can be written on machines of this level. However, there is even a relatively complete web server for Lunix. For a standard ZX Spectrum 48, in principle, you can create your own interface for connecting to the Internet via a sound port, although such a miracle will work at best at a modem speed and will constantly squeal when it exchanges information via TCP / IP. Although, perhaps, it is possible to bring the speed of information exchange with the interface to ultrasound. But since the internet works on the Commodore, obviously it's possible on the Sinclair as well. And if in a model with external devices, then even more so.
There is also a problem with memory protection. Both of the above systems do not contain any means for this, although the memory pages in the Yamaha or the same ZX Spectrum 128 are, as it were, partially protected by the fact that a random glitch is unlikely to switch them and write something there. Without a major modification to the regular ZX Spectrum 48, this is not possible. Is it only possible to write a C compiler, which already at the program level somehow forbids writing where this process is not supposed to.
It would be possible to modify the ZX Spectrum 128 model like this:
1. Add a simple non-maskable interrupt controller so that it runs, say, 1000 times per second.
2. Bind a separate system ROM and one special page of RAM to a non-maskable interrupt so that it is only available during the interrupt and nothing else. The port through which the frequency of the NMI is controlled must also be available only during it.
3. When the machine is turned on, the system ROM should automatically start with its own RAM page, interrupts are first disabled, and the OS writes everything it needs to its page. After that, the pages are switched to conventional ROM / RAM, and the NMI controller is turned on through the port. After that, the system will monitor everything that happens in the car in a protected mode.
All this, in principle, is no more complicated than the Sinclair variants with a disk drive, etc. You only need to consider devices that independently enable the NMI. For example, the magic button can not only reset the memory to the drive, but turn on the superuser monitor.
I've been wondering for a long time when someone will make such a thing. ))

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question