Repository navigation
MyOS v1.2.0 - Hardware Information, Scrollback and Command History
MyOS v1.2.0 turns the shell into a much more useful tool. The kernel can now read the boot information from GRUB, identify the CPU, list PCI devices and read the clock. The console gains a working cursor and scrollback, and the shell gains command history.
MyOS is a minimal 32-bit x86 hobby operating system written in C and assembly.
What's New
System and Hardware Information
meminfo: shows lower and upper memory, where the kernel is loaded, and the full memory map reported by GRUB, with the total usable RAM.cpuinfo: shows the CPU vendor and model name, family/model/stepping, supported features (SSE, AVX, and others), and whether MyOS is running inside a virtual machine.lspci: scans the PCI bus and lists devices such as network, storage and graphics controllers, with vendor and device IDs.sysinfo: a one-screen summary of the OS, CPU, memory, bootloader, PCI device count and virtualization.date: now reads the real date and time from the RTC clock instead of reporting that it is unavailable.
Console
- Working cursor: the blinking hardware cursor now follows the text as you type. It is hidden while you are scrolled back.
- Scrollback: the console keeps 275 lines of history. Use
PgUpandPgDnto scroll, andHomeandEndto jump to the oldest and newest output. A[ SCROLLBACK -N ]label shows while you are looking at old output, and typing returns you to the live screen. - Colors: headings, labels, the prompt and error messages are now colored.
- Better backspace: backspace now works correctly across a line that wraps onto the next row.
Shell and Keyboard
- Command history: press
UpandDownto recall previous commands. The newhistorycommand lists them (the last 16 are kept). - More keys supported: arrow keys, Page Up/Down, Home, End and Delete are now decoded, and Caps Lock works.
reboot: now restarts the computer through the keyboard controller instead of printing a not-implemented message.- Updated
help: lists every command and the navigation keys.
Build System
make isobuilds the bootable ISO andmake runbuilds it and starts QEMU. The GRUB tool is detected automatically (grub2-mkrescueorgrub-mkrescue).- The kernel version is now consistently reported as 1.2.0 by
versionandabout.
Command Reference
| Command | Description |
|---|---|
help |
List available commands |
about |
About MyOS |
version |
Show the kernel version |
sysinfo |
System summary |
meminfo |
Memory size, kernel location and memory map |
cpuinfo |
CPU vendor, model, features and virtualization |
lspci |
List PCI devices |
date |
Date and time from the RTC clock |
history |
Commands typed so far |
echo <text> |
Print text to the screen |
clear |
Clear the screen and scrollback |
reboot |
Restart the computer |
halt / shutdown |
Halt the CPU |
Keyboard Shortcuts
| Key | Action |
|---|---|
Up / Down |
Recall previous commands |
PgUp / PgDn |
Scroll the screen up or down |
Home / End |
Jump to the oldest or newest output |
Backspace |
Delete the previous character |
Known Limitations
- Memory management: the memory map is read and displayed, but there is no page allocator, heap or virtual memory manager yet.
- Line editing: the Left and Right arrow keys do not move inside the command line yet. Use Backspace to correct mistakes.
- Clock:
dateshows the RTC time, which is usually UTC (in a virtual machine it follows the host clock). There is no timezone support. - PCI names:
lspcirecognizes only common vendors and device classes. Others are shown as "Unknown vendor" or "Other device". - Scrollback size: 275 lines.
clearalso erases the scrollback. - Panic handler:
kernel_panicexists but is not yet called automatically by other kernel components. - Interrupts: the keyboard is still read by polling. Interrupt-driven input is planned.
Downloads
| File | Description |
|---|---|
myos-1.2.0.iso |
Bootable ISO image |
myos-1.2.0-source.zip |
Complete source code, with build instructions in the README |
SHA256SUMS.txt |
SHA-256 checksums to verify the downloads |
Quick Start
QEMU
qemu-system-i386 -cdrom myos-1.2.0.iso -m 128MOnce it boots, try sysinfo, meminfo, cpuinfo and lspci.
VirtualBox / VMware: create a 32-bit Other/Unknown virtual machine with at least 64 MB of RAM and no virtual hard disk, attach myos-1.2.0.iso as the optical drive, and start the virtual machine.
Real hardware: write the ISO image to a USB drive or CD and boot in BIOS / legacy mode.
Note: always take care when writing images to physical drives. Selecting the wrong device can erase existing data.
Verify Your Download
sha256sum -c SHA256SUMS.txtBuild from Source
Extract myos-1.2.0-source.zip and open a terminal in the project directory.
# Build the kernel
make clean
make
# Build the bootable ISO
make iso
# Build and run in QEMU
make runIf you prefer the manual steps:
cp kernel.elf iso/boot/kernel.elf
grub2-mkrescue -o myos.iso iso # or: grub-mkrescue -o myos.iso iso
qemu-system-i386 -cdrom myos.iso -m 128MBuild requirements: GCC with 32-bit compilation support, GNU Make, GRUB utilities, xorriso and QEMU.
Fedora:
sudo dnf install gcc glibc-devel.i686 make qemu-system-x86 grub2-tools grub2-tools-extra xorrisoDebian / Ubuntu:
sudo apt install build-essential gcc-multilib grub-pc-bin xorriso mtools qemu-system-x86Upgrading from v1.1.0
No changes to the boot process are needed. v1.2.0 adds new source files (multiboot.c, cpu.c, pci.c, rtc.c and keys.h) and updates boot.S, kernel.c, console.c, keyboard.c, shell.c, linker.ld and the Makefile. Replace your project with the v1.2.0 source archive and rebuild with make clean && make.
Full Changelog
MyOS v1.1.0 to v1.2.0 changelog
License
MyOS is released under the MIT License.