Murmulator OS (for user)

As I have already written in my other articles, Murmulator is a single-board ultra-cheap microcomputer based on the Raspberry Pi Pico board (see https://habr.com/ru/articles/839960/).

Murmulator v.1.3

Murmulator v.1.3

I have already published a superficial description of the Murmulator OS (MOS) guts (see the article https://habr.com/ru/articles/839976/). But there I paid more attention to the technical side of things. Let's now look at it from the user's point of view.

The official source of releases and updates for MOS is the site https://github.com/DnCraptor/murmulator-os/releases. Download the archive from there (like murmulator-os-0.2.6.1-VGA-HDMI-RGB.zip) and choose the firmware that suits your equipment (.uf2 file). The order of video drivers matters. If your main output is VGA, use the firmware that starts with this abbreviation. If you have a sound chip (DAC) on your Murmulator board connected via i2s (available on Murmulator v.1.4 and as add-on modules), use the firmware that has this substring in its name, for example, murmulator-os-0.2.6-i2s-HDMI-VGA-RGB.uf2 – means that the sound is output via i2s (TDA1387T and PCM5102A DAC are supported), and the image is by default in HDMI.

NB All further information is valid for MOS version 0.2.6.

If you already have a Murmulator, you should be able to imagine how it is flashed – connect it to a computer via USB, drop it into the disk that appears (usually has the volume label RPI-RP2) .uf2 firmware file and… that's it. The microcomputer will launch the installed firmware. For MOS, an additional step is required – to provide the operating system with working utilities, and in particular – a command processor. To do this, copy the MOS folder from the downloaded archive to the root of your SD card. If you update the firmware, do not forget to update the utilities that come with it. The SD card must be formatted as FAT, with a cluster size of 4 KB.

MOS without SD card starts in a special mode – hardware testing mode. The main task of this mode is to check that the signals from the keyboard and/or joysticks reach the microcontroller. It also displays information about the CPU frequency and the amount of memory of different types available to the OS…

OS Murmulator in testing mode

OS Murmulator in testing mode

If you did everything correctly, the default command processor, which is registered in config.sys (the file can be located in the root or in a folder /mos), as the value of a variable COMSPEC. In the distribution, this value is set to /mos/mci.e. Murmulator Commander will start by default (not to be confused with Midnight Commander).

Murmulator Commander

Murmulator Commander

Working with mc is not much different from working with any other file manager. The button Tab (Select with the joystick) you can move between panels, and with the button Enter (A joystick), as usual, we go inside the directories, or launch programs.

You can also use mcand as a command processor – just enter commands from the keyboard. For the command processor mode, there is a more convenient representation, which can be switched to from the keyboard with a combination of keys Ctrl+O.

MOS natively supports Russian language for input, output and storage of data. The code table is used for storage CP866 (compatible with IBM and MS DOS), i.e. files prepared in Windows and saved in UTF or Windows-1251 will display Russian characters incorrectly (files require recoding). To switch input modes, use the key Ctrl+Shift.

The most common use of Murmulator is to run emulators of various retro computers, a full list of which can be found on the website https://murmulator.ru/do. And, since MOS is a direct successor of the bootloader (see https://github.com/xrip/pico-launcher), which is designed to run these emulators, MOS supports all the same functionality. Launch .uf2 applications button Enter keyboard or button A joystick on the selected file.

In the process of flashing .uf2 all OS interrupts are disabled (a feature of this microcontroller), i.e. the display driver is also disabled at this time. The process can be observed only by the blinking of the LED on the board. At the end of the firmware, the LED goes out, and the microcomputer is supposed to reboot. If the reboot does not occur automatically (not yet fixed in version 0.2.6), a corresponding message is displayed that it is necessary to reboot it manually.

Completion of the RP2040 firmware process from MOS

Completion of the RP2040 firmware process from MOS

After rebooting, the corresponding emulator is expected to start (in the example above it will be pico-bk).

To return to MOS mode, you need to press and hold the key пробел, F11or the button SELECT joystick, during power supply, or microcomputer reboot.

If you need to record some firmware using “standard” means, you need to press and hold Enter, F12or the button START joystick, during power supply, or microcomputer reboot. This is the method to update the MOS, since rewriting the operating system “from within” the operating system itself is not yet supported, the MOS will consider the update as another emulator.

If you need to enable the secondary display driver, hold down the button Tab keyboard, or button А on the joystick, at the moment of power supply or reboot. To switch to the tertiary driver – hold the button B on the joystick, respectively.

When launched mcthe MOS communication mode with an external computer for file transfer is available. To start this mode, press Alt+F10 or SELECT+B. An additional USB drive will appear on the computer, which is a reflection of the SD card of the Murmulator. The card is available for both writing and reading. The correct way to close this mode is to press “Eject disk” on the computer side. An emergency disconnection is also possible from the side mcby pressing again Alt+F10. The same is available from the command line using the commands usb on / usb off

Sometimes you need to enable file transfer mode before the OS loads. Press and hold the button Home keyboards, or SELECT+B joystick. You can exit this mode only by rebooting the microcomputer.

The main difference between MOS and a bootloader is the ability to launch standard MOS applications, not full-fledged ones. .uf2-firmware, but specially developed programs for MOS. In particular, from the kit mc there is a utility mceditorwhich is convenient for editing configuration files. For training and entertainment, a BASIC interpreter is available – a standard program basicand for playing music in PCM format – the program wav.

Editing the ZX Spectrum Emulator Configuration by technocat

Editing the ZX Spectrum Emulator Configuration by technocat

The basic set of utilities can be described briefly:

cls – clear the screen.

dir / ls [dir] – show a list of files in the directory. Ctrl+C interrupts output.

rm / del / era [file] – delete a file (or empty directory).

cd [dir] – set the current directory.

cp [file1] [file2] – copy file1 with the name file2.

mkdir [dir] – create a directory.

cat / type [file] – display the file on the screen. Ctrl+C interrupts output.

rmdir [dir] – delete directory (recursively).

elfinfo [file] – show detailed information about elf-file (all utilities are elf files) – useful for developers.

psram – displays basic information about the installed PSRAM chip and performs a simple test of linear reading and writing to the memory. Ctrl+C interrupts the test.

swap – displays basic information about the swap file organization and performs a simple test of linear reading and writing to memory. Ctrl+C interrupts the test.

sram – performs a simple test of linear reading and writing to SRAM memory. Ctrl+C interrupts the test.

cpu – displays the current processor frequency and internal bus dividers, cpu [NNN] – change the processor frequency to the specified one [NNN] MHz (the device may hang as a result of this operation); cpu [NNN] [n] [m] – extended overclocking syntax (use only if you know what you're doing). Default CPU frequency is 378 MHz.

mem – display the current state of the microcomputer memory.

set – view or set environment variables.

export – put a variable into the system context.

mode [#] – set video mode.

Supported video modes:

VGA:

  • 0 – 53×30 – text only (mode left for compatibility);

  • 1 – 80×30 – text only, real screen resolution – 640×480@60;

  • 2 – 100×37 – text only, real screen resolution – 800×600@60;

  • 3 – 128×48 – text only, real screen resolution – 1024×768@60;

  • 4 – 256x256x2-bit – graphics only, real screen resolution – 1024×768@60;

  • 5 – 512x256x1-bit – real screen resolution – 1024×768@60;

  • 6 – 320x240x4-bit – real screen resolution – 640×480@60;

  • 7 – 320x240x8-bit – real screen resolution – 640×480@60;

  • 8 – 640x480x4-bit – eats up a lot of memory;

HDMI:

  • 0 – 53×30 – text only, real screen resolution – 640×480@75

  • 1 – 80×30 – text only, real screen resolution – 640×480@75

  • 2 – 320x240x4-bit – real screen resolution – 640×480@75;

TV (RGB):

less – display another command page by page, for example ls | less. Use Ctrl+C for exit.

hex [file]/[@addr] – display a hexadecimal dump of a file or memory location. Use Ctrl+C to interrupt.

tail [-n #] [file] – display the last n (default – 10) lines from the file. Use Ctrl+C to interrupt.

usb [on/off] – mount SD-card as USB-drive.

mc – Murmulator Commander – a multifunctional command processor with a pseudo-graphical file manager shell, supports copy, move and delete operations for multiple files simultaneously (use the Insert button to select objects).

mcview [file] – Murmulator Commander Viewer – an application for viewing text files, supports page scrolling with the Page Up / Page Down buttons.

mcedit [file] – Murmulator Commander Editor – text file editor.

mv [from_file_name] [to_file_name] – move or rename the file.

gmode [#] – simple test of graphics mode.

font [width] [height] – display the current font or set another, for example: font 6 8

blimp [n1] [n2] – a simple test of the tweeter's sound channel. [n1] – number of cycles, [n2] – number of OS ticks (ms) between high and low beep level (1/hour). Does not work in i2s mode.

wav [file] [bytes] – simple player .wav-files. Use Esc or Ctrl+C to interrupt. Parameter [bytes] allows you to reserve some memory for other tasks. Otherwise, the player uses all available memory, leaving only 512 bytes for any unexpected things.

basic [file] – a small basic interpreter (developed by Stefan Lenz, see https://github.com/slviajero/tinybasic). Use Ctrl+C to interrupt. Has an interactive mode. Graphic functions are available only in graphic modes. For VGA recommended mode 6for HDMI – mode 2.

Running the standard plot.bas test from the test suite at https://github.com/slviajero/tinybasic

ps – list of “processes” (OS kernel tasks – FreeRTOS).

kill [n] – send SIGKILL to the “process” (FreeRTOS task), [n] – “process” number, see ps.

dhrystone [n] [kHz] – a simple integer processor performance test (see https://github.com/DnCraptor/arm_benchmarks)

whetstone [n] – simple floating point performance test (see https://github.com/DnCraptor/arm_benchmarks)

cmd – a lightweight version of the command processor, which does not have a pseudo-window mode, but only a command line mode. It is useful when there is an acute shortage of memory, since it is much more compact than the heavyweight mc.

Standard output redirection operations are also supported, for example:

mem > mem.info – will create a file mem.info and writes all the command output there mem except for error messages (redirects like mem 2> mem.err not supported yet), and the command sram >> mem.info – will add the result of the command execution to the existing file sram.

To run the program in hidden mode, use the symbol & – detach (detach) with output redirection. For example:

wav /music/8t-sonata.wav 50000 > wav.log & – the command output will be redirected to a file, the command itself will be executed in the background, while reserving 50,000 bytes for other applications.

Forward and backward slashes are equivalent for MOS, i.e. You can write cd / And cd \and the same operation will be performed.

Uppercase and lowercase letters in file names are equivalent.

If you need to use special characters (such as spaces) in file names, use double quotes: cd "/my folder"

In command processor mode, autocompletion by button is supported Tab and navigation with up/down arrows through the history of executed commands.

The mode for entering special characters by their code is also available by holding down AltFor example Alt 4 8 0 – ° – degree symbol.

M-OS system variables

System variables can be set in a file /mos/config.sys:

BASE – base (home) directory for the OS
SWAP – installations swap-file. For example, SWAP=/pagefile.sys 8M 16K 4K – set the swap file to 8 MB with a 16 KB window in SRAM and 4 KB pages each.
COMSPEC – path to the command processor, for example: /mos/mc or /mos/cmd
PATH – list of directories for searching applications, separators – : ; ,
GMODE – set the default graphics mode, for example GMODE=6 for VGA driver – recommended mode for testing basic-applications.
TEMP – directory for temporary files.

This is where the short tutorial on MOS can end, if you have any questions, ask them below, perhaps I will include the answers in the next article on Murmulator.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *