DnCraptor / murmulator-os

ZX Murmulator OS
MIT License
6 stars 1 forks source link

murmulator-os

Murmulator OS v.0.3.3

Hardware needed

Raspberry Pi Pico (RP2040)
Sources are "in-progress" state and testing now only on Murmulator devboard with VGA/HDMI/TV(RGB) output.
Simplest Murmulator schema is availabele there: https://github.com/AlexEkb4ever/MURMULATOR_classical_scheme
Murmulator Schematics VGA OR hdmi

This Archive

Extract MOS folder to your SD-Card to /MOS folder.
Обзор на русском

Optional

There are several extra features supported, like external PSRAM and/or DAC, are availbel on more featured Murmulator versions.
Let use translate from russian on https://murmulator.ru/types site, for case you want to get more info.

Current state

RP2040 core 0: starts FreeRTOS (based on https://github.com/FreeRTOS/FreeRTOS-Community-Supported-Demos/tree/3d475bddf7ac8af425da67cdaa2485e90a57a881/CORTEX_M0%2B_RP2040)
RP2040 core 1: starts VGA/HDMI/TV(RGB) driver (based on Murmulator comunity version last used before in https://github.com/xrip/pico-launcher)

MOS build hints:

OS syscalls

TBA

Murmulator OS tips

Murmulator OS (M-OS to make it short) has no specific levels of execution like kernel and application. All code parts (kernel/application) executes on the same level (like it was in good old DOS).

M-OS uses a mono-kernel architecture, it means we have no separate kernel modules, all kernel related code is precompiled, prelinked and preinstalled on hardware. Only application level code is replaceable while kernel is working.

M-OS is based on FreeRTOS port for RP2040 (Base version: FreeRTOSv202212.01. Examples used: https://github.com/FreeRTOS/FreeRTOS-Community-Supported-Demos/tree/3d475bddf7ac8af425da67cdaa2485e90a57a881/CORTEX_M0%2B_RP2040) which is running on core#0 of the RP2040. No SPI support for now. System time slice (tick) used by FreeRTOS = 1ms.

M-OS manages access to

define M_OS_API_SYA_TABLE_BASE (void*)0x10001000ul

static const unsigned long const _sys_table_ptrs = M_OS_API_SYA_TABLE_BASE;
typedef void (
draw_text_ptr_t)(const char *string, uint32_t x, uint32_t y, uint8_t color, uint8_t bgcolor);

define _draw_text_ptr_idx 25

define draw_text ((draw_text_ptr_t)_sys_table_ptrs[_draw_text_ptr_idx])


So it will be possible to call draw_text the same way as for case graphics.h and VGA/HDMI/TV driver exists, but without it.

M-OS commands

cls - clear screen
dir / ls [dir] - show directory content. Use Ctrl+C to interrupt.
rm / del / era [file] - remove file (or empty directory)
cd [dir] - change current directory
cp [file1] [file2] - copy file1 as file2
mkdir [dir] - create directory
cat / type [file] - type file. Use Ctrl+C to interrupt.
rmdir [dir] - remove directory (recurive)
elfinfo [file] - provide .elf file info
psram - provide some psram info. Use Ctrl+C to interrupt.
swap - provide some swap info. Use Ctrl+C to interrupt.
sram - reference speed of swap base SRAM. Use Ctrl+C to interrupt.
cpu - show current CPU freq. and dividers, cpu [NNN] - change freq. to NNN MHz (it may hang on such action)
mem - show current memory state
set - show or set environment variables
mode [#] - set video-mode, for now it is supported:

    • 0 - 53x30, 1 - 80x30, 2 - 100x37, 3 - 128x48, 4 - 256x256x2-bit, 5 - 512x256x1-bit, 6 - 320x240x4-bit, 7 - 320x240x8-bit, 8 - 640x480x4-bit - for VGA
      0 - 53x30 and 1 - 80x30, 2 - 320x240x4-bit for HDMI
      0 - 53x30 for TV (RGB)
  • less - show not more than one page of other command in pipe, like ls | less. Use Ctrl+C for exit.
    hex [file]/[@addr] - show file or RAM as hexidecimal dump. Use Ctrl+C to interrupt.
    tail [-n #] [file] - show specified (or 10) last lines from the file. Use Ctrl+C to interrupt.
    usb [on/off] - start a process to mount murmulator CD-card as USB-drive (NESPAD [B] button in mc)
    mc - Murmulator Commander, use [CTRL]+[O] to show console, and [CTRL]+[Enter] for fast type current file path
    mcview [file] - Murmulator Commander Viewer
    mcedit [file] - Murmulator Commander Editor
    mv [from_file_name] [to_file_name] - move/rename the file
    gmode [#] - simple graphics mode test
    font [width] [height] - show/set font size for graphics modes, like font 6 8
    blimp [n1] [n2] - simple sound test. [n1] number of cycles, [n2] OS ticks between high and low levels (1/freq.)
    wav [file] - simple .wav files player (tested on 8 kHz 1-channel 16-bit files). Use Ctrl+C to interrupt.
    basic [file] - tiny basic interperator implementation (by Stefan Lenz, see https://github.com/slviajero/tinybasic for more info). Use Ctrl+C to interrupt.
    ps - list of "processes" (FreeRTOS tasks).
    kill [n] - send SIGKILL to a "process" (FreeRTOS task), [n] - task number returned by the ps utility.
    dhrystone [n] [kHz] - small performance test (see: https://github.com/DnCraptor/arm_benchmarks)
    whetstone [n] - MIPS (whetstone) performance test (see: https://github.com/DnCraptor/arm_benchmarks)

    [cmd] > [file] - output redirection to file
    [ENTER] - start command / flash and run .uf2 file in "demo" format (NESPAD [A] button in mc)
    [TAB] - autocomplete
    [BACKSPACE] - remove last character
    [CTRL]+[SHIFT] - rus/lat
    [CTRL]+[ALT]+[DEL] - reset (NESPAD [SELECT]+[B])
    [CTRL]+[TAB]+[+] - increase CPU freq.
    [CTRL]+[TAB]+[-] - decrease CPU freq.
    [ALT]+[0-9]+[0-9]+[0-9] - manual enter some character by its decimal code (CP-866 codepage)
    [ALT]+[Enter] - try to use flasg instead of RAM to launch application (from mc)

    M-OS system variables

    BASE - base directory with commands implementations
    SWAP - swap settings
    COMSPEC - a path to command interpretator
    PATH - list of directories to lookup for applications
    GMODE - set initial graphics mode
    TEMP - specify a folder with temporary files

    Boot-loader mode

    If uf2 application was started from M-OS, and such application is not designed for M-OS, it is possible to return to M-OS only via reboot:
    Press [F10] (DPAD [START]+[SELECT]) and hold on the Murmulator reset or power-on, in this case uf2 application will be repaired you will return to last saved on Flash.
    Press [F11] or [SPACE] (DPAD [SELECT]) and hold on the Murmulator reset or power-on, in this case uf2 application startup will be skip and you will return to the M-OS. And in case DPAD [B] button is also hold, it automounts SD-Cart as USB-drive.
    Press [F12] or [ENTER] (DPAD [START]) and hold on the Murmulator reset or power-on, in case you want to start USB-drive mode prior starting M-OS.
    Press [TAB] (DPAD [A]) and hold on the Murmulator reset or power-on, in case you want to replace default output by seconday driver.
    Press DPAD [B] and hold on the Murmulator reset or power-on, in case you want to switch default output to third output.
    Press [HOME] and hold on the Murmulator reset or power-on, in case you want start USB-drive mode prior starting M-OS.
    Press [ESC] and hold on the Murmulator reset or power-on, to boot (skip waiting for other key-cases).