MenuetOS 1. History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2. Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.1 Multiprocessor support (SMP) . . . . . . . . . . . . . . . . . 2 2.2 Graphical user interface (GUI) with transparency . . . . . . . 3 2.3 Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.4 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.5 USB (storage, webcam, TV, printer, midi, mouse, keyboard) . . 6 2.6 Time critical process support . . . . . . . . . . . . . . . . 7 2.7 Applications & drivers . . . . . . . . . . . . . . . . . . . . 8 3. Application programming . . . . . . . . . . . . . . . . . . . . . . 9 3.1 Events (window, keys, buttons, etc.) . . . . . . . . . . . . . 10 3.2 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3 64bit and 32bit applications & system call support . . . . . . 12 4. Driver programming . . . . . . . . . . . . . . . . . . . . . . . . 13 4.1 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.2 Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.4 Midi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1. History The first version of MenuetOS was written by me, Ville M. Turjanmaa, at year 2000. The inspiration came from scripting languages, which at the time, were using more and more cpus power. This excessive cpu usage inspired me to go to the other extreme and writing an operating system fully in assembly. I released the first MenuetOS version 16.5.2000. The first version was 32bit and after a few releases, I decided to release the system under GPL. By 2002 Menuet started to be a fully functional system with graphical user interface, networking, games and so on. Also my principle from the beginning was that Menuet should fit in a 1.44 Mb floppy so that it would be easy for people to try it. Another principle has always been to avoid kernel bugs. In the early years I had the pleasure of working with many talented and great programmers. In year 2005, I released the first 64bit Menuet version and chose a closed source license because of some 2004 copyright violations for the 32bit version. So current MenuetOS version is 64 bit and supports modern computers with multiprocessors and window transparency. The 64bit version can run 64bit and 32bit applications. 2. Features So, MenuetOS is an operating system in development for PC, written fully in assembly language (64bit and 32bit). Features include pre-emptive and real-time multitasking with multiprocessor support and Graphical User Interface. Menuet64 is released under License and Menuet32 under GPL. Menuet supports both 64 and 32bit x86 assembly applications and programming for faster, smaller and less resource hungry applications. Menuet isn't based on other operating systems, nor has it roots within UNIX or the POSIX standards. The design goal has been to remove the extra layers between different parts of an OS, which normally complicate programming and create bugs. Menuets kernel is written fully in assembly, so it quite easily outperforms systems that are written in other languages. For example, the GUI with transparency is calculated in the main x86-64 CPU, avoiding compatibility problems with graphics cards. Menuet's application structure isn't specifically reserved for assembly programming since the header can be produced with practically any other language. However, the overall application programming design is intended for 64bit and 32bit assembly programming. Menuet programming is fast and easy to learn. Menuet's responsive GUI is easy to handle with assembly language. And Menuet64 is capable of running Menuet32 applications. 2.1 Multiprocessor support (SMP) MenuetOS supports multiprocessing with up to 32 CPUs. Multiprocessor threading can be controlled with system call 140. 2.2 Graphical user interface (GUI) with transparency Window shape and transparency can be controlled with system call 50 and overall transparency GUI options with system call 125. 2.3 Scheduler By default, Menuet scheduler tics at 1000 hz. Scheduler interval can be raised up to 100000 hz or 0.1 mhz with system call 241. 2.4 Networking MenuetOS supports different ethernet cards and application networking interface uses system calls 52 and 53. 2.5 USB (storages, webcam, TV, midi, mouse, keyboard) MenuetOS has support for various USB devices, like usb memory sticks and harddrives, webcams with video class support, selected set of TV tuners, musical instruments with midi interface, and of course mouses and keyboards. 2.6 Time-critical process support In default operating mode, Menuet uses pre-emptive multitasking at both application and system call side and process switching can occur almost any part of the process execution. However, in special cases it may be useful for a process to be executed exclusively in a CPU, without interruptions. The programmer can control the time-critical process execution with system call 240. 2.7 Mathematics library MenuetOS also includes an extensive mathematics library, including for example Fourier Transformation. These can be accessed with system calls 150 and 151. 2.8 Applications & drivers 64 bit MenuetOS has support for running both 64bit and 32bit Menuet applications. MenuetOS support both 64bit and 32bit systen calls. So you can quite easily upgrade your 32bit application to run on 64bit MenuetOS. All the current popular operating systems work in 64bit cpus. You can also switch between 64bit and 32bit modes within an application with system call 126. 3. Application programming 3.1 Events (window, keys, buttons, etc. ) MenuetOS applications run in a fully protected and pre-empted environment, where applications are contained within safe memory barriers. Application execution is based on events, where an event can be for example a key or button press. By default, three events are enabled for the application: window draw, key press and button press including scroll and menu selections. Other event types can be enabled with system call 40. A comprehensive system call list is in file syscalls.txt in /syscalls-directory of the disk-images or at the website. Example program with event loop at label "still": ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; 64 bit Menuet example ; ; Compile with FASM 1.60 or above ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; use64 org 0x0 db 'MENUET64' ; Header identifier dq 0x01 ; Version dq START ; Start of code dq image_end ; Size of image dq 0x100000 ; Memory for app dq 0xffff0 ; Rsp dq 0x00 ; Prm dq 0x00 ; Icon START: call draw_window ; At first, draw the window still: mov rax , 10 ; Wait here for event int 0x60 test rax , 1 ; Window redraw jnz window_event test rax , 2 ; Keyboard press jnz key_event test rax , 4 ; Button press jnz button_event jmp still window_event: call draw_window jmp still key_event: mov rax , 2 ; Read the key and ignore int 0x60 jmp still button_event: mov rax , 17 int 0x60 ; rax = status ; rbx = button id cmp rbx , 0x10000001 jne no_application_terminate_button mov rax , 0x200 int 0x60 no_application_terminate_button: cmp rbx , 0x106 jne no_application_terminate_menu mov rax , 0x200 int 0x60 no_application_terminate_menu: jmp still draw_window: ; After the draw_window function is called, you can draw to the window ; from any part of the code. mov rax , 12 ; Beginning of window draw mov rbx , 1 int 0x60 mov rax , 0x0 ; Draw window mov rbx , 256 shl 32 + 256 ; X start & size mov rcx , 128 shl 32 + 192 ; Y start & size mov rdx , 0x0000000000FFFFFF ; Type & border color mov r8 , 0x0000000000000001 ; Flags mov r9 , window_label ; 0 or label - asciiz mov r10 , menu_struct ; 0 or pointer to menu struct int 0x60 mov rax , 4 ; Display text mov rbx , text ; Pointer to text mov rcx , 32 ; X position mov rdx , 64 ; Y position mov rsi , 0x000000 ; Color mov r9 , 1 ; Font newline: int 0x60 add rdx , 16 add rbx , 31 cmp [rbx],byte ' ' jae newline mov rax , 12 ; End of window draw mov rbx , 2 int 0x60 ret ; Data area window_label: db 'EXAMPLE',0 ; Window label text: db 'HELLO WORLD FROM 64 BIT MENUET',0 db 'Second line ',0 db 'Third line ',0 db 0 menu_struct: ; Menu Struct dq 0 ; Version dq 0x100 ; Start value of ID to return ( ID + Line ) ; Returned when menu closes and ; user made no selections. db 0,'FILE',0 ; ID = 0x100 + 1 db 1,'New',0 ; ID = 0x100 + 2 db 1,'Open..',0 ; ID = 0x100 + 3 db 1,'Save..',0 ; ID = 0x100 + 4 db 1,'-',0 ; ID = 0x100 + 5 db 1,'Quit',0 ; ID = 0x100 + 6 db 0,'HELP',0 ; ID = 0x100 + 7 db 1,'Contents..',0 ; ID = 0x100 + 8 db 1,'About..',0 ; ID = 0x100 + 9 db 255 ; End of Menu Struct image_end: 3.2 Networking MenuetOS supports different ethernet cards and application networking interface uses system calls 52 and 53. 3.3 64bit and 32bit applications You can switch between 64bit mode and 32bit mode with system call 126. You can also access both 64bit and 32bit system calls from both modes using int 0x60, syscall and int 0x40 commands. 4. Driver programming 4.1 Network 4.2 Audio 4.3 Graphics 4.4 Midi