├── Apps ├── AIRC.ASM ├── ARPSTAT.ASM ├── BASE.RAW ├── BC.BMP ├── BLUE.PCX ├── BLUES.DTP ├── BMPVIEW.ASM ├── BOARD.ASM ├── BOARD.HTM ├── BOOTMOSF.ASM ├── CACHE2FD.ASM ├── CACHE2FD.BIN ├── CACHE2HD.ASM ├── CALC.ASM ├── CHAR.MT ├── CHAR2.MT ├── CHAT.INC ├── CHESS.ASM ├── CHESS.BMP ├── CHESSI.BMP ├── CIRCLE.ASM ├── COLORS.ASM ├── COPY2.ASM ├── COPYING ├── CPU.ASM ├── CPUSPEED.ASM ├── CUBE.INC ├── DEFAULT.DTP ├── DESKTOP.ASM ├── DEVELOP.ASM ├── DHCP.ASM ├── DIALOGS1.INC ├── DNSR.ASM ├── E32-2.ASM ├── END.ASM ├── ETHSTAT.ASM ├── EXAMPLE.ASM ├── EXAMPLE2.ASM ├── EYES.ASM ├── EYES.RAW ├── FILELIB.ASM ├── FIRE.ASM ├── FTPS.ASM ├── HD.BMP ├── HDBOOT.TXT ├── HTTPC.ASM ├── HTTPS.ASM ├── ICON.ASM ├── ICON.LST ├── ICONEDIT.ASM ├── ICONMNGR.ASM ├── INDEX.HTM ├── IPC.ASM ├── IR.ASM ├── JPEGDAT.ASM ├── JPEGLIB.ASM ├── JPEGVIEW.ASM ├── JPEGVIEW.JPG ├── LAUNCHER.ASM ├── LEFT.RAW ├── LOCAL.ASM ├── MACROS.INC ├── MB.BMP ├── MC.BMP ├── MEMLIB.ASM ├── MEMUSE.ASM ├── MENUET.BMP ├── MENUET.MP3 ├── MHC.ASM ├── MIDIPLAY.ASM ├── MIXER.ASM ├── MMENU.ASM ├── MOS3DE01.ASM ├── MP3S.ASM ├── MPANEL.ASM ├── MPANEL.BMP ├── MT.BMP ├── MTF.BMP ├── NNTPC.ASM ├── OPER.RAW ├── PAINT.ASM ├── PCI.TXT ├── PIC4.ASM ├── POPC.ASM ├── PPP.ASM ├── PPP.TXT ├── RD2FD.ASM ├── RD2FD.TXT ├── RD2HD.ASM ├── RDBOOT.DAT ├── RDFDEL.ASM ├── RED.DTP ├── RED.PCX ├── REMOTE.ASM ├── ROSE.TXT ├── RTDATA.ASM ├── RTDATA.BIN ├── SB.ASM ├── SCANCODE.ASM ├── SCC.BMP ├── SCL.BMP ├── SCR.BMP ├── SETUP.ASM ├── SMTPS.ASM ├── SPANEL.ASM ├── STACK.TXT ├── STACKCFG.ASM ├── STACKINF.ASM ├── SYSMETER.ASM ├── SYSTRACE.ASM ├── SYSTREE.ASM ├── TELNET.ASM ├── TERMINAL.ASM ├── TEST.ASM ├── TETRIS.ASM ├── TFTPC.ASM ├── THREAD.ASM ├── TINYFRAC.ASM ├── TINYPAD.ASM ├── TRANSP.ASM ├── TUBE.ASM ├── VSCREEN.ASM ├── WALL3.INC ├── WRITE.BMP ├── mdm.asm ├── mpanelup.asm └── rclock.asm ├── Kernel ├── 3C59X.INC ├── BOOTCODE.INC ├── BOOTENG.INC ├── COPYING ├── EGA.INC ├── EGAVGA.INC ├── ETHERNET.INC ├── FAT32.INC ├── FDC.INC ├── FS.INC ├── I8255X.INC ├── IP.INC ├── KERNEL.ASM ├── KERNEL.MNT ├── KERNEL16.INC ├── KERNEL32.INC ├── MEMMAP.INC ├── MIDI.INC ├── MOUSE.INC ├── PCI16.INC ├── PCI32.INC ├── PCNET32.INC ├── QUEUE.INC ├── RD.INC ├── RTL8029.INC ├── RTL8139.INC ├── SB16.INC ├── SHUTDOWN.INC ├── SIS900.INC ├── SKINCODE.INC ├── SKINDATA.INC ├── STACK.INC ├── SYS32.INC ├── TCP.INC ├── UDP.INC ├── VESA12.INC ├── VESA20.INC └── VGA.INC └── LICENSE /Apps/BASE.RAW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/BASE.RAW -------------------------------------------------------------------------------- /Apps/BC.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/BC.BMP -------------------------------------------------------------------------------- /Apps/BLUE.PCX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/BLUE.PCX -------------------------------------------------------------------------------- /Apps/BLUES.DTP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/BLUES.DTP -------------------------------------------------------------------------------- /Apps/BOARD.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; DEBUG BOARD 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | xpos dd 0x0 20 | ypos dd 11 21 | 22 | START: ; start of execution 23 | 24 | mov ecx,1024 25 | clearboard: 26 | mov eax,63 27 | mov ebx,2 28 | int 0x40 29 | loop clearboard 30 | 31 | call draw_window 32 | 33 | still: 34 | 35 | mov eax,23 ; wait here for event 36 | mov ebx,1 37 | int 0x40 38 | 39 | cmp eax,1 ; redraw request ? 40 | je red 41 | cmp eax,2 ; key in buffer ? 42 | je key 43 | cmp eax,3 ; button in buffer ? 44 | je button 45 | 46 | mov eax,63 47 | mov ebx,2 48 | int 0x40 49 | 50 | cmp ebx,1 51 | jne still 52 | 53 | new_data: 54 | 55 | cmp al,13 56 | jne no13 57 | mov [xpos],0 58 | jmp new_check 59 | no13: 60 | cmp al,10 61 | jne no10 62 | inc [ypos] 63 | cmp [ypos],12 64 | jbe noypos 65 | mov [ypos],12 66 | mov esi,text+80 67 | mov edi,text 68 | mov ecx,80*13 69 | cld 70 | rep movsb 71 | noypos: 72 | jmp new_check 73 | no10: 74 | 75 | mov esi,[ypos] 76 | imul esi,80 77 | add esi,[xpos] 78 | mov [text+esi],al 79 | inc [xpos] 80 | cmp [xpos],80 81 | jb xposok 82 | mov [xpos],79 83 | xposok: 84 | 85 | new_check: 86 | 87 | mov eax,63 88 | mov ebx,2 89 | int 0x40 90 | 91 | cmp ebx,1 92 | je new_data 93 | 94 | call draw_window 95 | 96 | jmp still 97 | 98 | 99 | red: ; redraw 100 | call draw_window 101 | jmp still 102 | 103 | key: ; key 104 | mov eax,2 ; just read it and ignore 105 | int 0x40 106 | jmp still 107 | 108 | button: ; button 109 | mov eax,17 ; get id 110 | int 0x40 111 | 112 | cmp ah,1 ; button id=1 ? 113 | jne noclose 114 | 115 | mov eax,-1 ; close this program 116 | int 0x40 117 | noclose: 118 | 119 | jmp still 120 | 121 | 122 | 123 | 124 | ; ********************************************* 125 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 126 | ; ********************************************* 127 | 128 | 129 | draw_window: 130 | 131 | mov eax,12 ; function 12:tell os about windowdraw 132 | mov ebx,1 ; 1, start of draw 133 | int 0x40 134 | ; DRAW WINDOW 135 | mov eax,0 ; function 0 : define and draw window 136 | mov ebx,100*65536+500 ; [x start] *65536 + [x size] 137 | mov ecx,250*65536+165 ; [y start] *65536 + [y size] 138 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 139 | mov esi,window_label ; color of grab bar RRGGBB,8->color gl 140 | mov edi,0 ; color of frames RRGGBB 141 | int 0x40 142 | 143 | mov ebx,15*65536+33 ; draw info text with function 4 144 | mov ecx,0x000000 145 | mov edx,text 146 | mov esi,80 147 | newline: 148 | mov eax,4 149 | int 0x40 150 | add ebx,10 151 | add edx,80 152 | cmp [edx],byte 'x' 153 | jne newline 154 | 155 | mov eax,12 ; function 12:tell os about windowdraw 156 | mov ebx,2 ; 2, end of draw 157 | int 0x40 158 | 159 | ret 160 | 161 | 162 | ; DATA AREA 163 | 164 | text: 165 | 166 | times 80*14 db 32 167 | db 'x' 168 | 169 | window_label: 170 | 171 | db 'DEBUG BOARD',0 172 | 173 | I_END: 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /Apps/BOARD.HTM: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | Tinyserver Messageboard

6 | 7 | 8 | 9 | 18 | 21 | 22 |

10 | 11 | WebMaster 12 | 13 |


14 |



15 | 12.23.45
16 | 02.05.03 17 |

19 | Assembly written messageboard from assembly written MenuetOS.
20 |

23 |
24 | 25 | 26 | 32 |

27 |

28 | Name:

29 | Message:

30 |
31 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /Apps/BOOTMOSF.ASM: -------------------------------------------------------------------------------- 1 | ;======================================================= 2 | ;= boot program for Menuet OS version 1.00 3 | ;= January 2002 4 | ;= 5 | ;= Copyright (C) Alex Nogueira Teixeira 6 | ;= E-Mail : alexwal@siteplanet.com.br 7 | ;= 8 | ;= Distributed under GPL, see file COPYING for details 9 | ;= 10 | ;= equates for program 11 | ;======================================================= 12 | 13 | lf equ 0ah 14 | cr equ 0dh 15 | 16 | pos_read_tmp equ 0700h ;position for temporary read 17 | boot_program equ 07c00h ;position for boot code 18 | seg_read_kernel equ 01000h ;seguiment to kernel read 19 | 20 | jmp start_program 21 | nop 22 | 23 | oemname db 'MENUETOS' 24 | bytespersector dw 512 25 | sectorspercluster db 1 26 | ressectors dw 1 27 | numcopiesfat db 2 28 | maxallocrootdir dw 224 29 | maxsectors dw 2880 ;for 1.44 mbytes disk 30 | mediadescriptor db 0f0h ;fd = 2 sides 18 sectors 31 | sectorsperfat dw 9 32 | sectorspertrack dw 18 33 | heads dw 2 34 | hiddensectors dd 0 35 | hugesectors dd 0 ;if sectors > 65536 36 | drivenumber db 0 37 | db 0 38 | bootsignature db 029h ;extended boot signature 39 | volumeid dd 0 40 | volumelabel db 'MENUET DISK' 41 | filesystemtype db 'FAT12 ' 42 | 43 | 44 | start_program: 45 | 46 | xor ax,ax 47 | mov ss,ax 48 | mov sp,boot_program 49 | push ss 50 | pop ds 51 | 52 | mov si,loading+boot_program 53 | loop_loading: 54 | lodsb 55 | or al,al 56 | jz procura_arquivo_novamente 57 | mov ah,0eh 58 | mov bx,07h 59 | int 010h 60 | jmp loop_loading 61 | 62 | 63 | procura_arquivo_novamente: 64 | 65 | push ss 66 | pop es 67 | 68 | mov bp,16 69 | 70 | newtry: 71 | 72 | dec bp 73 | jz mensagem_erro_arquivo 74 | 75 | mov ax,020eh ;read, 14 sectors for directory 76 | mov bx,pos_read_tmp ;es:bx read position 77 | mov cx,02h ;track 0, sector 2 78 | mov dx,0100h ;head 1, drive 0 (a:) 79 | call read_sector 80 | ; int 013h ;read sectors 81 | ; jc newtry ; mensagem_erro_arquivo 82 | 83 | mov si,bx 84 | 85 | loop_compara_entrada_diretorio: 86 | 87 | push si 88 | mov cx,11 ;file name 89 | mov di,arq_boot+boot_program 90 | rep cmpsb 91 | pop si 92 | je le_arquivo_kernel 93 | add si,32 94 | cmp si,pos_read_tmp+(512*14) ;end of directory 95 | jb loop_compara_entrada_diretorio 96 | 97 | mensagem_erro_arquivo: 98 | 99 | mov si,mens_erro+boot_program 100 | 101 | loop_envio_mensagem: 102 | 103 | lodsb 104 | or al,al 105 | jz espera_digitar_tecla 106 | mov ah,0eh 107 | mov bx,07h 108 | int 010h 109 | jmp loop_envio_mensagem 110 | 111 | espera_digitar_tecla: 112 | 113 | jmp $ 114 | 115 | 116 | ; load kernel 117 | 118 | le_arquivo_kernel: 119 | 120 | mov bp,[si+01ah] 121 | mov ax,0209h ;read, 9 sectors 122 | mov bx,pos_read_tmp ;es:bx read position 123 | mov cx,02h ;track 0, sector 2 124 | xor dx,dx ;head 0, drive 0 (a:) 125 | call read_sector 126 | ; int 013h ;read sectors 127 | jc mensagem_erro_arquivo 128 | mov ax,seg_read_kernel 129 | mov es,ax 130 | xor bx,bx 131 | 132 | ; read kernel to es:bx 133 | 134 | loop_obtem_dados_kernel: 135 | call le_setor_dados 136 | jc mensagem_erro_arquivo 137 | ; add bx,0200h ;add one sector 138 | 139 | push bx 140 | mov bx,es 141 | add bx,0x20 142 | mov es,bx 143 | pop bx 144 | 145 | mov di,bp 146 | shr di,01h 147 | pushf 148 | add di,bp 149 | add di,pos_read_tmp 150 | mov ax,[di] 151 | popf 152 | jc desloca_4_direita 153 | and ax,0fffh 154 | jmp verifica_fim_setores 155 | desloca_4_direita: 156 | mov cl,4 157 | shr ax,cl 158 | verifica_fim_setores: 159 | cmp ax,0ff8h 160 | jae executa_kernel 161 | mov bp,ax 162 | jmp loop_obtem_dados_kernel 163 | 164 | executa_kernel: 165 | push word seg_read_kernel 166 | push word 00h 167 | retf 168 | 169 | 170 | le_setor_dados: ;es:bx -> position in read buffer 171 | 172 | ;bp -> logical sector to read 173 | ;carry <- 0 read OK 174 | ;carry <- 1 read error 175 | push bx 176 | mov ax,0e2eh ;decimal point 177 | xor bh,bh 178 | int 010h 179 | pop bx 180 | mov ax,bp ;data sector to read 181 | add ax,31 ;get logical sector 182 | mov cx,36 ;sector/track 183 | xor dx,dx 184 | div cx 185 | mov ch,al ;track transfer 186 | xor dh,dh ;head 0 187 | cmp dl,18 188 | jb cabeca_correta 189 | sub dl,18 190 | inc dh ;head 1 191 | cabeca_correta: 192 | inc dl 193 | mov cl,dl 194 | xor dl,dl ;drive 0 (a:) 195 | mov ax,0201h ;read 1 sector 196 | call read_sector 197 | ; int 013h 198 | retn 199 | 200 | read_sector: 201 | 202 | push bp 203 | mov bp,20 204 | newread: 205 | dec bp 206 | jz mensagem_erro_arquivo 207 | push ax bx cx dx 208 | int 0x13 209 | pop dx cx bx ax 210 | jc newread 211 | pop bp 212 | retn 213 | 214 | loading db 13,10,'Starting MenuetOS ',00h 215 | mens_erro: 216 | db 13,10 217 | arq_boot: 218 | db 'KERNEL MNT ?',cr,lf,00h 219 | errors db 16 220 | 221 | 222 | times 0x1fe-$ db 00h 223 | 224 | db 55h,0aah ;boot signature 225 | 226 | 227 | -------------------------------------------------------------------------------- /Apps/CACHE2FD.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; WARNING! Spaghetti code, size optimized 3 | 4 | use32 5 | 6 | org 0x0 7 | 8 | db 'MENUET01' ; 8 byte id 9 | dd 0x01 ; header version 10 | dd red ; start of code 11 | dd I_END ; size of image 12 | dd 0x270 ; memory for app 13 | dd 0x26f ; esp 14 | dd 0x0 , 0x0 ; I_Param , I_Icon 15 | 16 | still: 17 | 18 | mov eax,10 ; wait here for event 19 | int 0x40 20 | 21 | 22 | cmp eax,1 ; redraw request ? 23 | je red 24 | cmp eax,2 ; key in buffer ? 25 | je key 26 | cmp eax,3 ; button in buffer ? 27 | je button 28 | 29 | ; jmp still 30 | red: ; redraw 31 | call draw_window 32 | key: ; key 33 | ; just read it and ignore 34 | int 0x40 35 | jmp still 36 | 37 | button: ; button 38 | mov eax,17 ; get id 39 | int 0x40 40 | cmp ah,1 ; button id=1 ? 41 | je close 42 | cmp ah,2 43 | je ramdiskcopy 44 | cmp ah,3 45 | je ramdiskupdate 46 | jmp togglewrite 47 | close: 48 | xor eax,eax 49 | dec eax 50 | ; mov eax,-1 ; close this program 51 | jmp callsys 52 | ramdiskcopy: 53 | mov eax,16 54 | xor ebx,ebx 55 | inc ebx 56 | jmp callsys 57 | ramdiskupdate: 58 | mov eax,16 59 | xor ebx,ebx 60 | inc ebx 61 | inc ebx 62 | jmp callsys 63 | togglewrite: 64 | call togglefdcwrite 65 | callsys: 66 | int 0x40 67 | jmp still 68 | 69 | ; get fdc settings for writing & invert them. 70 | togglefdcwrite: 71 | mov eax,16 72 | mov ebx,4 73 | int 0x40 74 | xchg ecx,eax 75 | xor ecx,1 76 | mov eax,16 77 | dec ebx 78 | int 0x40 79 | ;run trough drawwindow :] 80 | 81 | ; ********************************************* 82 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 83 | ; ********************************************* 84 | 85 | 86 | draw_window: 87 | 88 | 89 | mov eax,12 ; function 12:tell os about windowdraw 90 | xor ebx,ebx ; 1, start of draw 91 | inc ebx 92 | int 0x40 93 | 94 | ; DRAW WINDOW 95 | xor eax,eax ; function 0 : define and draw win 96 | mov ebx,100*65536+250 ; [x start] *65536 + [x size] 97 | mov ecx,100*65536+120 ; [y start] *65536 + [y size] 98 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 99 | mov esi,titlebar 100 | mov edi,0 101 | int 0x40 102 | 103 | ;The important part, the buttons & text. 104 | 105 | mov ebx,9*65536+36 106 | mov ecx,41*65536+14 107 | xor edx,edx 108 | inc edx 109 | inc edx 110 | ;mov edx,2 111 | call clickbox 112 | 113 | mov ebx,67*65536+49 114 | inc edx 115 | call clickbox 116 | 117 | mov ebx,12*65536+12 118 | mov ecx,81*65536+12 119 | inc edx 120 | call clickbox 121 | 122 | mov ecx,96*65536+12 123 | xor edx,edx 124 | call clickbox 125 | 126 | mov edi,0x10000000 127 | mov edx,titlebar 128 | mov ebx,9*65536+9 129 | mov ecx,0x10ffffff 130 | ; call print 131 | 132 | mov edx,h1 133 | mov ebx,11*65536+28 134 | mov ecx,0x10808080 135 | call print 136 | 137 | ; mov edx,comtext 138 | add ebx,15 139 | xchg ecx,edi 140 | call print 141 | 142 | ; mov edx,h2 143 | add ebx,25 144 | xchg ecx,edi 145 | call print 146 | 147 | ; mov edx,setwrite 148 | add ebx,15 149 | xchg ecx,edi 150 | call print 151 | 152 | ; mov edx,setread 153 | add ebx,15 154 | xchg ecx,edi 155 | call print 156 | 157 | mov eax,16 158 | mov ebx,4 159 | int 0x40 160 | test al,1 161 | je nowritex 162 | ; mov edx,xsign 163 | mov ebx,14*65536+83 164 | xchg ecx,edi 165 | call print 166 | nowritex: 167 | mov eax,12 ; function 12:tell os about windowdraw 168 | mov ebx,2 ; 2, end of draw 169 | ret 170 | 171 | clickbox: 172 | pusha 173 | mov edi,edx 174 | cmp edx, 0 175 | je .disabledbox 176 | mov eax,8 ; function 8 : define and draw button 177 | int 0x40 178 | .disabledbox: 179 | inc ecx 180 | inc ebx 181 | mov eax,13 182 | mov edx, 0x808080 183 | int 0x40 184 | cmp edi,0 185 | je .grayed 186 | mov edx,0x80 187 | .grayed: 188 | sub ebx,65536 189 | sub ecx,65536 190 | int 0x40 191 | add ebx,65534 192 | add ecx,65534 193 | mov edx,0xffffff 194 | int 0x40 195 | popa 196 | ret 197 | 198 | print: 199 | mov eax,edx 200 | xor esi,esi 201 | addchar: 202 | inc eax 203 | inc esi 204 | cmp [eax],byte 0 205 | jne addchar 206 | mov eax,4 207 | int 0x40 208 | add edx,esi 209 | inc edx 210 | ret 211 | 212 | 213 | ; DATA AREA 214 | 215 | titlebar: db 'CACHE2FD',0 216 | h1: db 'Commands',0 217 | comtext: db 'Copy or Update cache to floppy',0 218 | h2: db 'Settings',0 219 | setwrite: db ' Write directly to floppy',0 220 | setread: db ' Read directly from floppy',0 221 | xsign: db 'X',0 222 | I_END: 223 | 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /Apps/CACHE2FD.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/CACHE2FD.BIN -------------------------------------------------------------------------------- /Apps/CACHE2HD.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; CACHE2HD 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x300000 ; memory for app 16 | dd 0xfff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | ; 0x0fff0 - STACK 20 | ; 0x20000 - 1.4 Mb IMAGE 21 | 22 | START: ; start of execution 23 | 24 | call draw_window 25 | 26 | still: 27 | 28 | mov eax,10 ; wait here for event 29 | int 0x40 30 | 31 | cmp eax,1 ; redraw request ? 32 | je red 33 | cmp eax,2 ; key in buffer ? 34 | je key 35 | cmp eax,3 ; button in buffer ? 36 | je button 37 | 38 | jmp still 39 | 40 | red: ; redraw 41 | call draw_window 42 | jmp still 43 | 44 | key: ; key 45 | mov eax,2 ; just read it and ignore 46 | int 0x40 47 | 48 | cmp ah,'s' 49 | jne still 50 | 51 | mov esi,reading 52 | call print_text 53 | 54 | mov ecx,0 55 | 56 | newread: 57 | 58 | mov [fileinfo+4],ecx 59 | mov eax,ecx 60 | imul eax,512 61 | add eax,0x20000 62 | mov [fileinfo+12],eax 63 | 64 | mov eax,58 65 | mov ebx,fileinfo 66 | int 0x40 67 | 68 | cmp eax,0 69 | je success_read 70 | 71 | mov esi,read_failed 72 | call print_text 73 | 74 | jmp success 75 | 76 | success_read: 77 | 78 | 79 | inc ecx 80 | cmp ecx,80*18*2 81 | jb newread 82 | 83 | mov esi,saving 84 | call print_text 85 | 86 | mov eax,58 87 | mov ebx,filesave 88 | int 0x40 89 | 90 | mov esi,writefine 91 | call print_text 92 | 93 | cmp eax,0 94 | je success 95 | 96 | mov esi,failed 97 | call print_text 98 | 99 | success: 100 | 101 | mov eax,5 102 | mov ebx,300 103 | int 0x40 104 | 105 | mov esi,waiting 106 | call print_text 107 | 108 | jmp still 109 | 110 | fileinfo: 111 | 112 | dd 8,0,1,0x20000,0x10000 113 | db '/RD/1/',0 114 | 115 | filesave: 116 | 117 | dd 1,0,1474560,0x20000,0x10000 118 | db '/HD/1/MENUET.IMG',0 119 | 120 | button: ; button 121 | mov eax,17 ; get id 122 | int 0x40 123 | 124 | cmp ah,1 ; button id=1 ? 125 | jne noclose 126 | 127 | mov eax,-1 ; close this program 128 | int 0x40 129 | noclose: 130 | 131 | jmp still 132 | 133 | reading: db 'Reading ' 134 | saving: db 'Saving ' 135 | waiting: db 'Waiting for command ' 136 | failed: db 'Write failed! ' 137 | writefine: db 'Write success! ' 138 | read_failed: db 'Read failed! ' 139 | 140 | 141 | print_text: 142 | 143 | pusha 144 | 145 | mov edi,text+40*4+6 146 | mov ecx,19 147 | cld 148 | rep movsb 149 | 150 | call draw_window 151 | 152 | popa 153 | 154 | ret 155 | 156 | 157 | 158 | ; ********************************************* 159 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 160 | ; ********************************************* 161 | 162 | 163 | draw_window: 164 | 165 | 166 | mov eax,12 ; function 12:tell os about windowdraw 167 | mov ebx,1 ; 1, start of draw 168 | int 0x40 169 | 170 | ; DRAW WINDOW 171 | mov eax,0 ; function 0 : define and draw window 172 | mov ebx,100*65536+270 ; [x start] *65536 + [x size] 173 | mov ecx,100*65536+140 ; [y start] *65536 + [y size] 174 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 175 | mov esi,window_label ; color of grab bar RRGGBB,8->color gl 176 | mov edi,0 ; color of frames RRGGBB 177 | int 0x40 178 | 179 | mov ebx,20*65536+45 ; draw info text with function 4 180 | mov ecx,0x224466 181 | mov edx,text 182 | mov esi,40 183 | newline: 184 | mov eax,4 185 | int 0x40 186 | add ebx,15 187 | add edx,40 188 | cmp [edx],byte 'x' 189 | jne newline 190 | 191 | mov eax,12 ; function 12:tell os about windowdraw 192 | mov ebx,2 ; 2, end of draw 193 | int 0x40 194 | 195 | ret 196 | 197 | 198 | ; DATA AREA 199 | 200 | 201 | text: 202 | db ' 1) ENABLE LBA READ AND HD WITH SETUP ' 203 | db ' 2) PRESS TO COPY FD-IMAGE AS: ' 204 | db ' /HD/1/MENUET.IMG ' 205 | db ' ' 206 | db ' ( WAITING FOR COMMAND ) ' 207 | 208 | db 'x <- END MARKER, DONT DELETE ' 209 | 210 | 211 | 212 | window_label: 213 | 214 | db 'FD IMAGE TO HD' 215 | 216 | I_END: 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /Apps/CHAT.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; CHAT.INC ;; 4 | ;; ;; 5 | ;; Modem Chat Initiator for PPP Dialer ;; 6 | ;; ;; 7 | ;; Version 3 2nd May 2003 ;; 8 | ;; ;; 9 | ;; Copyright 2002 Shrirang Bhagwat, b_shrirang@hotmail.com ;; 10 | ;; ;; 11 | ;; See file COPYING for details ;; 12 | ;; ;; 13 | ;; 2/5/03 - Shrirang - Added Abort Strings For sendwait ;; 14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 15 | 16 | 17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 18 | ; Request And Response Chat Strings 19 | ; Following Data Structure is used for Request Response Chatting 20 | ; with the modem, for each request there is an expected response 21 | ; chatreq <-> chatres, 0 (NULL) is delimeter for 1 string 22 | ; '`' is delimiter for the section, modify according to your 23 | ; modem dialing scheme; in future MenuetOS might provide a graphical 24 | ; client to generate this kind of data structure and the PAP packet 25 | ; for username and password! 26 | ; Aborts strings are used to get outta sendwait early... 27 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 28 | 29 | ; REQUESTS 30 | chatreq db 'ATH',13,0 ; 0 (NULL) is required by sendwait 31 | db 'ATZ',13,0 32 | db 'ATM1',13,0 33 | db 'ATX1',13,0 ; My Modem doesn't connect without this 34 | ; db 'ATDT;',13,0 35 | db 'ATDT phonenumber',13,0 36 | db '`' ; <- End Marker 37 | 38 | ; RESPONSES 39 | chatres db 'OK',0 40 | db 'OK',0 41 | db 'OK',0 42 | db 'OK',0 43 | ; db 'OK',0 44 | db 'CONNECT',0 45 | db '`' ; <- End Marker 46 | 47 | ; ABORTS 48 | aborts db 'ERROR',0 49 | db 'NO CARRIER',0 50 | db 'NO DIALTONE',0 51 | db 'BUSY',0 52 | db 'LINE IN USE',0 53 | db 'NO ANSWER',0 54 | db '`' ; <- End Marker 55 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 56 | 57 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 58 | ; 59 | ; modem_chat - chats with the modem to initiate a connection 60 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 61 | modem_chat: 62 | 63 | push edi 64 | push esi 65 | push edx 66 | 67 | mov edi, chatreq ; init everytime, safe, stateless 68 | mov esi, chatres 69 | 70 | chat_now: 71 | 72 | cmp byte [esi], '`' ; are we done? 73 | je chatover 74 | 75 | mov edx, 6000 ; strings like "atdt;" take long on my modem 76 | call sendwait 77 | 78 | and eax, eax 79 | jz timeoutoccured 80 | 81 | updatereq: 82 | 83 | inc edi 84 | cmp byte [edi], '`' 85 | je updateres 86 | 87 | cmp byte [edi], 0 88 | jne updatereq 89 | 90 | inc edi 91 | 92 | updateres: 93 | 94 | inc esi 95 | cmp byte [esi], '`' 96 | je chatover 97 | 98 | cmp byte [esi], 0 99 | jne updateres 100 | 101 | inc esi 102 | 103 | jmp chat_now 104 | 105 | 106 | chatover: 107 | 108 | xor eax, eax ; SUCCESS! 109 | inc eax 110 | 111 | pop edx 112 | pop esi 113 | pop edi 114 | 115 | ret 116 | 117 | timeoutoccured: 118 | 119 | xor eax, eax ; FAIL! 120 | 121 | pop edx 122 | pop esi 123 | pop edi 124 | 125 | ret 126 | 127 | 128 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 129 | ; 130 | ; scanaborts - scans the response from modem for abort srings 131 | ; ESI - Response from modem 132 | ; EDI - Pointer to Abort Table 133 | ; ECX - Response Length 134 | ; Returns 1 if abort detected, 0 otherwise 135 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 136 | scanaborts: 137 | 138 | push esi 139 | push edi 140 | push ecx 141 | 142 | checkit: 143 | 144 | push esi 145 | repe cmpsb ; any abort matches? 146 | je abortdetected 147 | pop esi 148 | 149 | 150 | updatetbl: 151 | 152 | inc edi 153 | cmp byte [edi], '`' 154 | je noabortfound 155 | 156 | cmp byte [edi], 0 157 | jne updatetbl 158 | 159 | inc edi 160 | 161 | jmp checkit 162 | 163 | abortdetected: 164 | 165 | pop esi 166 | pop ecx 167 | pop edi 168 | pop esi 169 | 170 | xor eax, eax ; SUCCESS! 171 | inc eax 172 | ret 173 | 174 | noabortfound : 175 | 176 | pop ecx 177 | pop edi 178 | pop esi 179 | 180 | 181 | xor eax, eax ; FAILED! 182 | ret 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /Apps/CHESS.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/CHESS.BMP -------------------------------------------------------------------------------- /Apps/CHESSI.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/CHESSI.BMP -------------------------------------------------------------------------------- /Apps/CIRCLE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; SHAPED WINDOW - BASIC EXAMPLE 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image size 15 | dd 0x100000 ; required amount of memory 16 | ; esp = 0x7FFF0 17 | dd 0x00000000 ; reserved=no extended header 18 | 19 | 20 | 21 | START: ; start of execution 22 | 23 | call shape_window ; function for shaping 24 | 25 | call draw_window ; at first, draw the window 26 | 27 | still: 28 | 29 | mov eax,10 ; wait here for event 30 | int 0x40 31 | 32 | cmp eax,1 ; redraw request ? 33 | je red 34 | cmp eax,2 ; key in buffer ? 35 | je key 36 | cmp eax,3 ; button in buffer ? 37 | je button 38 | 39 | jmp still 40 | 41 | red: ; redraw 42 | call draw_window 43 | jmp still 44 | 45 | key: ; key 46 | mov eax,2 ; just read it and ignore 47 | int 0x40 48 | jmp still 49 | 50 | button: ; button 51 | mov eax,17 ; get id 52 | int 0x40 53 | 54 | cmp ah,1 ; button id=1 ? 55 | jne noclose 56 | mov eax,-1 ; close this program 57 | int 0x40 58 | noclose: 59 | 60 | jmp still 61 | 62 | 63 | shape_window: 64 | 65 | pusha 66 | 67 | mov eax,50 ; give the shape reference area 68 | mov ebx,0 69 | mov ecx,shape_reference 70 | int 0x40 71 | 72 | mov eax,50 ; give the shape scale 32 x 32 -> 128 x 128 73 | mov ebx,1 ; you dont have to give this, scale is 1:1 by default 74 | mov ecx,2 75 | int 0x40 76 | 77 | popa 78 | 79 | ret 80 | 81 | 82 | shape_reference: ; 32 x 32 ( window_size_X + 1 ) * ( window_size_Y + 1 ) 83 | 84 | db 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 85 | db 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 86 | db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0 87 | db 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0 88 | db 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 89 | db 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 90 | db 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0 91 | db 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 92 | db 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 93 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 94 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0 95 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 96 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0 97 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0 98 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0 99 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 100 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0 101 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0 102 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0 103 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 104 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0 105 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 106 | db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 107 | db 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 108 | db 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 109 | db 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0 110 | db 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 111 | db 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 112 | db 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0 113 | db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0 114 | db 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 115 | db 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 116 | 117 | 118 | ; ********************************************* 119 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 120 | ; ********************************************* 121 | 122 | 123 | draw_window: 124 | 125 | mov eax,12 ; function 12:tell os about windowdraw 126 | mov ebx,1 ; 1, start of draw 127 | int 0x40 128 | 129 | ; DRAW WINDOW 130 | mov eax,0 ; function 0 : define and draw window 131 | mov ebx,100*65536 ; [x start] *65536 + [x size] 132 | mov ecx,100*65536 ; [y start] *65536 + [y size] 133 | mov bx,word [x_size] 134 | mov cx,word [y_size] 135 | mov edx,0x00cccc00 ; color of work area RRGGBB,8->color glide 136 | mov esi,0x00cccc00 ; color of grab bar RRGGBB,8->color glide 137 | mov edi,0x00cccc00 ; color of frames RRGGBB 138 | int 0x40 139 | 140 | 141 | ; CLOSE BUTTON 142 | mov eax,8 ; function 8 : define and draw button 143 | mov ebx,78*65536+12 ; [x start] *65536 + [x size] 144 | mov ecx,20*65536+12 ; [y start] *65536 + [y size] 145 | mov edx,1 ; button id 146 | mov esi,0x5599cc ; button color RRGGBB 147 | int 0x40 148 | 149 | 150 | mov eax,12 ; function 12:tell os about windowdraw 151 | mov ebx,2 ; 2, end of draw 152 | int 0x40 153 | 154 | ret 155 | 156 | 157 | ; DATA AREA 158 | 159 | 160 | x_size dd 127 161 | y_size dd 127 162 | 163 | 164 | I_END: 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /Apps/COLORS.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; COLOR TABLE 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image size 15 | dd 0x100000 ; required amount of memory 16 | ; esp = 0x7FFF0 17 | dd 0x00000000 ; reserved=no extended header 18 | 19 | 20 | 21 | START: ; start of execution 22 | 23 | call shape_window 24 | 25 | call draw_window ; at first, draw the window 26 | 27 | still: 28 | 29 | mov eax,10 ; wait here for event 30 | int 0x40 31 | 32 | cmp eax,1 ; redraw request ? 33 | jz red 34 | cmp eax,2 ; key in buffer ? 35 | jz key 36 | cmp eax,3 ; button in buffer ? 37 | jz button 38 | 39 | jmp still 40 | 41 | red: ; redraw 42 | call draw_window 43 | jmp still 44 | 45 | key: ; key 46 | mov eax,2 ; just read it and ignore 47 | int 0x40 48 | jmp still 49 | 50 | button: ; button 51 | mov eax,17 ; get id 52 | int 0x40 53 | 54 | cmp ah,1 ; button id=1 ? 55 | jnz noclose 56 | mov eax,0xffffffff ; close this program 57 | int 0x40 58 | noclose: 59 | 60 | jmp still 61 | 62 | 63 | shape_window: 64 | 65 | pusha 66 | 67 | mov eax,50 ; give the address of reference area 68 | mov ebx,0 69 | mov ecx,shape_reference 70 | int 0x40 71 | 72 | mov eax,50 ; give the scaling ( 5 -> 2^5 ) 73 | mov ebx,1 74 | mov ecx,5 75 | int 0x40 76 | 77 | popa 78 | 79 | ret 80 | 81 | 82 | shape_reference: 83 | 84 | db 1,0,1,0,1,0,1,0 85 | db 0,1,0,1,0,1,0,1 86 | db 1,0,1,0,1,0,1,0 87 | db 0,1,0,1,0,1,0,1 88 | db 1,0,1,0,1,0,1,0 89 | db 0,1,0,1,0,1,0,1 90 | db 1,0,1,0,1,0,1,0 91 | db 0,1,0,1,0,1,0,1 92 | 93 | 94 | 95 | ; ********************************************* 96 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 97 | ; ********************************************* 98 | 99 | 100 | draw_window: 101 | 102 | mov eax,12 ; function 12:tell os about windowdraw 103 | mov ebx,1 ; 1, start of draw 104 | int 0x40 105 | 106 | ; DRAW WINDOW 107 | mov eax,0 ; function 0 : define and draw window 108 | mov ebx,100*65536+255 ; [x start] *65536 + [x size] 109 | mov ecx,100*65536+255 ; [y start] *65536 + [y size] 110 | mov edx,0x00000000 111 | mov esi,0x8099bbff ; color of grab bar RRGGBB,8->color glide 112 | mov edi,0x0099bbee ; color of frames RRGGBB 113 | int 0x40 114 | 115 | call draw_colors 116 | 117 | 118 | ; CLOSE BUTTON 119 | mov eax,8 ; function 8 : define and draw button 120 | mov ebx,5*65536+12 ; [x start] *65536 + [x size] 121 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 122 | mov edx,1 ; button id 123 | mov esi,0xccaa22 ; button color RRGGBB 124 | int 0x40 125 | 126 | 127 | 128 | mov eax,12 ; function 12:tell os about windowdraw 129 | mov ebx,2 ; 2, end of draw 130 | int 0x40 131 | 132 | ret 133 | 134 | 135 | draw_colors: 136 | 137 | pusha 138 | 139 | mov [bar],dword 0 140 | 141 | mov eax,-1 142 | mov ebx,0 143 | mov ecx,0 144 | mov edx,0 145 | 146 | mov edi,0 147 | 148 | dc1: 149 | 150 | add eax,1 151 | cmp eax,256 152 | jb na1 153 | mov eax,0 154 | add ebx,1 155 | cmp ebx,256 156 | jb na1 157 | mov ebx,0 158 | add ecx,5 159 | na1: 160 | 161 | mov dl,al 162 | shl edx,8 163 | mov dl,bl 164 | shl edx,8 165 | mov dl,cl 166 | 167 | na2: 168 | 169 | pusha 170 | push edx 171 | 172 | xor edx,edx 173 | mov eax,edi 174 | mov ebx,256 175 | div ebx 176 | mov ebx,edx 177 | mov ecx,eax 178 | 179 | add ebx,[addx] 180 | add ecx,[addy] 181 | 182 | pop edx 183 | mov eax,1 184 | int 0x40 185 | popa 186 | 187 | add edi,1 188 | 189 | cmp edi,256*256 190 | jb dc1 191 | 192 | popa 193 | ret 194 | 195 | 196 | 197 | ; DATA AREA 198 | 199 | bar dd 0x0 200 | 201 | add1 dd 0 202 | add2 dd 0 203 | 204 | addx dd 0 205 | addy dd 0 206 | 207 | text: 208 | db 'THIS IS AN EXAMPLE PROGRAM YOU COULD ' 209 | db 'USE, A:\EXAMPLE.ASM CODE IS COMMENTED ' 210 | db 'AND CLEAR. SYSTEM FUNCTIONS ARE IN FILE ' 211 | db 'SYSFUNCS.TXT AND COMMANDS IN CMD.TXT ' 212 | 213 | db 'x <- END MARKER, DONT DELETE ' 214 | 215 | 216 | labelt: 217 | db 'COLOR TABLE' 218 | labellen: 219 | 220 | I_END: 221 | 222 | 223 | 224 | 225 | -------------------------------------------------------------------------------- /Apps/COPY2.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/COPY2.ASM -------------------------------------------------------------------------------- /Apps/CPUSPEED.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPU SPEED INDICATIOR 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image size 15 | dd 0x100000 ; required amount of memory 16 | ; esp = 0x7FFF0 17 | dd 0x00000000 ; reserved=no extended header 18 | 19 | 20 | 21 | START: ; start of execution 22 | 23 | mov eax,18 24 | mov ebx,5 25 | int 0x40 26 | 27 | xor edx,edx 28 | mov ebx,1000000 29 | div ebx 30 | mov ebx,10 31 | mov edi,text+19 32 | mov ecx,5 33 | newnum: 34 | xor edx,edx 35 | mov ebx,10 36 | div ebx 37 | add dl,48 38 | mov [edi],dl 39 | sub edi,1 40 | loop newnum 41 | 42 | call draw_window ; at first, draw the window 43 | 44 | still: 45 | 46 | mov eax,10 ; wait here for event 47 | int 0x40 48 | 49 | cmp eax,1 ; redraw request ? 50 | jz red 51 | cmp eax,2 ; key in buffer ? 52 | jz key 53 | cmp eax,3 ; button in buffer ? 54 | jz button 55 | 56 | jmp still 57 | 58 | red: ; redraw 59 | call draw_window 60 | jmp still 61 | 62 | key: ; key 63 | mov eax,2 ; just read it and ignore 64 | int 0x40 65 | jmp still 66 | 67 | button: ; button 68 | mov eax,17 ; get id 69 | int 0x40 70 | 71 | cmp ah,1 ; button id=1 ? 72 | jnz noclose 73 | mov eax,0xffffffff ; close this program 74 | int 0x40 75 | noclose: 76 | 77 | jmp still 78 | 79 | 80 | ; ********************************************* 81 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 82 | ; ********************************************* 83 | 84 | 85 | draw_window: 86 | 87 | mov eax,12 ; function 12:tell os about windowdraw 88 | mov ebx,1 ; 1, start of draw 89 | int 0x40 90 | 91 | ; DRAW WINDOW 92 | mov eax,0 ; function 0 : define and draw window 93 | mov ebx,100*65536+200 ; [x start] *65536 + [x size] 94 | mov ecx,100*65536+65 ; [y start] *65536 + [y size] 95 | mov edx,0x001111aa ; color of work area RRGGBB,8->color glide 96 | mov esi,0x805577cc ; color of grab bar RRGGBB,8->color 97 | mov edi,0x00ffffff ; color of frames RRGGBB 98 | int 0x40 99 | 100 | ; WINDOW LABEL 101 | mov eax,4 ; function 4 : write text to window 102 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 103 | mov ecx,0x00ffffff ; color of text RRGGBB 104 | mov edx,labelt ; pointer to text beginning 105 | mov esi,labellen-labelt ; text length 106 | int 0x40 107 | ; CLOSE BUTTON 108 | mov eax,8 ; function 8 : define and draw button 109 | mov ebx,(200-19)*65536+12 ; [x start] *65536 + [x size] 110 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 111 | mov edx,1 ; button id 112 | mov esi,0x3355aa ; button color RRGGBB 113 | int 0x40 114 | 115 | mov ebx,25*65536+35 ; draw info text with function 4 116 | mov ecx,0xffffff 117 | mov edx,text 118 | mov esi,40 119 | newline: 120 | mov eax,4 121 | int 0x40 122 | add ebx,10 123 | add edx,40 124 | cmp [edx],byte 'x' 125 | jnz newline 126 | 127 | mov eax,12 ; function 12:tell os about windowdraw 128 | mov ebx,2 ; 2, end of draw 129 | int 0x40 130 | 131 | ret 132 | 133 | 134 | ; DATA AREA 135 | 136 | 137 | text: 138 | db 'CPU RUNNING AT MHZ ' 139 | db 'x <- END MARKER, DONT DELETE ' 140 | 141 | labelt: 142 | db 'CPU SPEED' 143 | labellen: 144 | 145 | I_END: 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /Apps/CUBE.INC: -------------------------------------------------------------------------------- 1 | ; cube model 2 | anz: 3 | dd 23 ; number of pts -1 4 | ; x y z 5 | 6 | dd -100,-100,-100 7 | dd -100,100,-100 8 | dd -100,100,100 9 | dd -100,-100,100 10 | 11 | dd -100,-100,-100 12 | dd -100,-100,100 13 | dd 100,-100, 100 14 | dd 100,-100, -100 15 | 16 | dd -100,100,-100 17 | dd 100,100,-100 18 | dd 100,100, 100 19 | dd -100,100, 100 20 | 21 | dd 100,-100,-100 22 | dd 100,-100,100 23 | dd 100,100,100 24 | dd 100,100,-100 25 | 26 | dd -100,100,100 27 | dd 100,100,100 28 | dd 100,-100,100 29 | dd -100,-100,100 30 | 31 | dd -100,100,-100 32 | dd -100,-100,-100 33 | dd 100,-100,-100 34 | dd 100,100,-100 35 | eo_mesh: 36 | dd 0,0,0 37 | silly: 38 | dd 55,55,55 39 | a_xwww: 40 | times 24 dd 0 41 | a_ywww: 42 | times 24 dd 0 43 | a_zwww: 44 | times 24 dd 0 45 | a_xw: 46 | times 24 dd 0 47 | a_yw: 48 | times 24 dd 0 49 | a_zw: 50 | times 24 dd 0 51 | -------------------------------------------------------------------------------- /Apps/DEFAULT.DTP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/DEFAULT.DTP -------------------------------------------------------------------------------- /Apps/DEVELOP.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; DEVELOPER INFO - Compile with fasm 3 | ; 4 | 5 | use32 6 | 7 | org 0x0 8 | db 'MENUET00' ; 8 byte id 9 | dd 38 ; required os 10 | dd START ; program start 11 | dd I_END ; program image size 12 | dd 0x100000 ; required amount of memory 13 | ; esp = 0x7fff0 14 | dd 0x00000000 ; reserved=no extended header 15 | 16 | START: ; start of execution 17 | 18 | call draw_window ; at first, draw the window 19 | 20 | still: 21 | 22 | mov eax,10 ; wait here for event 23 | int 0x40 24 | 25 | cmp eax,1 ; redraw request ? 26 | jz red 27 | cmp eax,2 ; key in buffer ? 28 | jz key 29 | cmp eax,3 ; button in buffer ? 30 | jz button 31 | 32 | jmp still 33 | 34 | red: ; redraw 35 | call draw_window 36 | 37 | jmp still 38 | 39 | key: ; key 40 | mov eax,2 ; just read it and ignore 41 | int 0x40 42 | 43 | jmp still 44 | 45 | button: ; button 46 | mov eax,17 47 | int 0x40 48 | 49 | cmp ah,1 ; button id=1 ? 50 | jnz noclose 51 | mov eax,0xffffffff ; close this program 52 | int 0x40 53 | noclose: 54 | 55 | jmp still 56 | 57 | 58 | ; ********************************************* 59 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 60 | ; ********************************************* 61 | 62 | 63 | draw_window: 64 | 65 | mov eax,12 ; function 12:tell os about windowdraw 66 | mov ebx,1 ; 1, start of draw 67 | int 0x40 68 | ; DRAW WINDOW 69 | mov eax,0 ; function 0 : define and draw window 70 | mov ebx, 50*65536+365 ; [x start] *65536 + [x size] 71 | mov ecx,100*65536+260 ; [y start] *65536 + [y size] 72 | mov edx,0x03ffffff ; color of work area RRGGBB 73 | mov esi,0x8099bbff ; color of grab bar RRGGBB,8->color glide 74 | mov edi,0x0099bbee ; color of frames RRGGBB 75 | int 0x40 76 | 77 | ; WINDOW LABEL 78 | mov eax,4 ; function 4 : write text to window 79 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 80 | mov ecx,0x00ffffff ; color of text RRGGBB 81 | mov edx,labelt ; pointer to text beginning 82 | mov esi,labellen-labelt ; text length 83 | int 0x40 84 | 85 | mov ebx,20*65536+35 ; draw info text with function 4 86 | mov ecx,0x000000 87 | mov edx,text 88 | mov esi,60 89 | newline: 90 | mov eax,4 91 | int 0x40 92 | add ebx,10 93 | add edx,60 94 | cmp [edx],byte 'x' 95 | jnz newline 96 | 97 | mov eax,12 ; function 12:tell os about windowdraw 98 | mov ebx,2 ; 2, end of draw 99 | int 0x40 100 | 101 | ret 102 | 103 | 104 | ; DATA AREA 105 | 106 | text: 107 | db ' HOW TO MODIFY & RUN EXAMPLE.ASM UNDER MENUET ' 108 | db ' ' 109 | db ' 1) EDIT FILE WITH TEXT EDITOR & SAVE->RAMDISK ' 110 | db ' 2) COMPILE & RUN WITH FASM FOR MENUET ' 111 | db ' 3) SAVE RAMDISK TO FLOPPY AT MENUET EXIT ' 112 | db ' OR SAVE RESULT TO A FAT32 PARTITION ' 113 | db ' ' 114 | db ' SYSFUNCS.TXT - SYSTEM FUNCTIONS FOR APPLICATIONS ' 115 | db ' ASM .TXT - SHORT INTRO TO ASSEMBLY PROGRAMMING ' 116 | db ' ' 117 | db ' ' 118 | db ' HOW TO MODIFY AND COMPILE KERNEL ' 119 | db ' ' 120 | db ' 1) EDIT KERNEL.ASM WITH TEXT EDITOR AND SAVE ' 121 | db ' 2) COMPILE KERNEL.ASM TO KERNEL.MNT ' 122 | db ' 3) SAVE RAMDISK TO FLOPPY AT MENUET EXIT ' 123 | db ' 4) BOOT, AND YOU WILL HAVE A NEW KERNEL RUNNING ' 124 | db ' ' 125 | db ' YOU CAN ALSO EDIT AND COMPILE THE KERNEL UNDER DOS ' 126 | db ' OR COMPATIBLE SYSTEM. USE FASM 1.30 ' 127 | db 'x ' 128 | 129 | labelt: 130 | db 'DEVELOPER INFO' 131 | labellen: 132 | 133 | I_END: 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Apps/E32-2.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; EXAMPLE APPLICATION 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | START: ; start of execution 20 | 21 | call draw_window 22 | 23 | still: 24 | 25 | mov eax,10 ; wait here for event 26 | int 0x40 27 | 28 | cmp eax,1 ; redraw request ? 29 | je red 30 | cmp eax,2 ; key in buffer ? 31 | je key 32 | cmp eax,3 ; button in buffer ? 33 | je button 34 | 35 | jmp still 36 | 37 | red: ; redraw 38 | call draw_window 39 | jmp still 40 | 41 | key: ; key 42 | mov eax,2 ; just read it and ignore 43 | int 0x40 44 | jmp still 45 | 46 | button: ; button 47 | mov eax,17 ; get id 48 | int 0x40 49 | 50 | shr eax , 8 51 | 52 | cmp eax , 1 ; Close application button 53 | jne noclose 54 | mov eax , -1 55 | int 0x40 56 | noclose: 57 | 58 | cmp eax , 0x106 ; Menu close application 59 | jne noc 60 | mov eax , -1 61 | int 0x40 62 | noc: 63 | 64 | cmp eax , 1000 ; Scroll bar 65 | jb noscroll 66 | cmp eax , 1000+200 67 | ja noscroll 68 | mov [scroll_value],eax 69 | call draw_scroll 70 | jmp still 71 | noscroll: 72 | 73 | cmp eax , 2000 ; Scroll bar 74 | jb noscroll2 75 | cmp eax , 2000+200 76 | ja noscroll2 77 | mov [scroll_value2],eax 78 | call draw_scroll2 79 | jmp still 80 | noscroll2: 81 | 82 | cmp eax , 10 83 | jne no_clickme_button 84 | mov eax , 67 85 | mov ebx , [windowx] 86 | add ebx , 32 87 | and ebx , 63 88 | mov [windowx],ebx 89 | add ebx ,100 90 | mov ecx , -1 91 | mov edx , -1 92 | mov esi , -1 93 | int 0x40 94 | jmp still 95 | no_clickme_button: 96 | 97 | jmp still 98 | 99 | windowx: dd 0x0 100 | 101 | ; ********************************************* 102 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 103 | ; ********************************************* 104 | 105 | 106 | draw_window: 107 | 108 | mov eax,12 ; function 12:tell os about windowdraw 109 | mov ebx,1 ; 1, start of draw 110 | int 0x40 111 | 112 | ; DRAW WINDOW ( Type 4 ) 113 | mov eax,0 ; function 0 : define and draw window 114 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] 115 | mov ecx,100*65536+260 ; [y start] *65536 + [y size] 116 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 117 | mov esi,window_label ; pointer to window label (asciiz) or zero 118 | mov edi,menu_struct ; pointer to menu struct or zero 119 | int 0x40 120 | 121 | mov eax , 8 122 | mov ebx , 50 * 65536 + 70 123 | mov ecx , 80 * 65536 + 18 124 | mov edx , 10 125 | mov esi , 0x10000000 126 | mov edi , button_label 127 | int 0x40 128 | 129 | call draw_scroll 130 | 131 | call draw_scroll2 132 | 133 | mov eax,12 ; function 12:tell os about windowdraw 134 | mov ebx,2 ; 2, end of draw 135 | int 0x40 136 | 137 | ret 138 | 139 | 140 | draw_scroll: 141 | 142 | mov eax , 113 143 | mov ebx , 001 shl 16 + 260 144 | mov ecx , 060 shl 16 + 160 145 | mov edx , 1000 146 | mov esi , 200 147 | mov edi , [scroll_value] 148 | int 0x40 149 | 150 | ret 151 | 152 | 153 | draw_scroll2: 154 | 155 | mov eax , 113 156 | mov ebx , 002 shl 16 + 220 157 | mov ecx , 030 shl 16 + 210 158 | mov edx , 2000 159 | mov esi , 200 160 | mov edi , [scroll_value2] 161 | int 0x40 162 | 163 | ret 164 | 165 | 166 | 167 | ; DATA AREA 168 | 169 | 170 | text: 171 | 172 | db 'THIS IS AN EXAMPLE PROGRAM YOU COULD ' 173 | db 'USE, A:\EXAMPLE.ASM CODE IS COMMENTED ' 174 | db 'AND CLEAR. SYSTEM FUNCTIONS ARE IN FILE ' 175 | db 'SYSFUNCS.TXT ' 176 | 177 | db 'x <- END MARKER, DONT DELETE ' 178 | 179 | scroll_value: 180 | 181 | dd 1000+100 182 | 183 | scroll_value2: 184 | 185 | dd 2000+100 186 | 187 | button_label: 188 | 189 | db 'CLICK ME',0 190 | 191 | window_label: 192 | 193 | db 'EXAMPLE APPLICATION',0 194 | 195 | menu_struct: ; Menu Struct 196 | 197 | dq 0 ; Version 198 | 199 | dq 0x100 ; Start value of ID to return ( ID + Line ) 200 | 201 | ; Returned when menu closes and 202 | ; user made no selections. 203 | 204 | db 0,'FILE',0 ; ID = 0x100 + 1 205 | db 1,'New',0 ; ID = 0x100 + 2 206 | db 1,'Open..',0 ; ID = 0x100 + 3 207 | db 1,'Save..',0 ; ID = 0x100 + 4 208 | db 1,'-',0 ; ID = 0x100 + 5 209 | db 1,'Quit',0 ; ID = 0x100 + 6 210 | 211 | db 0,'HELP',0 ; ID = 0x100 + 7 212 | db 1,'Contents..',0 ; ID = 0x100 + 8 213 | db 1,'About..',0 ; ID = 0x100 + 9 214 | 215 | db 255 ; End of Menu Struct 216 | 217 | I_END: 218 | 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /Apps/END.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; END 3 | ; 4 | ; Ok, this is the sceleton that MENUET 0.38 understands. 5 | ; Do not change the header bits for now. Compile with fasm. 6 | ; 7 | 8 | use32 9 | 10 | org 0x0 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image end 15 | dd 0x100000 ; reguired amount of memory 16 | dd 0x00000000 ; reserved=no extended header 17 | 18 | 19 | START: 20 | 21 | call draw_window 22 | 23 | still: 24 | 25 | mov eax,10 ; wait here for event 26 | int 0x40 27 | 28 | cmp eax,1 29 | jz red 30 | cmp eax,2 31 | jz key 32 | cmp eax,3 33 | jz button 34 | 35 | jmp still 36 | 37 | red: 38 | call draw_window 39 | jmp still 40 | 41 | key: 42 | mov eax,2 43 | int 0x40 44 | 45 | jmp still 46 | 47 | button: 48 | 49 | mov eax,17 50 | int 0x40 51 | 52 | cmp ah,3 53 | jz boot 54 | 55 | mov eax,0xffffffff ; close this program 56 | int 0x40 57 | 58 | ; end of program 59 | 60 | boot: 61 | 62 | mov eax,18 ; system boot 63 | mov ebx,1 64 | int 0x40 65 | 66 | mov eax,0xffffffff ; close this program 67 | int 0x40 68 | 69 | 70 | draw_window: 71 | 72 | pusha 73 | 74 | mov eax,48 75 | mov ebx,3 76 | mov ecx,I_END 77 | mov edx,40 78 | int 0x40 79 | 80 | mov eax,12 ; tell os about redraw start 81 | mov ebx,1 82 | int 0x40 83 | 84 | mov eax,14 ; get screen max x & max y 85 | int 0x40 86 | 87 | shr eax,17 88 | sub eax,93 89 | shl eax,16 90 | mov ebx,eax 91 | add ebx,186 92 | 93 | mov eax,0 ; define and draw window 94 | mov ecx,190*65536+85 95 | mov edx,0x04ffffff 96 | mov esi,window_label ; [I_END+24] 97 | mov edi,0 98 | int 0x40 99 | 100 | mov eax,8 101 | mov ebx,26*65536+60 ; button start x & size 102 | mov ecx,47*65536+15 ; button start y & size 103 | mov edx,3 ; button number 104 | mov esi,0x10000000 105 | mov edi,button_label_1 106 | int 0x40 107 | 108 | mov eax,8 109 | mov ebx,98*65536+60 ; button start x & size 110 | mov ecx,47*65536+15 ; button start y & size 111 | mov edx,2 ; button number 112 | mov esi,0x10000000 113 | mov edi,button_label_2 114 | int 0x40 115 | 116 | mov eax,12 ; tell os about redraw end 117 | mov ebx,2 118 | int 0x40 119 | 120 | popa 121 | 122 | ret 123 | 124 | window_label: 125 | 126 | db 'EXIT MENUET',0 127 | 128 | button_label_1: 129 | 130 | db 'YES',0 131 | 132 | button_label_2: 133 | 134 | db 'NO',0 135 | 136 | I_END: 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /Apps/ETHSTAT.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Stack Status Monitor 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image size 15 | dd 0x100000 ; required amount of memory 16 | dd 0x00000000 ; reserved=no extended header 17 | 18 | 19 | START: ; start of execution 20 | 21 | call read_status 22 | call draw_window ; at first, draw the window 23 | 24 | still: 25 | 26 | mov eax,23 ; wait here for event 27 | mov ebx,200 ; Time out after 2s 28 | int 0x40 29 | 30 | cmp eax,1 ; redraw request ? 31 | jz red 32 | cmp eax,2 ; key in buffer ? 33 | jz key 34 | cmp eax,3 ; button in buffer ? 35 | jz button 36 | 37 | call read_status 38 | call draw_window 39 | 40 | jmp still 41 | 42 | read_status: 43 | 44 | ; read the stack status data, and write it to the screen buffer 45 | 46 | mov eax, 53 47 | mov ebx, 255 48 | mov ecx, 6 49 | int 0x40 50 | 51 | mov ebx, text + 24 52 | call printhex 53 | 54 | mov eax, 53 55 | mov ebx, 255 56 | mov ecx, 2 57 | int 0x40 58 | 59 | mov ebx, text + 107 60 | call printhex 61 | 62 | mov eax, 53 63 | mov ebx, 255 64 | mov ecx, 5 65 | int 0x40 66 | 67 | mov ebx, text + 107 + 40 68 | call printhex 69 | 70 | mov eax, 53 71 | mov ebx, 255 72 | mov ecx, 4 73 | int 0x40 74 | 75 | mov ebx, text + 107 + 80 76 | call printhex 77 | 78 | mov eax, 53 79 | mov ebx, 255 80 | mov ecx, 3 81 | int 0x40 82 | 83 | mov ebx, text + 107 + 120 84 | call printhex 85 | 86 | mov eax, 53 87 | mov ebx, 255 88 | mov ecx, 100 89 | int 0x40 90 | 91 | mov ebx, text + 258 + 40 92 | call printhex 93 | 94 | mov eax, 53 95 | mov ebx, 255 96 | mov ecx, 101 97 | int 0x40 98 | 99 | mov ebx, text + 258 + 80 100 | call printhex 101 | 102 | mov eax, 53 103 | mov ebx, 255 104 | mov ecx, 102 105 | int 0x40 106 | 107 | mov ebx, text + 258 + 120 108 | call printhex 109 | 110 | mov eax, 53 111 | mov ebx, 255 112 | mov ecx, 103 113 | int 0x40 114 | 115 | mov ebx, text + 258 + 160 116 | call printhex 117 | 118 | ret 119 | 120 | 121 | red: ; redraw 122 | call draw_window 123 | jmp still 124 | 125 | key: ; Keys are not valid at this part of the 126 | mov eax,2 ; loop. Just read it and ignore 127 | int 0x40 128 | jmp still 129 | 130 | button: ; button 131 | mov eax,17 ; get id 132 | int 0x40 133 | 134 | cmp ah,1 ; button id=1 ? 135 | jnz still 136 | 137 | mov eax,0xffffffff ; close this program 138 | int 0x40 139 | 140 | jmp still 141 | 142 | 143 | 144 | 145 | ; ********************************************* 146 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 147 | ; ********************************************* 148 | 149 | 150 | draw_window: 151 | 152 | mov eax,12 ; function 12:tell os about windowdraw 153 | mov ebx,1 ; 1, start of draw 154 | int 0x40 155 | 156 | ; DRAW WINDOW 157 | mov eax,0 ; function 0 : define and draw window 158 | mov ebx,100*65536+260 ; [x start] *65536 + [x size] 159 | mov ecx,100*65536+210 ; [y start] *65536 + [y size] 160 | mov edx,0x04ffffff ; color of work area RRGGBB 161 | mov esi,window_label ; color of grab bar RRGGBB,8->co 162 | mov edi,0 ; color of frames RRGGBB 163 | int 0x40 164 | 165 | ; Screen text 166 | 167 | mov ebx,25*65536+40 ; draw info text with function 4 168 | mov ecx,0x000000 169 | mov edx,text 170 | mov esi,40 171 | newline: 172 | mov eax,4 173 | int 0x40 174 | add ebx,14 175 | add edx,40 176 | cmp [edx],byte 'x' 177 | jnz newline 178 | 179 | 180 | mov eax,12 ; function 12:tell os about windowdraw 181 | mov ebx,2 ; 2, end of draw 182 | int 0x40 183 | 184 | ret 185 | 186 | ; Taken from PS.ASM 187 | printhex: 188 | ; number in eax 189 | ; print to ebx 190 | ; xlat from hextable 191 | pusha 192 | mov esi, ebx 193 | add esi, 8 194 | mov ebx, hextable 195 | mov ecx, 8 196 | phex_loop: 197 | mov edx, eax 198 | and eax, 15 199 | xlatb 200 | mov [esi], al 201 | mov eax, edx 202 | shr eax, 4 203 | dec esi 204 | loop phex_loop 205 | popa 206 | ret 207 | 208 | 209 | ; DATA AREA 210 | 211 | text: 212 | 213 | db ' Ethernet card status : xxxxxxxx ' 214 | db ' ' 215 | db ' IP packets received : xxxxxxxx ' 216 | db ' ARP packets received : xxxxxxxx ' 217 | db ' Dumped received packets : xxxxxxxx ' 218 | db ' IP packets sent : xxxxxxxx ' 219 | db ' ' 220 | db ' Empty queue : xxxxxxxx ' 221 | db ' IPout queue : xxxxxxxx ' 222 | db ' IPin queue : xxxxxxxx ' 223 | db ' NET1out queue : xxxxxxxx ' 224 | db 'x <- END MARKER, DONT DELETE ' 225 | 226 | 227 | window_label: 228 | 229 | db 'STACK STATUS',0 230 | 231 | hextable db '0123456789ABCDEF' 232 | 233 | 234 | I_END: 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | -------------------------------------------------------------------------------- /Apps/EXAMPLE.ASM: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; 3 | ; M32 Example application 4 | ; 5 | ; Compile with FASM for Menuet 6 | ; 7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8 | 9 | use32 10 | 11 | org 0x0 12 | 13 | db 'MENUET01' ; Header id 14 | dd 0x01 ; Version 15 | dd START ; Start of code 16 | dd I_END ; Size of image 17 | dd 0x100000 ; Memory for app 18 | dd 0x7fff0 ; Esp 19 | dd 0x0,0x0 ; I_Param,I_Icon 20 | 21 | START: ; Start of execution 22 | 23 | call draw_window 24 | 25 | still: 26 | 27 | mov eax,10 ; Wait here for event 28 | int 0x40 29 | 30 | cmp eax,1 ; Redraw request 31 | je red 32 | cmp eax,2 ; Key in buffer 33 | je key 34 | cmp eax,3 ; Button in buffer 35 | je button 36 | 37 | jmp still 38 | 39 | red: ; Redraw 40 | call draw_window 41 | jmp still 42 | 43 | key: ; Key 44 | mov eax,2 ; Just read it and ignore 45 | int 0x40 46 | jmp still 47 | 48 | button: ; Button 49 | mov eax,17 ; Get id 50 | int 0x40 51 | 52 | shr eax , 8 53 | 54 | cmp eax , 1 ; Button close 55 | jne noclose 56 | mov eax , -1 57 | int 0x40 58 | noclose: 59 | 60 | cmp eax , 0x106 ; Menu close 61 | jne noc 62 | mov eax , -1 63 | int 0x40 64 | noc: 65 | 66 | jmp still 67 | 68 | 69 | draw_window: 70 | 71 | mov eax,12 ; Function 12: window draw 72 | mov ebx,1 ; Start of draw 73 | int 0x40 74 | 75 | ; DRAW WINDOW ( Type 4 ) 76 | mov eax,0 ; Function 0 : define and draw window 77 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] 78 | mov ecx,100*65536+160 ; [y start] *65536 + [y size] 79 | mov edx,0x04ffffff ; Color of work area RRGGBB,8->color gl 80 | mov esi,window_label ; Pointer to window label (asciiz) or zero 81 | mov edi,menu_struct ; Pointer to menu struct or zero 82 | int 0x40 83 | 84 | mov eax,4 ; Draw info text 85 | mov ebx,20*65536+70 86 | mov ecx,0x000000 87 | mov edx,text 88 | mov esi,-1 89 | int 0x40 90 | 91 | mov eax,12 ; Function 12: window draw 92 | mov ebx,2 ; End of draw 93 | int 0x40 94 | 95 | ret 96 | 97 | 98 | ; DATA AREA 99 | 100 | window_label: 101 | 102 | db 'EXAMPLE APPLICATION',0 103 | 104 | text: 105 | 106 | db 'SYSTEM FUNCTIONS ARE IN FILE SYSFUNCS.TXT',0 107 | 108 | 109 | menu_struct: ; Menu Struct 110 | 111 | dq 0 ; Version 112 | 113 | dq 0x100 ; Start value of ID to return ( ID + Line ) 114 | 115 | ; Returned when menu closes and 116 | ; user made no selections. 117 | 118 | db 0,'FILE',0 ; ID = 0x100 + 1 119 | db 1,'New',0 ; ID = 0x100 + 2 120 | db 1,'Open..',0 ; ID = 0x100 + 3 121 | db 1,'Save..',0 ; ID = 0x100 + 4 122 | db 1,'-',0 ; ID = 0x100 + 5 123 | db 1,'Quit',0 ; ID = 0x100 + 6 124 | 125 | db 0,'HELP',0 ; ID = 0x100 + 7 126 | db 1,'Contents..',0 ; ID = 0x100 + 8 127 | db 1,'About..',0 ; ID = 0x100 + 9 128 | 129 | db 255 ; End of Menu Struct 130 | 131 | 132 | I_END: 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Apps/EXAMPLE2.ASM: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; 3 | ; MENU / DIALOG EXAMPLE 4 | ; 5 | ; Compile with FASM for Menuet 6 | ; 7 | 8 | use32 9 | 10 | org 0x0 11 | 12 | db 'MENUET01' ; 8 byte id 13 | dd 0x01 ; header version 14 | dd START ; start of code 15 | dd I_END ; size of image 16 | dd 0x100000 ; memory for app 17 | dd 0x7fff0 ; esp 18 | dd 0x0 , 0x0 ; I_Param , I_Icon 19 | 20 | 21 | include 'DIALOGS1.INC' 22 | 23 | menu_history dd 0x0 24 | 25 | START: ; start of execution 26 | 27 | call draw_window_main 28 | 29 | still: ; wait here for event 30 | 31 | mov eax,23 32 | mov ebx,2 33 | int 0x40 34 | 35 | cmp eax,1 ; process events 36 | je red 37 | cmp eax,2 38 | je key 39 | cmp eax,3 40 | je button 41 | 42 | call check_mouse ; DIALOG CHECK 43 | 44 | mov eax,[menu_action] 45 | cmp eax,[menu_history] 46 | je nodisplay 47 | 48 | mov [menu_history],eax 49 | 50 | mov eax,13 51 | mov ebx,220*65536+6*4 52 | mov ecx,70*65536+8 53 | mov edx,0xffffff 54 | int 0x40 55 | 56 | mov eax,4 ; show menu selections 57 | mov ebx,220*65536+70 58 | mov ecx,0x000000 59 | mov edx,menu_action 60 | mov esi,4 61 | int 0x40 62 | 63 | nodisplay: 64 | 65 | cmp word [menu_action],word 'AD' ; user requests close 66 | jne no_menu_close 67 | mov eax,-1 68 | int 0x40 69 | no_menu_close: 70 | 71 | jmp still 72 | 73 | red: ; redraw 74 | call draw_window_main 75 | jmp still 76 | 77 | key: 78 | mov eax,2 ; key in buffer 79 | int 0x40 80 | jmp still 81 | 82 | button: ; button in buffer 83 | mov eax,17 84 | int 0x40 85 | 86 | cmp ah,1 ; close application 87 | jne noclose 88 | mov eax,-1 89 | int 0x40 90 | noclose: 91 | 92 | cmp ah,2 93 | jne no_alert_box ; ALERT BOX 94 | mov eax,170 ; window width 95 | mov ebx,alert_text ; asciiz string 96 | mov ecx,1 ; OK button 97 | call alert_box ; function call 98 | jmp still 99 | no_alert_box: 100 | 101 | cmp ah,3 102 | jne no_choose_box ; CHOOSE BOX 103 | mov eax,220 ; window width 104 | mov ebx,choose_text ; asciiz string 105 | mov ecx,2 ; YES/NO buttons 106 | call alert_box ; function call 107 | jmp still 108 | no_choose_box: 109 | 110 | 111 | jmp still 112 | 113 | 114 | 115 | 116 | ; ********************************************* 117 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 118 | ; ********************************************* 119 | 120 | draw_window_main: 121 | 122 | mov eax,12 ; function 12:tell os about windowdraw 123 | mov ebx,1 ; 1, start of draw 124 | int 0x40 125 | 126 | mov eax,0 ; open window 127 | mov ebx,100*65536+300 128 | mov ecx,100*65536+120 129 | mov edx,0x02ffffff 130 | mov esi,0x805080d0 131 | mov edi,0x005080d0 132 | int 0x40 133 | 134 | call draw_menu ; DRAW MENU 135 | 136 | mov eax,4 ; window label 137 | mov ebx,8*65536+8 138 | mov ecx,0x10ddeeff 139 | mov edx,labelt 140 | mov esi,labellen-labelt 141 | int 0x40 142 | 143 | mov eax,8 ; close button 144 | mov ebx,(300-17)*65536+10 145 | mov ecx,5*65536+10 146 | mov edx,1 147 | mov esi,0x4466bb 148 | int 0x40 149 | 150 | mov eax,8 ; button : OPEN ALERT BOX 151 | mov ebx,25*65536+150 152 | mov ecx,61*65536+14 153 | mov edx,2 154 | mov esi,0x4466aa 155 | int 0x40 156 | 157 | mov eax,8 ; button : OPEN CHOOSE BOX 158 | mov ebx,25*65536+150 159 | mov ecx,81*65536+14 160 | mov edx,3 161 | mov esi,0x4466aa 162 | int 0x40 163 | 164 | mov ebx,20*65536+55 ; draw info text with function 4 165 | mov ecx,0xffffff 166 | mov edx,text 167 | mov esi,40 168 | newline: 169 | mov eax,4 170 | int 0x40 171 | add ebx,10 172 | add edx,40 173 | cmp [edx],byte 'x' 174 | jne newline 175 | 176 | mov eax,12 ; function 12:tell os about windowdraw 177 | mov ebx,2 ; 2, end of draw 178 | int 0x40 179 | 180 | ret 181 | 182 | 183 | ; DATA AREA 184 | 185 | text: 186 | db ' ' 187 | db ' OPEN ALERT BOX ' 188 | db ' ' 189 | db ' OPEN CHOOSE BOX ' 190 | 191 | db 'x <- END MARKER, DONT DELETE ' 192 | 193 | labelt: 194 | db 'EXAMPLE APPLICATION' 195 | labellen: 196 | 197 | alert_text db ' File not found !',0 198 | choose_text db ' Save file before exit ? ',0 199 | 200 | I_END: 201 | 202 | 203 | 204 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /Apps/EYES.RAW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/EYES.RAW -------------------------------------------------------------------------------- /Apps/FILELIB.ASM: -------------------------------------------------------------------------------- 1 | file_handler: 2 | .position=0 3 | .size=4 4 | .bufer_block=8 5 | .operation=12 6 | .first_block=16 7 | .n_blocks=20 8 | .bufer=24 9 | .work_area=28 10 | .name=32 11 | .st_size=32+128 12 | 13 | open: ;esi=name_string 14 | ;retorna eax 15 | pushad 16 | push dword [work_area] 17 | mov ecx,512 ;bufer 18 | call malloc 19 | push edi 20 | mov ecx,file_handler.st_size 21 | call mallocz 22 | pop dword[edi+file_handler.bufer] 23 | pop dword[edi+file_handler.work_area] 24 | mov [esp+28],edi 25 | mov ecx,100 26 | add edi,file_handler.name 27 | call movedata 28 | mov edi,[esp+28] 29 | mov byte[edi+file_handler.n_blocks],1 30 | mov eax,58 31 | lea ebx,[edi+file_handler.operation] 32 | push edi 33 | int 0x40 34 | pop edi 35 | test eax,eax 36 | jnz close.b 37 | mov [edi+file_handler.size],ebx 38 | clc 39 | popad 40 | ret 41 | 42 | close: 43 | pushad 44 | .b: 45 | mov eax,[esp+28] 46 | mov edi,[eax+file_handler.bufer] 47 | call free 48 | mov edi,eax 49 | call free 50 | popad 51 | xor eax,eax 52 | ret 53 | 54 | 55 | read: ;(f,bufer,nbytes) eax,edi,ecx ncr 56 | ;retorna bytes leidos en ecx 57 | pushad 58 | mov edx,[eax+file_handler.size] 59 | sub edx,[eax+file_handler.position] 60 | cmp edx,ecx 61 | jnc .nb_ok 62 | mov ecx,edx 63 | mov [esp+24],edx 64 | .nb_ok: 65 | jecxz .final 66 | mov byte[eax+file_handler.operation],0 67 | test dword[eax+file_handler.position],511 68 | jz .l1 69 | call .bufer 70 | .l1: 71 | mov edx,ecx 72 | shr edx,9 73 | jz .l2 74 | mov [eax+file_handler.n_blocks],edx 75 | mov edx,[eax+file_handler.position] 76 | shr edx,9 77 | mov [eax+file_handler.first_block],edx 78 | xchg edi,[eax+file_handler.bufer] 79 | pushad 80 | lea ebx,[eax+file_handler.operation] 81 | mov eax,58 82 | int 40h 83 | cmp eax,0ffffff00h 84 | jnc .error 85 | popad 86 | xchg edi,[eax+file_handler.bufer] 87 | mov edx,ecx 88 | and edx,0fffffe00h 89 | add [eax+file_handler.position],edx 90 | add edi,edx 91 | .l2: 92 | and ecx,511 93 | jz .final 94 | call .bufer 95 | .final: 96 | popad 97 | ret 98 | 99 | .bufer: 100 | pushad 101 | mov ebx,[eax+file_handler.position] 102 | shr ebx,9 103 | cmp ebx,[eax+file_handler.bufer_block] 104 | je .l3 105 | mov [eax+file_handler.first_block],ebx 106 | mov [eax+file_handler.bufer_block],ebx 107 | mov dword[eax+file_handler.n_blocks],1 108 | lea ebx,[eax+file_handler.operation] 109 | mov eax,58 110 | int 40h 111 | cmp eax,0ffffff00h 112 | jnc .error 113 | .l3: 114 | mov eax,[esp+28] 115 | mov edx,[eax+file_handler.position] 116 | mov esi,[eax+file_handler.bufer] 117 | and edx,511 118 | add esi,edx 119 | neg edx 120 | add edx,512 121 | cmp ecx,edx 122 | jc .l4 123 | mov ecx,edx 124 | .l4: 125 | add [eax+file_handler.position],ecx 126 | sub [esp+24],ecx 127 | pop edi 128 | call movedata 129 | push edi 130 | popad 131 | ret 132 | .error: 133 | popad 134 | popad 135 | xor ecx,ecx 136 | stc 137 | ret 138 | 139 | 140 | ftell: mov edx,[eax+file_handler.position] 141 | ret 142 | lseek: ;eax=file edx=pos 143 | mov [eax+file_handler.position],edx 144 | ret 145 | skip: ;eax=file edx=bytes to skip 146 | add [eax+file_handler.position],edx 147 | ret 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /Apps/FIRE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; FIRE for MENUET - Compile with FASM 3 | ; 4 | 5 | use32 6 | 7 | org 0x0 8 | db 'MENUET00' ; 8 byte id 9 | dd 38 ; required os 10 | dd START ; program start 11 | dd I_END ; image size 12 | dd 0x100000 ; reguired amount of memory 13 | dd 0x00000000 ; reserved=no extended header 14 | 15 | 16 | START: 17 | 18 | call draw_window 19 | 20 | mov edi,0x80000 21 | mov ecx,320*600+100 22 | mov eax,0 23 | cld 24 | rep stosb 25 | 26 | sta: ; calculate fire image 27 | 28 | mov esi, FireScreen 29 | add esi, 0x2300 30 | sub esi, 80 31 | mov ecx, 80 32 | xor edx, edx 33 | 34 | NEWLINE: 35 | 36 | mov eax,dword [FireSeed] ; New number 37 | mov edx, 0x8405 38 | mul edx 39 | inc eax 40 | mov dword [FireSeed], eax ; Store seed 41 | 42 | mov [esi], dl 43 | inc esi 44 | dec ecx 45 | jnz NEWLINE 46 | 47 | mov ecx, 0x2300 48 | sub ecx, 80 49 | mov esi, FireScreen 50 | add esi, 80 51 | 52 | FIRELOOP: 53 | 54 | xor eax,eax 55 | 56 | cmp [type],0 57 | jnz notype1 58 | mov al, [esi] 59 | add al, [esi + 2] 60 | adc ah, 0 61 | add al, [esi + 1] 62 | adc ah, 0 63 | add al, [esi + 81] 64 | adc ah, 0 65 | notype1: 66 | 67 | cmp [type],1 68 | jnz notype2 69 | mov al, [esi] 70 | add al, [esi - 1] 71 | adc ah, 0 72 | add al, [esi - 1] 73 | adc ah, 0 74 | add al, [esi + 79] 75 | adc ah,0 76 | notype2: 77 | 78 | cmp [type],2 79 | jnz notype3 80 | mov al, [esi] 81 | add al, [esi - 1] 82 | adc ah,0 83 | add al, [esi + 1] 84 | adc ah, 0 85 | add al, [esi + 81] 86 | adc ah,0 87 | notype3: 88 | 89 | shr eax, 2 90 | jz ZERO 91 | dec eax 92 | 93 | ZERO: 94 | 95 | mov [esi - 80], al 96 | inc esi 97 | dec ecx 98 | jnz FIRELOOP 99 | 100 | pusha 101 | 102 | mov eax,5 103 | mov ebx,[delay] 104 | int 0x40 105 | 106 | mov al,byte [calc] 107 | inc al 108 | mov byte [calc],al 109 | cmp al,byte 2 110 | jz pdraw 111 | 112 | jmp nodrw 113 | 114 | pdraw: 115 | 116 | mov byte [calc],byte 0 117 | 118 | mov edi,0x80000 119 | add edi,[fcolor] 120 | mov esi,FireScreen 121 | xor edx,edx 122 | 123 | newc: 124 | 125 | movzx eax,byte [esi] 126 | mov ebx,eax 127 | mov ecx,eax 128 | shl ax,8 129 | shr bx,1 130 | mov al,bl 131 | add ecx,eax 132 | shl ax,8 133 | mov ch,ah 134 | 135 | mov [edi+0],cx 136 | mov [edi+3],cx 137 | mov [edi+6],cx 138 | mov [edi+9],cx 139 | mov [edi+0+320*3],cx 140 | mov [edi+3+320*3],cx 141 | mov [edi+6+320*3],cx 142 | mov [edi+9+320*3],cx 143 | 144 | add edi,12 145 | inc edx 146 | cmp edx,80 147 | jnz nnl 148 | xor edx,edx 149 | add edi,320*3 150 | nnl: 151 | inc esi 152 | cmp esi,FireScreen+0x2000 153 | jnz newc 154 | 155 | mov eax,dword 0x00000007 ; display image 156 | mov ebx,0x80000 157 | mov ecx,4*80*65536+200 158 | mov edx,1*65536+22 159 | int 0x40 160 | 161 | nodrw: 162 | 163 | popa 164 | 165 | mov eax,11 ; check if os wants to talk to us 166 | int 0x40 167 | cmp eax,1 168 | jz red 169 | cmp eax,3 170 | jz button 171 | 172 | jmp sta 173 | 174 | red: ; draw window 175 | call draw_window 176 | jmp sta 177 | 178 | button: ; get button id 179 | mov eax,17 180 | int 0x40 181 | 182 | cmp ah,1 183 | jnz noclose 184 | mov eax,-1 ; close this program 185 | int 0x40 186 | noclose: 187 | 188 | cmp ah,2 ; change fire type 189 | jnz nob2 190 | mov eax,[type] 191 | add eax,1 192 | and eax,1 193 | mov [type],eax 194 | nob2: 195 | 196 | cmp ah,3 ; change delay 197 | jnz nob3 198 | mov eax,[delay] 199 | sub eax,1 200 | and eax,1 201 | mov [delay],eax 202 | nob3: 203 | 204 | cmp ah,4 ; change color 205 | jnz nob4 206 | mov eax,[fcolor] 207 | add eax,1 208 | cmp eax,2 209 | jbe fcok 210 | mov eax,0 211 | fcok: 212 | mov [fcolor],eax 213 | mov eax,0 214 | mov ecx,0x10000 215 | mov edi,0x80000 216 | cld 217 | rep stosd 218 | 219 | nob4: 220 | 221 | jmp sta 222 | 223 | 224 | 225 | ; ************************************************ 226 | ; ********* WINDOW DEFINITIONS AND DRAW ********** 227 | ; ************************************************ 228 | 229 | 230 | draw_window: 231 | 232 | pusha 233 | 234 | mov eax,12 ; tell os about redraw 235 | mov ebx,1 236 | int 0x40 237 | 238 | mov eax,0 ; define and draw window 239 | mov ebx,100*65536+321 240 | mov ecx,70*65536+222 241 | mov edx,0x00000000 242 | mov esi,0x00000000 243 | mov edi,0x00000000 244 | int 0x40 245 | 246 | mov eax,dword 0x00000004 ; 'FIRE FOR MENUET' 247 | mov ebx,110*65536+8 248 | mov ecx,dword 0x00FFFFFF 249 | mov edx,text 250 | mov esi,textlen-text 251 | int 0x40 252 | 253 | mov eax,8 254 | mov ebx,(321-19)*65536+12 ; button start x & size 255 | mov ecx,5*65536+12 ; button start y & size 256 | mov edx,1 ; button number 257 | mov esi,0x009a0000 258 | int 0x40 259 | 260 | mov eax,8 261 | mov ebx,5*65536+12 262 | mov ecx,5*65536+12 263 | mov edx,2 264 | int 0x40 265 | 266 | mov eax,8 267 | mov ebx,18*65536+12 268 | mov ecx,5*65536+12 269 | mov edx,3 270 | int 0x40 271 | 272 | mov eax,8 273 | mov ebx,31*65536+12 274 | mov ecx,5*65536+12 275 | mov edx,4 276 | int 0x40 277 | 278 | mov eax,12 ; tell os about redraw end 279 | mov ebx,2 280 | int 0x40 281 | 282 | popa 283 | 284 | ret 285 | 286 | 287 | ; DATA SECTION 288 | 289 | calc dd 0 290 | fcolor dd 2 291 | xx db 'x' 292 | type dd 0 293 | delay dd 1 294 | FireSeed dd 0x1234 295 | text: db 'FIRE FOR MENUET' 296 | textlen: 297 | 298 | FireScreen: 299 | 300 | I_END: 301 | 302 | 303 | 304 | 305 | -------------------------------------------------------------------------------- /Apps/HD.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/HD.BMP -------------------------------------------------------------------------------- /Apps/HDBOOT.TXT: -------------------------------------------------------------------------------- 1 | 2 | HOWTO.TXT 3 | 4 | 5 | 1) How to load RAM image from hd at boot-time ? 6 | 7 | At this point you'll still need the floppy. 8 | 9 | The image is loaded from the root of fat32 partition (win95/98) 10 | located at PRIMARY MASTER's first partition (mostly drive C:) 11 | 12 | Basicly, all you have to do is to copy the MSETUP.EXE (0.65 pre-5 +) 13 | to root of your win95/98 C: drive and Menuet will load the image 14 | from that file. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Apps/ICON.LST: -------------------------------------------------------------------------------- 1 | AA - FINDER.ICO - SYSTREE - SYSTREE * 2 | BA - FASM.ICO - FASM - FASM * 3 | CA - WRITE.BMP - TINYPAD - TINYPAD * 4 | AB - SETUP.ICO - SETUP - SETUP * 5 | BB - CPU.ICO - CPU - CPU * 6 | AC - SETUP.ICO - ICONMNGR - DESKTOP * 7 | HA - SETUP.ICO - STACKCFG - STACK * 8 | IA - REMOTE.ICO - NNTPC - NEWS * 9 | JA - BROWSER.ICO - HTTPS - HTTPS * 10 | IB - SETUP.ICO - ETHSTAT - ETHSTAT * 11 | JB - BROWSER.ICO - TFTPC - TFTPC * 12 | IC - IRC.ICO - AIRC - IRC * 13 | JC - CHESS.ICO - CHESS - CHESS * 14 | JI - SHOOTER.ICO - FREE3D04 - 3D-MAZE * 15 | II - C4.ICO - C4 - C-4 * 16 | -------------------------------------------------------------------------------- /Apps/INDEX.HTM: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | MenuetOS web server - default message 7 | 8 | 9 |

Welcome to MenuetOS server

10 |

11 | If you can read this with an external html-browser then menuet 12 | networking is correctly set up. 13 |

This file: /ramdisk/1/index.htm 14 |

15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Apps/JPEGDAT.ASM: -------------------------------------------------------------------------------- 1 | modes: 2 | dd mcu100,color100,8,8 ;monocromo 3 | dd mcu111,color111,8,8 4 | dd mcu211,color211,16,8 5 | dd mcu411,color411,16,16 6 | 7 | zigzag: 8 | db 0,0, 4+1,0, 32,1, 64,1, 36,2, 8+1,0, 12+1,0, 40,4 9 | db 68,2, 96,1, 128,1, 100,2, 72,4, 44,8, 16+1,0, 20+1,0 10 | db 48,16, 76,8, 104,4, 132,2, 160,1, 192,1, 164,2, 136,4 11 | db 108,8, 80,16, 52,32, 24+1,0, 28+1,0, 56,64, 84,32, 112,16 12 | db 140,8, 168,4, 196,2, 224,1, 228,2, 200,4, 172,8, 144,16 13 | db 116,32, 88,64, 60,128, 92,128, 120,64, 148,32, 176,16, 204,8 14 | db 232,4, 236,8, 208,16, 180,32, 152,64, 124,128, 156,128, 184,64 15 | db 212,32, 240,16, 244,32, 216,64, 188,128, 220,128, 248,64, 252,128 16 | 17 | k: 18 | dd 1.41421,1.84776,1.08239,-2.6131 19 | k2: 20 | dd 0.3535534,0.49039264,0.46193953,0.415734806 21 | dd 0.3535534,0.277785116,0.191341716,0.0975451609 22 | 23 | -------------------------------------------------------------------------------- /Apps/JPEGLIB.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/JPEGLIB.ASM -------------------------------------------------------------------------------- /Apps/JPEGVIEW.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/JPEGVIEW.JPG -------------------------------------------------------------------------------- /Apps/LEFT.RAW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/LEFT.RAW -------------------------------------------------------------------------------- /Apps/MACROS.INC: -------------------------------------------------------------------------------- 1 | ; new application structure 2 | macro meos_app_start 3 | { 4 | use32 5 | org 0x0 6 | 7 | db 'MENUET01' 8 | dd 0x01 9 | dd __start 10 | dd __end 11 | dd __memory 12 | dd __stack 13 | 14 | if used __params & ~defined __params 15 | dd __params 16 | else 17 | dd 0x0 18 | end if 19 | 20 | dd 0x0 21 | } 22 | MEOS_APP_START fix meos_app_start 23 | 24 | macro code 25 | { 26 | __start: 27 | } 28 | CODE fix code 29 | 30 | macro data 31 | { 32 | __data: 33 | } 34 | DATA fix data 35 | 36 | macro udata 37 | { 38 | if used __params & ~defined __params 39 | __params: 40 | db 0 41 | __end: 42 | rb 255 43 | else 44 | __end: 45 | end if 46 | __udata: 47 | } 48 | UDATA fix udata 49 | 50 | macro meos_app_end 51 | { 52 | align 32 53 | rb 2048 54 | __stack: 55 | __memory: 56 | } 57 | MEOS_APP_END fix meos_app_end 58 | 59 | 60 | 61 | ; language for programs 62 | lang fix en ; ru en fr ge fi 63 | 64 | 65 | 66 | ; optimize the code for size 67 | macro add arg1,arg2 68 | { 69 | if arg1 in 70 | if arg2 eqtype 0 71 | if arg2 = 1 72 | inc arg1 73 | else 74 | add arg1,arg2 75 | end if 76 | else 77 | add arg1,arg2 78 | end if 79 | else 80 | add arg1,arg2 81 | end if 82 | } 83 | 84 | macro sub arg1,arg2 85 | { 86 | if arg2 eqtype 0 87 | if arg2 = 1 88 | dec arg1 89 | else 90 | sub arg1,arg2 91 | end if 92 | else 93 | sub arg1,arg2 94 | end if 95 | } 96 | 97 | macro mov arg1,arg2 98 | { 99 | if arg1 in 100 | if arg2 eqtype 0 101 | if arg2 = 0 102 | xor arg1,arg1 103 | else if arg2 = 1 104 | xor arg1,arg1 105 | inc arg1 106 | else if arg2 = -1 107 | or arg1,-1 108 | else if arg2 > -128 & arg2 < 128 109 | push arg2 110 | pop arg1 111 | else 112 | mov arg1,arg2 113 | end if 114 | else 115 | mov arg1,arg2 116 | end if 117 | else 118 | mov arg1,arg2 119 | end if 120 | } 121 | 122 | 123 | macro struct name 124 | { 125 | virtual at 0 126 | name name 127 | sizeof.#name = $ - name 128 | end virtual 129 | } 130 | 131 | ; structures used in MeOS 132 | struc process_information 133 | { 134 | .cpu_usage dd ? ; +0 135 | .window_stack_position dw ? ; +4 136 | .window_stack_value dw ? ; +6 137 | .not_used1 dw ? ; +8 138 | .process_name rb 12 ; +10 139 | .memory_start dd ? ; +22 140 | .used_memory dd ? ; +26 141 | .PID dd ? ; +30 142 | .x_start dd ? ; +34 143 | .y_start dd ? ; +38 144 | .x_size dd ? ; +42 145 | .y_size dd ? ; +46 146 | .slot_state dw ? ; +50 147 | rb (1024-52) 148 | } 149 | struct process_information 150 | 151 | struc system_colors 152 | { 153 | .frame dd ? 154 | .grab dd ? 155 | .grab_button dd ? 156 | .grab_button_text dd ? 157 | .grab_text dd ? 158 | .work dd ? 159 | .work_button dd ? 160 | .work_button_text dd ? 161 | .work_text dd ? 162 | .work_graph dd ? 163 | } 164 | struct system_colors 165 | 166 | 167 | ; constants 168 | 169 | ; events 170 | EV_IDLE = 0 171 | EV_TIMER = 0 172 | EV_REDRAW = 1 173 | EV_KEY = 2 174 | EV_BUTTON = 3 175 | EV_EXIT = 4 176 | EV_BACKGROUND = 5 177 | EV_MOUSE = 6 178 | EV_IPC = 7 179 | EV_STACK = 8 180 | 181 | ; event mask bits for function 40 182 | EVM_REDRAW = 1b 183 | EVM_KEY = 10b 184 | EVM_BUTTON = 100b 185 | EVM_EXIT = 1000b 186 | EVM_BACKGROUND = 10000b 187 | EVM_MOUSE = 100000b 188 | EVM_IPC = 1000000b 189 | EVM_STACK = 10000000b -------------------------------------------------------------------------------- /Apps/MB.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MB.BMP -------------------------------------------------------------------------------- /Apps/MC.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MC.BMP -------------------------------------------------------------------------------- /Apps/MEMLIB.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MEMLIB.ASM -------------------------------------------------------------------------------- /Apps/MEMUSE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; MEMORY USAGE 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | db 'MENUET00' ; 8 byte id 11 | dd 38 ; required os 12 | dd START ; program start 13 | dd I_END ; program image size 14 | dd 0x100000 ; required amount of memory 15 | ; esp = 0x7FFF0 16 | dd 0x00000000 ; reserved=no extended header 17 | 18 | 19 | 20 | START: ; start of execution 21 | 22 | call draw_window ; at first, draw the window 23 | 24 | still: 25 | 26 | call draw_window 27 | call draw_usage 28 | 29 | mov eax,23 ; wait here for event 30 | mov ebx,200 31 | int 0x40 32 | 33 | cmp eax,1 ; redraw request ? 34 | je red 35 | cmp eax,2 ; key in buffer ? 36 | je key 37 | cmp eax,3 ; button in buffer ? 38 | je button 39 | 40 | jmp still 41 | 42 | red: ; redraw 43 | call draw_window 44 | jmp still 45 | 46 | key: ; key 47 | mov eax,2 ; just read it and ignore 48 | int 0x40 49 | jmp still 50 | 51 | button: ; button 52 | mov eax,17 ; get id 53 | int 0x40 54 | 55 | cmp ah,1 ; button id=1 ? 56 | jne noclose 57 | mov eax,-1 ; close this program 58 | int 0x40 59 | noclose: 60 | 61 | jmp still 62 | 63 | 64 | draw_usage: 65 | 66 | pusha 67 | 68 | mov edi,1 69 | 70 | mov ecx,1 71 | mov ebx,I_END 72 | drl1: 73 | mov eax,9 74 | int 0x40 75 | 76 | cmp ecx,eax 77 | jg drl11 78 | 79 | cmp ecx,84 80 | jge drl3 81 | 82 | pusha ; blue 83 | mov ebx,5*65536+390 84 | shl ecx,16+1 85 | add ecx,65536*30 86 | mov cx,2 87 | mov edx,0x1111cc 88 | mov eax,13 89 | int 0x40 90 | popa 91 | 92 | pusha ; white 93 | mov ebx,[I_END+22] 94 | shr ebx,17 95 | shl ebx,16 96 | mov eax,[I_END+26] 97 | shr eax,17 98 | mov bx,ax 99 | add ebx,10*65536+1 100 | shl ecx,16+1 101 | add ecx,65536*30 102 | mov cx,1 103 | mov edx,0xffffff 104 | mov eax,13 105 | int 0x40 106 | popa 107 | 108 | drl3: 109 | 110 | mov esi,[I_END+22] 111 | add esi,[I_END+26] 112 | cmp esi,edi 113 | jbe drl6 114 | mov edi,esi 115 | drl6: 116 | 117 | inc ecx 118 | 119 | jmp drl1 120 | 121 | drl11: 122 | 123 | mov eax,9 124 | mov ebx,I_END 125 | mov ecx,1 126 | int 0x40 127 | 128 | mov ecx,eax 129 | mov eax,47 130 | mov ebx,4*65536 131 | mov edx,10*65536+235 132 | mov esi,0xffffff 133 | int 0x40 134 | 135 | mov ecx,edi 136 | mov eax,47 137 | mov ebx,1*256+12*65536 138 | mov edx,50*65536+235 139 | mov esi,0xffffff 140 | int 0x40 141 | 142 | shr ecx,17 143 | add ecx,10 144 | mov ebx,ecx 145 | shl ebx,16 146 | mov bx,cx 147 | mov ecx,34*65536+200 148 | mov edx,0xff0000 149 | mov eax,38 150 | int 0x40 151 | 152 | popa 153 | ret 154 | 155 | 156 | 157 | ; ********************************************* 158 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 159 | ; ********************************************* 160 | 161 | 162 | draw_window: 163 | 164 | mov eax,12 ; function 12:tell os about windowdraw 165 | mov ebx,1 ; 1, start of draw 166 | int 0x40 167 | 168 | ; DRAW WINDOW 169 | mov eax,0 ; function 0 : define and draw window 170 | mov ebx,10*65536+530 ; [x start] *65536 + [x size] 171 | mov ecx,10*65536+250 ; [y start] *65536 + [y size] 172 | mov edx,0x031111cc ; color of work area RRGGBB,8->color glide 173 | mov esi,0x8099bbff ; color of grab bar RRGGBB,8->color glide 174 | mov edi,0x00ffffff ; color of frames RRGGBB 175 | int 0x40 176 | 177 | ; WINDOW LABEL 178 | mov eax,4 ; function 4 : write text to window 179 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 180 | mov ecx,0x00ffffff ; color of text RRGGBB 181 | mov edx,labelt ; pointer to text beginning 182 | mov esi,labellen-labelt ; text length 183 | int 0x40 184 | 185 | mov ebx,10 186 | mov edi,64 187 | mov ecx,25 188 | mov edx,0xffffff 189 | newpix: 190 | mov eax,1 191 | int 0x40 192 | add ebx,8 193 | dec edi 194 | jne newpix 195 | 196 | mov eax,12 ; function 12:tell os about windowdraw 197 | mov ebx,2 ; 2, end of draw 198 | int 0x40 199 | 200 | ret 201 | 202 | 203 | ; DATA AREA 204 | 205 | labelt: 206 | db 'MEMORY USAGE' 207 | labellen: 208 | 209 | I_END: 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /Apps/MENUET.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MENUET.BMP -------------------------------------------------------------------------------- /Apps/MENUET.MP3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MENUET.MP3 -------------------------------------------------------------------------------- /Apps/MIDIPLAY.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ok, this is the sceleton that MENUET 0.01 understands. 3 | ; Do not change the header bits for now. Compile with nasm. 4 | ; 5 | 6 | 7 | use32 8 | 9 | org 0x0 10 | db 'MENUET00' ; 8 byte id 11 | dd 38 ; required os 12 | dd START ; program start 13 | dd I_END ; program image size 14 | dd 0x100000 ; reguired amount of memory 15 | dd 0x00000000 ; reserved=no extended header 16 | 17 | 18 | 19 | START: 20 | 21 | call draw_window 22 | 23 | still: 24 | 25 | mov eax,10 ; redraw ? 26 | int 0x40 27 | 28 | cmp eax,1 29 | jz red 30 | cmp eax,3 31 | jz button 32 | jmp still 33 | 34 | red: 35 | call draw_window 36 | jmp still 37 | 38 | button: 39 | mov eax,17 40 | int 0x40 41 | 42 | cmp al,byte 0 43 | jnz still 44 | 45 | cmp ah,1 46 | jnz noexit 47 | 48 | mov eax,0xffffffff 49 | int 0x40 50 | 51 | noexit: 52 | 53 | cmp ah,2 54 | jz note1 55 | 56 | mov eax,20 ; reset midi device 57 | mov ebx,1 58 | mov ecx,0 59 | int 0x40 60 | 61 | cmp eax,0 62 | jz noe1 63 | 64 | call printerror 65 | 66 | noe1: 67 | 68 | jmp still 69 | 70 | note1: 71 | 72 | mov eax,50 73 | 74 | nn: 75 | 76 | mov ebx,100 77 | call noteout 78 | pusha 79 | mov eax,5 80 | mov ebx,8 81 | int 0x40 82 | popa 83 | mov ebx,0 84 | ; call noteout 85 | 86 | add eax,3 87 | 88 | mov ebx,100 89 | call noteout 90 | pusha 91 | mov eax,5 92 | mov ebx,8 93 | int 0x40 94 | popa 95 | mov ebx,0 96 | ; call noteout 97 | 98 | add eax,4 99 | 100 | inc eax 101 | cmp eax,90 102 | jbe nn 103 | 104 | jmp still 105 | 106 | 107 | draw_window: 108 | 109 | pusha 110 | 111 | mov eax,12 ; tell os about redraw 112 | mov ebx,1 113 | int 0x40 114 | 115 | mov eax,0 ; define and draw window 116 | mov ebx,20*65536+250 117 | mov ecx,20*65536+120 118 | mov edx,0x02ffffff 119 | mov esi,0x805070d0;88ccee 120 | mov edi,0x005070d0;88ccee 121 | int 0x40 122 | 123 | ; CLOSE BUTTON 124 | mov eax,8 ; function 8 : define and draw 125 | mov ebx,(250-19)*65536+12 ; [x start] *65536 + [x size] 126 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 127 | mov edx,1 ; button id 128 | mov esi,0x5577cc ; button color RRGGBB 129 | int 0x40 130 | 131 | 132 | mov eax,4 ; 4 = write text 133 | mov ebx,8*65536+8 134 | mov ecx,dword 0x00ffffff ; 8b window nro - RR GG BB color 135 | mov edx,labelt ; pointer to text beginning 136 | mov esi,labellen-labelt ; text length 137 | int 0x40 138 | 139 | mov eax,8 140 | mov ebx,10*65536+200 ; button start x & size 141 | mov ecx,40 *65536+17 ; button start y & size 142 | mov edx,2 ; button number 143 | mov esi,0x4060b0 ; button color 144 | int 0x40 145 | 146 | mov eax,8 147 | mov ebx,10*65536+200 ; button start x & size 148 | mov ecx,60 *65536+17 ; button start y & size 149 | mov edx,3 ; button number 150 | mov esi,0x4060b0 ; button color 151 | int 0x40 152 | 153 | mov eax,dword 4 154 | mov ebx,25*65536+45 155 | mov ecx,dword 0xffffff 156 | mov edx,buttont 157 | mov esi,buttontlen-buttont 158 | int 0x40 159 | 160 | mov eax,dword 4 161 | mov ebx,25*65536+65 162 | mov ecx,dword 0xffffff 163 | mov edx,buttont2 164 | mov esi,buttontlen2-buttont2 165 | int 0x40 166 | 167 | mov eax,12 ; tell os about redraw end 168 | mov ebx,2 169 | int 0x40 170 | 171 | popa 172 | ret 173 | 174 | 175 | noteout: 176 | 177 | pusha 178 | 179 | push ebx 180 | push eax 181 | 182 | mov eax,20 183 | mov ebx,2 184 | mov ecx,0x9f 185 | int 0x40 186 | mov eax,20 187 | mov ebx,2 188 | pop ecx 189 | int 0x40 190 | mov eax,20 191 | mov ebx,2 192 | pop ecx 193 | int 0x40 194 | 195 | cmp eax,0 196 | jz noe2 197 | 198 | call printerror 199 | 200 | noe2: 201 | 202 | popa 203 | ret 204 | 205 | printerror: 206 | 207 | mov eax,dword 4 208 | mov ebx,15*65536+85 209 | mov ecx,0x000000 210 | mov edx,error1 211 | mov esi,errorlen1-error1 212 | int 0x40 213 | 214 | mov eax,dword 4 215 | mov ebx,15*65536+95 216 | mov ecx,0x000000 217 | mov edx,error2 218 | mov esi,errorlen2-error2 219 | int 0x40 220 | 221 | ret 222 | 223 | 224 | ; DATA AREA 225 | 226 | 227 | labelt: 228 | db 'MIDI TEST' 229 | labellen: 230 | 231 | buttont: 232 | db 'PLAY A FEW NOTES' 233 | buttontlen: 234 | buttont2: 235 | db 'RESET MIDI DEVICE' 236 | buttontlen2: 237 | 238 | error1: 239 | db 'NO BASE DEFINED FOR MPU-401' 240 | errorlen1: 241 | 242 | error2: 243 | db 'USE SETUP AND RESET MIDI DEVICE.' 244 | errorlen2: 245 | 246 | base db 0x0 247 | 248 | 249 | I_END: 250 | -------------------------------------------------------------------------------- /Apps/MPANEL.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MPANEL.BMP -------------------------------------------------------------------------------- /Apps/MT.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MT.BMP -------------------------------------------------------------------------------- /Apps/MTF.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/MTF.BMP -------------------------------------------------------------------------------- /Apps/OPER.RAW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/OPER.RAW -------------------------------------------------------------------------------- /Apps/PAINT.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/PAINT.ASM -------------------------------------------------------------------------------- /Apps/PCI.TXT: -------------------------------------------------------------------------------- 1 | PCI Driver - sysfunc 62 2 | ----------------------- 3 | 4 | bl=0 - get PCI version 5 | OUT: AL=minor, AH=major 6 | bl=1 - get last bus 7 | OUT: AL=last bus in system 8 | bl=2 - get PCI access mechanism 9 | OUT: AL=1 or 2 10 | 11 | bl=4,5,6 - read configuration register (byte,word,dword) 12 | IN: bus in bl 13 | device+func in ch (dddddfff) 14 | register address in cl 15 | word-aligned for word registers (bl=5) 16 | dword-aligned for dword registers (bl=6) 17 | OUT: register contents in AL/AX/EAX 18 | 19 | bl=8,9,10 - write configuration register (byte,word,dword) 20 | IN: bus in bl 21 | device+func in ch (dddddfff) 22 | register address in cl 23 | word-aligned for word registers (bl=9) 24 | dword-aligned for dword registers (bl=10) 25 | value in DL/DX/EDX 26 | OUT: 0 if ok, -1 if err 27 | 28 | 29 | How to scan system for PCI devices 30 | ---------------------------------- 31 | 32 | loop bus from 0 to lastbus 33 | loop devfn from 0 to 255 34 | begin 35 | mov bl,6 36 | mov bh,bus 37 | mov ch,devfn 38 | mov cl,0 ; register adress 39 | mov eax,62 40 | int 0x40 41 | cmp ax,0 42 | je next 43 | cmp ax,0xffff 44 | je next 45 | 46 | ; we've found a device 47 | ; now: EAX = (deviceID<<16)+vendorID 48 | next: 49 | end 50 | 51 | Standard PCI registers 52 | ---------------------- 53 | 54 | 55 | addr type name 56 | 57 | 0 word vendorID 58 | 2 word deviceID 59 | 4 word command_reg 60 | 6 word status_reg 61 | 8 byte revisionID 62 | 9 byte progIF 63 | 10 byte subclass 64 | 11 byte classcode 65 | 12 byte cacheline_size 66 | 13 byte latency 67 | 14 byte header_type 68 | 15 byte BIST 69 | 16 header-type specific 70 | 71 | header_type values: 72 | 0 nonbridge 73 | 1 bridge 74 | 2 cardbus 75 | 76 | nonbridge device registers: 77 | 78 | 16 dword base_adress0 79 | 20 dword base_address1 80 | 24 dword base_address2 81 | 28 dword base_address3 82 | 32 dword base_address4 83 | 36 dword base_address5 84 | 40 dword CardBus_CIS 85 | 44 word subsystem_vendorID 86 | 46 word subsystem_deviceID 87 | 48 dword expansion_ROM 88 | 50 byte cap_ptr 89 | 51 byte reserved1[3] 90 | 54 dword reserved2[1] 91 | 58 byte interrupt_line 92 | 59 byte interrupt_pin 93 | 60 byte min_grant 94 | 61 byte max_latency 95 | 62 dword device_specific[48] 96 | 97 | bridge device registers: 98 | 99 | 16 dword base_adress0 100 | 20 dword base_address1 101 | 24 byte primary_bus 102 | 25 byte secondary_bus 103 | 26 byte subordinate_bus 104 | 27 byte secondary_latency 105 | 28 byte IO_base_low 106 | 29 byte IO_limit_low 107 | 30 word secondary_status 108 | 32 word memory_base_low 109 | 34 word memory_limit_low 110 | 36 word prefetch_base_low 111 | 38 word prefetch_limit_low 112 | 40 dword prefetch_base_high 113 | 44 dword prefetch_limit_high 114 | 48 word IO_base_high 115 | 50 word IO_limit_high 116 | 52 dword reserved2[1] 117 | 56 dword expansion_ROM 118 | 60 byte interrupt_line 119 | 61 byte interrupt_pin 120 | 62 word bridge_control 121 | 64 dword device_specific[48] 122 | 123 | cardbus device registers: 124 | 125 | 16 dword ExCa_base 126 | 20 byte cap_ptr 127 | 21 byte reserved05 128 | 22 word secondary_status 129 | 24 byte PCI_bus 130 | 25 byte CardBus_bus 131 | 26 byte subordinate_bus 132 | 27 byte latency_timer 133 | 28 dword memory_base0 134 | 32 dword memory_limit0 135 | 36 dword memory_base1 136 | 40 dword memory_limit1 137 | 44 word IObase_0low 138 | 46 word IObase_0high 139 | 48 word IOlimit_0low 140 | 50 word IOlimit_0high 141 | 52 word IObase_1low 142 | 54 word IObase_1high 143 | 56 word IOlimit_1low 144 | 58 word IOlimit_1high 145 | 60 byte interrupt_line 146 | 61 byte interrupt_pin 147 | 62 word bridge_control 148 | 64 word subsystem_vendorID 149 | 66 word subsystem_deviceID 150 | 68 dword legacy_baseaddr 151 | 72 dword cardbus_reserved[14] 152 | 128 dword vendor_specific[32] 153 | 154 | 155 | classcode & subclass 156 | -------------------- 157 | 158 | classcode subclass device class 159 | 1 * Disk 160 | 1 0 SCSI 161 | 1 1 IDE 162 | 1 2 Floppy 163 | 1 3 IPI 164 | 1 4 RAID 165 | 166 | 2 * Network 167 | 2 0 Ethernet 168 | 2 1 Token Ring 169 | 2 2 FDDI 170 | 2 3 ATM 171 | 172 | 3 * Display 173 | 3 0 VGA 174 | 3 1 SVGA 175 | 3 2 XGA 176 | 177 | 4 * Multimedia 178 | 4 0 video 179 | 4 1 audio 180 | 181 | 5 * Memory 182 | 5 0 RAM 183 | 5 1 Flash memory 184 | 185 | 6 * Bridge 186 | 6 0 CPU/PCI 187 | 6 1 PCI/ISA 188 | 6 2 PCI/EISA 189 | 6 3 PCI/MCA 190 | 6 4 PCI/PCI 191 | 6 5 PCI/PCMCIA 192 | 6 6 PCI/NuBus 193 | 6 7 PCI/CardBus 194 | 195 | 7 * Communication 196 | 7 0 serial 197 | 7 1 parallel 198 | 199 | 8 * System peripheral 200 | 8 0 PIC 201 | 8 1 DMAC 202 | 8 2 timer 203 | 8 3 RTC 204 | 205 | 9 * Input 206 | 9 0 keyboard 207 | 9 1 digitizer 208 | 9 2 mouse 209 | 210 | 10 * Docking station 211 | 10 0 generic 212 | 213 | 11 * CPU 214 | 11 0 386 215 | 11 1 486 216 | 11 2 Pentium 217 | 11 3 P6 218 | 11 0x10 Alpha 219 | 11 0x40 coproc 220 | 221 | 12 * SerialBus 222 | 12 0 Firewire 223 | 12 1 ACCESS.bus 224 | 12 2 SSA 225 | 12 3 USB 226 | 12 4 FiberChannel 227 | -------------------------------------------------------------------------------- /Apps/PPP.TXT: -------------------------------------------------------------------------------- 1 | PPP Dialer 2 | ========== 3 | 4 | by Mike Hibbett and Shrirang Bhagwat 5 | 6 | PPP Dialer is a PPP client that connects Menuet to the internet through an 7 | external serial modem. 8 | 9 | PPP dialer uses COM port settings from Stack Configuration application. 10 | For Com1: port 0x3F8 and irq 4. Com2: port 0x2f8 and irq 3. 11 | 12 | Before using PPP you must configure it for your Internet Service Provider. 13 | Details are shown below. 14 | 15 | Once you have configured PPP and re-assembled it, simply run the program and 16 | press DAIL. When the ISP answers the call and the modems establish a 17 | connection ( which can take 30s ), PPP will display 'PPP started'. When 18 | the host has assigned an IP address to menuet you will see 19 | 'IP Link established' and the assigned IP address. 20 | 21 | You do not have to set up or configure any other parts of the stack system. 22 | Once PPP is established, the stack is fully operational. 23 | 24 | To disconnect, click on DISCONNECT. MAke sure your modem hangs up within 10s. 25 | If not, turn the modem off. 26 | 27 | See stack.txt for a description of internet applications available under 28 | Menuet. 29 | 30 | 31 | Configuring PPP 32 | =============== 33 | 34 | To configure PPP you must change the source code and re-assemble it. 35 | 36 | There are three bits of information you need to make the changes 37 | 38 | 1) The telephone number of your ISP 39 | 2) The username that PPP uses when connecting to the ISP 40 | 3) The password that PPP uses when connecting to the ISP 41 | 42 | The source code for PPP is in PPP.ASM and CHAT.INC. 43 | 44 | In file CHAT.INC, change the 'phonenumber' following ATDT to your ISP 45 | telephone number. 46 | 47 | In file PPP.ASM line 2172, change the first 'free' string to your ISP's 48 | username. Change the second 'free' string to your ISP's password. 49 | There are three numbers on this line: 14, 4, 4. 50 | The first number, 14, is the length of the bytes that follow + 4 51 | The second number is the length of the username string 52 | The third number is the length of the password string. 53 | Change these numbers if the lengths of the strings you enter are different 54 | to the lengths of the original strings. 55 | 56 | Here is an example. 57 | 58 | original: PAPREQStr db 14, 4, 'free', 4, 'free' 59 | new: PAPREQStr db 20, 8, 'username', 6, 'passwd' 60 | 61 | When you have made these changes, save them back to the ram disk. 62 | To assemble the changes, run FASM. 63 | Change infile to PPP.ASM 64 | Change outfile to PPP 65 | Click on START COMPILE. 66 | 67 | You can now run PPP from FASM or from the menu. 68 | 69 | 70 | Debugging 71 | ========= 72 | 73 | By default PPP outputs no debuggin information. If you are interested in 74 | seeing what PPP is doing, there are debugging option in the source file 75 | PPP.ASM that you can change. 76 | 77 | These options are 78 | 79 | DEBUG_OUTPUT If set to FALSE, no debugging information is generated 80 | DEBUG_PPP_OUTPUT If set to TRUE, PPP data exchanges are displayed 81 | DEBUG_PORT2_OUTPUT If set to TRUE, debugging information will go to com2 82 | 83 | The debugging output will go to the DEBUG BOARD for display. Every IP 84 | packet received or transmitted is printed. 85 | 86 | This information is actually quite interesting; You can see attempts by 87 | viruses on remote hosts to connect to your machine. 88 | 89 | 90 | Understanding how to configure PPP for connection to an ISP can be quite 91 | difficult, so feel free to contact one of the authors directly or on 92 | the Forum. 93 | 94 | Any questions, contact the authors: 95 | mikehibbett [@] oceanfree.net 96 | b_shrirang@hotmail.com 97 | -------------------------------------------------------------------------------- /Apps/RD2FD.ASM: -------------------------------------------------------------------------------- 1 | ;WARNING! Spaghetti code, size optimized 2 | 3 | use32 4 | 5 | org 0x0 6 | 7 | db 'MENUET01' ; 8 byte id 8 | dd 0x01 ; header version 9 | dd red ; start of code 10 | dd I_END ; size of image 11 | dd 0x270 ; memory for app 12 | dd 0x26f ; esp 13 | dd 0x0 , 0x0 ; I_Param , I_Icon 14 | 15 | still: 16 | 17 | mov eax,10 ; wait here for event 18 | int 0x40 19 | 20 | 21 | cmp eax,1 ; redraw request ? 22 | je red 23 | cmp eax,2 ; key in buffer ? 24 | je key 25 | cmp eax,3 ; button in buffer ? 26 | je button 27 | 28 | ; jmp still 29 | red: ; redraw 30 | call draw_window 31 | key: ; key 32 | ; just read it and ignore 33 | int 0x40 34 | jmp still 35 | 36 | button: ; button 37 | mov eax,17 ; get id 38 | int 0x40 39 | cmp ah,1 ; button id=1 ? 40 | je close 41 | cmp ah,2 42 | je ramdiskcopy 43 | cmp ah,3 44 | je ramdiskupdate 45 | jmp togglewrite 46 | close: 47 | xor eax,eax 48 | dec eax 49 | ; mov eax,-1 ; close this program 50 | jmp callsys 51 | ramdiskcopy: 52 | mov eax,16 53 | xor ebx,ebx 54 | inc ebx 55 | jmp callsys 56 | ramdiskupdate: 57 | mov eax,16 58 | xor ebx,ebx 59 | inc ebx 60 | inc ebx 61 | jmp callsys 62 | togglewrite: 63 | call togglefdcwrite 64 | callsys: 65 | int 0x40 66 | jmp still 67 | 68 | ; get fdc settings for writing & invert them. 69 | togglefdcwrite: 70 | mov eax,16 71 | mov ebx,4 72 | int 0x40 73 | xchg ecx,eax 74 | xor ecx,1 75 | mov eax,16 76 | dec ebx 77 | int 0x40 78 | ;run trough drawwindow :] 79 | 80 | ; ********************************************* 81 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 82 | ; ********************************************* 83 | 84 | 85 | draw_window: 86 | 87 | 88 | mov eax,12 ; function 12:tell os about windowdraw 89 | xor ebx,ebx ; 1, start of draw 90 | inc ebx 91 | int 0x40 92 | 93 | ; DRAW WINDOW 94 | xor eax,eax ; function 0 : define and draw win 95 | mov ebx,100*65536+250 ; [x start] *65536 + [x size] 96 | mov ecx,100*65536+120 ; [y start] *65536 + [y size] 97 | mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl 98 | int 0x40 99 | 100 | ;The important part, the buttons & text. 101 | 102 | mov ebx,9*65536+36 103 | mov ecx,41*65536+14 104 | xor edx,edx 105 | inc edx 106 | inc edx 107 | ;mov edx,2 108 | call clickbox 109 | 110 | mov ebx,67*65536+49 111 | inc edx 112 | call clickbox 113 | 114 | mov ebx,12*65536+12 115 | mov ecx,81*65536+12 116 | inc edx 117 | call clickbox 118 | 119 | mov ecx,96*65536+12 120 | xor edx,edx 121 | call clickbox 122 | 123 | mov edi,0x10000000 124 | mov edx,titlebar 125 | mov ebx,9*65536+9 126 | mov ecx,0x10ffffff 127 | call print 128 | 129 | ; mov edx,h1 130 | mov ebx,11*65536+28 131 | mov ecx,0x10808080 132 | call print 133 | 134 | ; mov edx,comtext 135 | add ebx,15 136 | xchg ecx,edi 137 | call print 138 | 139 | ; mov edx,h2 140 | add ebx,25 141 | xchg ecx,edi 142 | call print 143 | 144 | ; mov edx,setwrite 145 | add ebx,15 146 | xchg ecx,edi 147 | call print 148 | 149 | ; mov edx,setread 150 | add ebx,15 151 | xchg ecx,edi 152 | call print 153 | 154 | mov eax,16 155 | mov ebx,4 156 | int 0x40 157 | test al,1 158 | je nowritex 159 | ; mov edx,xsign 160 | mov ebx,14*65536+83 161 | xchg ecx,edi 162 | call print 163 | nowritex: 164 | mov eax,12 ; function 12:tell os about windowdraw 165 | mov ebx,2 ; 2, end of draw 166 | ret 167 | 168 | clickbox: 169 | pusha 170 | mov edi,edx 171 | cmp edx, 0 172 | je .disabledbox 173 | mov eax,8 ; function 8 : define and draw button 174 | int 0x40 175 | .disabledbox: 176 | inc ecx 177 | inc ebx 178 | mov eax,13 179 | mov edx, 0x808080 180 | int 0x40 181 | cmp edi,0 182 | je .grayed 183 | mov edx,0x80 184 | .grayed: 185 | sub ebx,65536 186 | sub ecx,65536 187 | int 0x40 188 | add ebx,65534 189 | add ecx,65534 190 | mov edx,0xffffff 191 | int 0x40 192 | popa 193 | ret 194 | 195 | print: 196 | mov eax,edx 197 | xor esi,esi 198 | addchar: 199 | inc eax 200 | inc esi 201 | cmp [eax],byte 0 202 | jne addchar 203 | mov eax,4 204 | int 0x40 205 | add edx,esi 206 | inc edx 207 | ret 208 | 209 | 210 | ; DATA AREA 211 | 212 | titlebar: db 'RD2FD',0 213 | h1: db 'Commands',0 214 | comtext: db 'Copy or Update ramdisk to floppy',0 215 | h2: db 'Settings',0 216 | setwrite: db ' Write directly to floppy',0 217 | setread: db ' Read directly from floppy',0 218 | xsign: db 'X',0 219 | I_END: 220 | 221 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /Apps/RD2FD.TXT: -------------------------------------------------------------------------------- 1 | _RD2FD_ 2 | 3 | Important!: 4 | the RAMDISK in memory should be the same as the one on the DISKETTE. (boot with option 1, read from floppy) 5 | Don't remove the diskette while it's written to, or when you are about to write to it. 6 | 7 | Commands: 8 | [Copy] Write the whole ramdisk to the floppy. 9 | [Update] Write only the changes you made to the floppy. 10 | 11 | Settings: 12 | [X] Write directly to floppy: also does an 'update' the next time you save a file. 13 | 14 | Reading is 'grayed out' because it's not implemented yet. 15 | 16 | The settings are currently not saved. This will change in later versions. 17 | -------------------------------------------------------------------------------- /Apps/RD2HD.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; RD2HD 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x300000 ; memory for app 16 | dd 0xfff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | ; 0x0fff0 - STACK 20 | ; 0x20000 - 1.4 Mb IMAGE 21 | 22 | START: ; start of execution 23 | 24 | call draw_window 25 | 26 | still: 27 | 28 | mov eax,10 ; wait here for event 29 | int 0x40 30 | 31 | cmp eax,1 ; redraw request ? 32 | je red 33 | cmp eax,2 ; key in buffer ? 34 | je key 35 | cmp eax,3 ; button in buffer ? 36 | je button 37 | 38 | jmp still 39 | 40 | red: ; redraw 41 | call draw_window 42 | jmp still 43 | 44 | key: ; key 45 | mov eax,2 ; just read it and ignore 46 | int 0x40 47 | 48 | cmp ah,'s' 49 | jne still 50 | 51 | mov esi,reading 52 | call print_text 53 | 54 | mov ecx,0 55 | 56 | newread: 57 | 58 | mov [fileinfo+4],ecx 59 | mov eax,ecx 60 | imul eax,512 61 | add eax,0x20000 62 | mov [fileinfo+12],eax 63 | 64 | mov eax,58 65 | mov ebx,fileinfo 66 | int 0x40 67 | 68 | cmp eax,0 69 | je success_read 70 | 71 | mov esi,read_failed 72 | call print_text 73 | 74 | jmp success 75 | 76 | success_read: 77 | 78 | 79 | inc ecx 80 | cmp ecx,80*18*2 81 | jb newread 82 | 83 | mov esi,saving 84 | call print_text 85 | 86 | mov eax,58 87 | mov ebx,filesave 88 | int 0x40 89 | 90 | mov esi,writefine 91 | call print_text 92 | 93 | cmp eax,0 94 | je success 95 | 96 | mov esi,failed 97 | call print_text 98 | 99 | success: 100 | 101 | mov eax,5 102 | mov ebx,300 103 | int 0x40 104 | 105 | mov esi,waiting 106 | call print_text 107 | 108 | jmp still 109 | 110 | fileinfo: 111 | 112 | dd 8,0,1,0x20000,0x10000 113 | db '/RD/1/',0 114 | 115 | filesave: 116 | 117 | dd 1,0,1474560,0x20000,0x10000 118 | db '/HD/1/MENUET.IMG',0 119 | 120 | button: ; button 121 | mov eax,17 ; get id 122 | int 0x40 123 | 124 | cmp ah,1 ; button id=1 ? 125 | jne noclose 126 | 127 | mov eax,-1 ; close this program 128 | int 0x40 129 | noclose: 130 | 131 | jmp still 132 | 133 | reading: db 'Reading ' 134 | saving: db 'Saving ' 135 | waiting: db 'Waiting for command ' 136 | failed: db 'Write failed! ' 137 | writefine: db 'Write success! ' 138 | read_failed: db 'Read failed! ' 139 | 140 | 141 | print_text: 142 | 143 | pusha 144 | 145 | mov edi,text+40*4+6 146 | mov ecx,19 147 | cld 148 | rep movsb 149 | 150 | call draw_window 151 | 152 | popa 153 | 154 | ret 155 | 156 | 157 | 158 | ; ********************************************* 159 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 160 | ; ********************************************* 161 | 162 | 163 | draw_window: 164 | 165 | 166 | mov eax,12 ; function 12:tell os about windowdraw 167 | mov ebx,1 ; 1, start of draw 168 | int 0x40 169 | 170 | ; DRAW WINDOW 171 | mov eax,0 ; function 0 : define and draw window 172 | mov ebx,100*65536+270 ; [x start] *65536 + [x size] 173 | mov ecx,100*65536+140 ; [y start] *65536 + [y size] 174 | mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl 175 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl 176 | mov edi,0x005080d0 ; color of frames RRGGBB 177 | int 0x40 178 | 179 | ; WINDOW LABEL 180 | mov eax,4 ; function 4 : write text to window 181 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 182 | mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB ) 183 | mov edx,labelt ; pointer to text beginning 184 | mov esi,labellen-labelt ; text length 185 | int 0x40 186 | 187 | ; CLOSE BUTTON 188 | mov eax,8 ; function 8 : define and draw button 189 | mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size] 190 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 191 | mov edx,1 ; button id 192 | mov esi,0x6688dd ; button color RRGGBB 193 | ; int 0x40 194 | 195 | mov ebx,20*65536+45 ; draw info text with function 4 196 | mov ecx,0x224466 197 | mov edx,text 198 | mov esi,40 199 | newline: 200 | mov eax,4 201 | int 0x40 202 | add ebx,15 203 | add edx,40 204 | cmp [edx],byte 'x' 205 | jne newline 206 | 207 | mov eax,12 ; function 12:tell os about windowdraw 208 | mov ebx,2 ; 2, end of draw 209 | int 0x40 210 | 211 | ret 212 | 213 | 214 | ; DATA AREA 215 | 216 | 217 | text: 218 | db ' 1) ENABLE LBA READ AND HD WITH SETUP ' 219 | db ' 2) PRESS TO COPY RAMDISK AS: ' 220 | db ' /HD/1/MENUET.IMG ' 221 | db ' ' 222 | db ' ( WAITING FOR COMMAND ) ' 223 | 224 | db 'x <- END MARKER, DONT DELETE ' 225 | 226 | 227 | labelt: 228 | db 'RD2HD' 229 | labellen: 230 | 231 | I_END: 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /Apps/RDBOOT.DAT: -------------------------------------------------------------------------------- 1 | # Menuets application startup script 2 | 3 | # This file lists the applications that are started automatically on power up. 4 | # Blank lines, or lines beginning with # are ignored - they are comments. 5 | 6 | # The format for each line is: 7 | # APPLICATIONNAME PARAMETER DELAY 8 | # 9 | # applicationname is the filename of the application, in uppercase 10 | # parameter is the string passed to the application - normally boot, 11 | # although programs like tinypad expect a filename instead. This string can be 12 | # up to 64 characters in length. 13 | # delay is the starup delay for the application in ms ( 1000 = 1 second ) 14 | # This is to give some applications time to startup before the next is called. 15 | # 2000 is the recommended default. 16 | 17 | # You may specify up to 50 applications in this file! 18 | 19 | 20 | # If you like the old background image, you can uncomment this line, 21 | # and comment out the JPEGVIEW one. 22 | #PIC4 BOOT 2000 23 | 24 | JPEGVIEW BOOT 2000 25 | 26 | #PANEL BOOT 2000 27 | 28 | ICONMNGR BOOT 2000 29 | 30 | MPANEL BOOT 2000 31 | 32 | # This line opens tinypad and loads this file. 33 | # Not very useful, but it demonstrates other parameter options 34 | #TINYPAD /RD/1/RDBOOT.DAT 2000 35 | -------------------------------------------------------------------------------- /Apps/RDFDEL.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; FILE COPIER 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET00' ; 8 byte id 12 | dd 38 ; required os 13 | dd START ; program start 14 | dd I_END ; program image size 15 | dd 0x100000 ; required amount of memory 16 | dd 0x00000000 ; reserved=no extended header 17 | 18 | 19 | START: ; start of execution 20 | 21 | call draw_window ; at first, draw the window 22 | 23 | still: 24 | 25 | mov eax,10 ; wait here for event 26 | int 0x40 27 | 28 | cmp eax,1 ; redraw request ? 29 | jz red 30 | cmp eax,2 ; key in buffer ? 31 | jz key 32 | cmp eax,3 ; button in buffer ? 33 | jz button 34 | 35 | jmp still 36 | 37 | red: ; redraw 38 | call draw_window 39 | jmp still 40 | 41 | key: ; key 42 | mov eax,2 ; just read it and ignore 43 | int 0x40 44 | jmp still 45 | 46 | button: ; button 47 | mov eax,17 ; get id 48 | int 0x40 49 | 50 | cmp ah,1 ; button id=1 ? 51 | jnz noclose 52 | mov eax,0xffffffff ; close this program 53 | int 0x40 54 | noclose: 55 | 56 | 57 | cmp ah,3 ; delete ? 58 | jnz nodelete 59 | mov eax,32 60 | mov ebx,destination 61 | int 0x40 62 | jmp still 63 | nodelete: 64 | 65 | 66 | cmp ah,4 67 | jz f2 68 | jmp nof12 69 | 70 | f2: 71 | mov [addr],dword destination 72 | mov [ya],dword 35 73 | jmp rk 74 | 75 | rk: 76 | mov edi,[addr] 77 | mov al,' ' 78 | mov ecx,11 79 | rep stosb 80 | 81 | call print_text 82 | 83 | mov edi,[addr] 84 | 85 | f11: 86 | mov eax,10 87 | int 0x40 88 | cmp eax,2 89 | jz fbu 90 | jmp still 91 | fbu: 92 | mov eax,2 93 | int 0x40 94 | shr eax,8 95 | cmp eax,8 96 | jnz nobs 97 | cmp edi,[addr] 98 | jz f11 99 | sub edi,1 100 | mov [edi],byte 0 101 | call print_text 102 | jmp f11 103 | nobs: 104 | cmp eax,dword 31 105 | jbe f11 106 | cmp eax,dword 95 107 | jb keyok 108 | sub eax,32 109 | keyok: 110 | mov [edi],al 111 | 112 | call print_text 113 | 114 | add edi,1 115 | mov esi,[addr] 116 | add esi,11 117 | cmp esi,edi 118 | jnz f11 119 | 120 | jmp still 121 | 122 | print_text: 123 | 124 | mov eax,13 125 | mov ebx,109*65536+11*6 126 | mov ecx,[ya] 127 | shl ecx,16 128 | mov cx,8 129 | mov edx,0xffffff 130 | int 0x40 131 | 132 | mov eax,4 133 | mov ebx,109*65536 134 | add ebx,[ya] 135 | mov ecx,0x000000 136 | mov edx,[addr] 137 | mov esi,11 138 | int 0x40 139 | 140 | ret 141 | 142 | nof12: 143 | jmp still 144 | 145 | 146 | ; ********************************************* 147 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 148 | ; ********************************************* 149 | 150 | 151 | draw_window: 152 | 153 | mov eax,12 ; function 12:tell os about windowdraw 154 | mov ebx,1 ; 1, start of draw 155 | int 0x40 156 | 157 | ; DRAW WINDOW 158 | mov eax,0 ; function 0 : define and draw window 159 | mov ebx,100*65536+230 ; [x start] *65536 + [x size] 160 | mov ecx,100*65536+105 ; [y start] *65536 + [y size] 161 | mov edx,0x03ffffff ; color of work area RRGGBB 162 | mov esi,0x00334455 ; color of grab bar RRGGBB,8->color gl 163 | mov edi,0x00ddeeff ; color of frames RRGGBB 164 | int 0x40 165 | 166 | ; WINDOW LABEL 167 | mov eax,4 ; function 4 : write text to window 168 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 169 | mov ecx,0x00ffffff ; color of text RRGGBB 170 | mov edx,labelt ; pointer to text beginning 171 | mov esi,labellen-labelt ; text length 172 | int 0x40 173 | 174 | mov esi,0x4477cc 175 | 176 | mov eax,8 ; DELETE BUTTON 177 | mov ebx,20*65536+190 178 | mov ecx,63*65536+15 179 | mov edx,3 180 | int 0x40 181 | 182 | mov eax,8 183 | mov ebx,200*65536+10 184 | mov ecx,34*65536+10 185 | mov edx,4 186 | int 0x40 187 | 188 | mov esi,destination 189 | mov edi,text+14 190 | mov ecx,11 191 | cld 192 | rep movsb 193 | 194 | mov ebx,25*65536+35 ; draw info text with function 4 195 | mov ecx,0x0 196 | mov edx,text 197 | mov esi,40 198 | newline: 199 | mov eax,4 200 | int 0x40 201 | add ebx,16 202 | add edx,40 203 | cmp [edx],byte 'x' 204 | jnz newline 205 | 206 | 207 | mov eax,12 ; function 12:tell os about windowdraw 208 | mov ebx,2 ; 2, end of draw 209 | int 0x40 210 | 211 | ret 212 | 213 | 214 | ; DATA AREA 215 | 216 | destination db 'EXAMPLE.ASM' 217 | 218 | addr dd 0x0 219 | ya dd 0x0 220 | 221 | text: 222 | db 'FILENAME : yyyyyyyyyyy ' 223 | db ' ' 224 | db ' DELETE FROM RAMDISK ' 225 | 226 | db 'x <- END MARKER, DONT DELETE ' 227 | 228 | 229 | labelt: 230 | db 'RAMDISK FILE DELETE' 231 | labellen: 232 | 233 | I_END: 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /Apps/RED.DTP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/RED.DTP -------------------------------------------------------------------------------- /Apps/RED.PCX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/RED.PCX -------------------------------------------------------------------------------- /Apps/REMOTE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Remote processing example (remote node) - vt 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | 8 | use32 9 | 10 | org 0x0 11 | 12 | db 'MENUET00' ; 8 byte id 13 | dd 38 ; required os 14 | dd START ; program start 15 | dd I_END ; program image size 16 | dd 0x100000 ; required amount of memory 17 | dd 0x00000000 ; reserved=no extended header 18 | 19 | remote_ip db 192,168,1,26 20 | 21 | 22 | START: ; start of execution 23 | 24 | mov eax, 53 ; open receiver socket 25 | mov ebx, 0 26 | mov ecx, 0x3000 ; local port 27 | mov edx, 0xffff ; remote port 28 | mov esi, dword [remote_ip] ; remote IP 29 | int 0x40 30 | mov [socketNum],eax 31 | mov [0],eax ; save for remote code 32 | 33 | call draw_window ; at first, draw the window 34 | 35 | still: 36 | 37 | mov eax,23 ; wait here for event 38 | mov ebx,1 39 | int 0x40 40 | 41 | cmp eax,1 ; redraw request ? 42 | jz red 43 | cmp eax,2 ; key in buffer ? 44 | jz key 45 | cmp eax,3 ; button in buffer ? 46 | jz button 47 | 48 | mov eax,53 ; data from cluster terminal ? 49 | mov ebx,2 50 | mov ecx,[socketNum] 51 | int 0x40 52 | 53 | cmp eax,0 54 | jne data_arrived 55 | 56 | jmp still 57 | 58 | red: 59 | call draw_window 60 | jmp still 61 | 62 | key: 63 | mov eax,2 64 | int 0x40 65 | jmp still 66 | 67 | button: 68 | 69 | mov eax,53 70 | mov ebx,1 71 | mov ecx,[socketNum] 72 | int 0x40 73 | mov eax,-1 74 | int 0x40 75 | 76 | 77 | data_arrived: 78 | 79 | mov eax,5 ; wait a second for everything to arrive 80 | mov ebx,10 81 | int 0x40 82 | 83 | mov edi,I_END 84 | 85 | get_data: 86 | 87 | mov eax,53 88 | mov ebx,3 89 | mov ecx,[socketNum] 90 | int 0x40 91 | 92 | mov [edi],bl 93 | inc edi 94 | 95 | mov eax,53 96 | mov ebx,2 97 | mov ecx,[socketNum] 98 | int 0x40 99 | 100 | cmp eax,0 101 | jne get_data 102 | 103 | add byte [I_END+14],48 104 | 105 | mov eax,4 106 | mov ebx,10*65536+50 107 | add ebx,[y] 108 | mov ecx,0x000000 109 | mov edx,I_END 110 | mov esi,23 111 | int 0x40 112 | 113 | add [y],10 114 | 115 | cmp byte [I_END+14],'1' ; DATA PACKET ? 116 | jne no_packet 117 | mov esi,I_END+23 118 | mov edi,[I_END+15] 119 | mov ecx,[I_END+19] 120 | cld 121 | rep movsb 122 | jmp still 123 | no_packet: 124 | 125 | cmp byte [I_END+14],'2' ; EXECUTE ? 126 | jne no_execute 127 | mov eax,[I_END+15] 128 | call eax 129 | jmp still 130 | no_execute: 131 | 132 | jmp still 133 | 134 | y dd 0x10 135 | 136 | 137 | 138 | ; ********************************************* 139 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 140 | ; ********************************************* 141 | 142 | 143 | draw_window: 144 | 145 | mov eax,12 ; function 12:tell os about windowdraw 146 | mov ebx,1 ; 1, start of draw 147 | int 0x40 148 | 149 | ; DRAW WINDOW 150 | mov eax,0 ; function 0 : define and draw window 151 | mov ebx,100*65536+286 ; [x start] *65536 + [x size] 152 | mov ecx,100*65536+330 ; [y start] *65536 + [y size] 153 | mov edx,0x03ffffff ; color of work area RRGGBB 154 | mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl 155 | mov edi,0x00aabbcc ; color of frames RRGGBB 156 | int 0x40 157 | 158 | mov eax,8 159 | mov ebx,(286-19)*65536+12 160 | mov ecx,4*65536+12 161 | mov edx,1 162 | mov esi,0xaabbcc 163 | ; int 0x40 164 | 165 | ; WINDOW LABEL 166 | mov eax,4 ; function 4 : write text to window 167 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 168 | mov ecx,0x00ffffff ; color of text RRGGBB 169 | mov edx,labeltext ; pointer to text beginning 170 | mov esi,lte-labeltext ; text length 171 | int 0x40 172 | 173 | ; Re-draw the screen text 174 | cld 175 | mov ebx,10*65536+30 ; draw info text with function 4 176 | mov ecx,0x000000 177 | mov edx,text 178 | mov esi,40 179 | newline: 180 | mov eax,4 181 | int 0x40 182 | add ebx,16 183 | add edx,40 184 | cmp [edx],byte 'x' 185 | jnz newline 186 | 187 | 188 | mov eax,12 ; function 12:tell os about windowdraw 189 | mov ebx,2 ; 2, end of draw 190 | int 0x40 191 | 192 | ret 193 | 194 | 195 | ; DATA AREA 196 | 197 | 198 | text: 199 | db 'THIS NODE : 192.168.1.22 ' 200 | db 'LISTENING TO PORT : 0x3000 ' 201 | db 'x <- END MARKER, DONT DELETE ' 202 | 203 | 204 | labeltext: db 'CLUSTER REMOTE' 205 | lte: 206 | 207 | socketNum dd 0x0 208 | 209 | send_data db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000 210 | db 1 ; 14 send 211 | dd 0x0 ; 15 position 212 | dd 0x0 ; 19 size 213 | ; 23 214 | 215 | execute db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000 216 | db 2 ; 14 execute 217 | dd 0x0 ; 15 position 218 | ; 19 219 | 220 | I_END: 221 | 222 | 223 | 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /Apps/ROSE.TXT: -------------------------------------------------------------------------------- 1 | * . . * 2 | * ... :``..': * 3 | * : ````.' :''::' * 4 | * ..:.. : .'' : * 5 | *``. `: .' : * 6 | * : : : : * 7 | * : : : : * 8 | * : : : : * 9 | * : : :..''''``::. * 10 | * : ...:..' .'' * 11 | * .' .' .::::' * 12 | * :..'''``::::::: * 13 | * ' `:::: * 14 | * `::. * 15 | * `:: * 16 | * :::. * 17 | * ..:```.:'`. ::'`. * 18 | * ..' `:.: :: * 19 | * .: .:``::: * 20 | * .: ..'' ::: * 21 | * : .'' :: * 22 | * : :: * 23 | * : * 24 | * : * 25 | * * 26 | -------------------------------------------------------------------------------- /Apps/RTDATA.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; COMMUNICATING WITH MODEM: PORTS & IRQ 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | 20 | START: ; start of execution 21 | 22 | 23 | mov eax,45 ; reserve irq 4 24 | mov ebx,0 25 | mov ecx,4 26 | int 0x40 27 | 28 | mov eax,46 ; reserve ports 0x3f8-0x3ff 29 | mov ebx,0 30 | mov ecx,0x3f8 31 | mov edx,0x3ff 32 | int 0x40 33 | 34 | mov eax,44 ; read these ports at interrupt/irq 4 35 | mov ebx,irqtable 36 | mov ecx,4 37 | int 0x40 38 | 39 | mov eax,40 ; enable event for interrupt/irq 4 40 | mov ebx,10000b shl 16 + 111b 41 | int 0x40 42 | 43 | call program_com1 44 | 45 | call draw_window 46 | 47 | still: 48 | 49 | mov eax,10 ; wait here for event 50 | int 0x40 51 | 52 | cmp eax,1 ; redraw request ? 53 | je red 54 | cmp eax,2 ; key in buffer ? 55 | je key 56 | cmp eax,3 ; button in buffer ? 57 | je button 58 | cmp eax,16+4 ; data read by interrupt ? 59 | je irq4 60 | 61 | jmp still 62 | 63 | red: ; redraw 64 | call draw_window 65 | jmp still 66 | 67 | key: ; key 68 | mov eax,2 ; just read it and ignore 69 | int 0x40 70 | 71 | mov al,ah 72 | mov dx,0x3f8 73 | out dx,al 74 | 75 | jmp still 76 | 77 | button: ; button 78 | mov eax,17 ; get id 79 | int 0x40 80 | 81 | cmp ah,1 ; button id=1 ? 82 | jne noclose 83 | 84 | mov eax,-1 ; close this program 85 | int 0x40 86 | noclose: 87 | 88 | jmp still 89 | 90 | irq4: 91 | 92 | mov eax,42 93 | mov ebx,4 94 | int 0x40 95 | 96 | ; eax = number of bytes left 97 | ; ecx = 0 success, =1 fail 98 | ; bl = byte 99 | 100 | inc [pos] 101 | and [pos],31 102 | mov eax,[pos] 103 | 104 | mov [text+3*50+eax],bl 105 | call draw_window 106 | 107 | jmp still 108 | 109 | 110 | baudrate_9600 equ 12 111 | baudrate_57600 equ 2 112 | 113 | program_com1: 114 | 115 | mov dx,0x3f8+3 116 | mov al,0x80 117 | out dx,al 118 | 119 | mov dx,0x3f8+1 120 | mov al,0x00 121 | out dx,al 122 | 123 | mov dx,0x3f8+0 124 | mov al,baudrate_9600 125 | out dx,al 126 | 127 | mov dx,0x3f8+3 128 | mov al,0x3 129 | out dx,al 130 | 131 | mov dx,0x3f8+4 132 | mov al,0xb 133 | out dx,al 134 | 135 | mov dx,0x3f8+1 136 | mov al,0x1 137 | out dx,al 138 | 139 | ret 140 | 141 | 142 | 143 | ; ********************************************* 144 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 145 | ; ********************************************* 146 | 147 | 148 | draw_window: 149 | 150 | 151 | mov eax,12 ; function 12:tell os about windowdraw 152 | mov ebx,1 ; 1, start of draw 153 | int 0x40 154 | 155 | ; DRAW WINDOW 156 | mov eax,0 ; function 0 : define and draw window 157 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] 158 | mov ecx,100*65536+120 ; [y start] *65536 + [y size] 159 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 160 | mov esi,window_label ; color of grab bar RRGGBB,8->color gl 161 | mov edi,0 ; color of frames RRGGBB 162 | int 0x40 163 | 164 | ; CLOSE BUTTON 165 | mov eax,8 ; function 8 : define and draw button 166 | mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size] 167 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 168 | mov edx,1 ; button id 169 | mov esi,0x6688dd ; button color RRGGBB 170 | int 0x40 171 | 172 | mov ebx,20*65536+35 ; draw info text with function 4 173 | mov ecx,0x000000 174 | mov edx,text 175 | mov esi,50 176 | newline: 177 | mov eax,4 178 | int 0x40 179 | add ebx,10 180 | add edx,50 181 | cmp [edx],byte 'x' 182 | jne newline 183 | 184 | mov eax,12 ; function 12:tell os about windowdraw 185 | mov ebx,2 ; 2, end of draw 186 | int 0x40 187 | 188 | ret 189 | 190 | 191 | ; DATA AREA 192 | 193 | 194 | text: 195 | 196 | db 'TYPED CHARACTERS ARE SENT TO MODEM IN COM1. ' 197 | db 'DATA FROM MODEM IS READ BY IRQ4 ' 198 | db 'INTERRUPT AND DISPLAYED BELOW. ' 199 | db ' ' 200 | 201 | db 'x <- END MARKER, DONT DELETE ' 202 | 203 | pos dd 0x0 204 | 205 | 206 | window_label: 207 | 208 | db 'RTDATA.ASM',0 209 | 210 | irqtable: 211 | ; port ; 1=byte, 2=word 212 | dd 0x3f8 +0x01000000 ; read byte from port 0x3f8 at interrupt/irq 4 213 | dd 0x0 ; no more ports ( max 15 ) to read 214 | 215 | 216 | I_END: 217 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /Apps/RTDATA.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/RTDATA.BIN -------------------------------------------------------------------------------- /Apps/SCC.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/SCC.BMP -------------------------------------------------------------------------------- /Apps/SCL.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/SCL.BMP -------------------------------------------------------------------------------- /Apps/SCR.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/SCR.BMP -------------------------------------------------------------------------------- /Apps/SETUP.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/SETUP.ASM -------------------------------------------------------------------------------- /Apps/SPANEL.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; PANEL SETUP 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | START: ; start of execution 20 | 21 | call draw_window 22 | 23 | still: 24 | 25 | mov eax,10 ; wait here for event 26 | int 0x40 27 | 28 | cmp eax,1 ; redraw request ? 29 | je red 30 | cmp eax,2 ; key in buffer ? 31 | je key 32 | cmp eax,3 ; button in buffer ? 33 | je button 34 | 35 | jmp still 36 | 37 | red: ; redraw 38 | call draw_window 39 | jmp still 40 | 41 | key: ; key 42 | mov eax,2 ; just read it and ignore 43 | int 0x40 44 | 45 | shr eax,8 46 | cmp eax,'0' 47 | jb still 48 | cmp eax,'9' 49 | jg still 50 | 51 | mov edi,[ent] 52 | add edi,text 53 | mov esi,edi 54 | inc esi 55 | mov ecx,3 56 | cld 57 | rep movsb 58 | 59 | mov [edi],al 60 | 61 | call draw_window 62 | jmp still 63 | 64 | button: ; button 65 | mov eax,17 ; get id 66 | int 0x40 67 | 68 | cmp ah,1 ; button id=1 ? 69 | jne noclose 70 | mov eax,-1 ; close this program 71 | int 0x40 72 | noclose: 73 | 74 | cmp ah,10 75 | jne no_apply 76 | 77 | mov esi,text+17 78 | mov edi,I_END+10 79 | mov ecx,13 80 | newfe: 81 | mov ebx,[esi] 82 | mov [edi],ebx 83 | mov [edi+4],byte ';' 84 | add edi,5 85 | add esi,55 86 | loop newfe 87 | mov [edi],byte 'x' 88 | 89 | mov eax,33 90 | mov ebx,filename 91 | mov ecx,I_END+10 92 | mov edx,5*13+1 93 | mov esi,0 94 | int 0x40 95 | 96 | 97 | mov esi,1 98 | newread: 99 | inc esi 100 | mov eax,9 101 | mov ebx,I_END 102 | mov ecx,esi 103 | int 0x40 104 | cmp esi,eax 105 | jg all_terminated 106 | 107 | cmp [I_END+10],dword 'PANE' 108 | jne newread 109 | cmp [I_END+14],dword 'L ' 110 | jne newread 111 | 112 | mov eax,18 113 | mov ebx,2 114 | mov ecx,esi 115 | int 0x40 116 | 117 | mov eax,5 118 | mov ebx,5 119 | int 0x40 120 | 121 | mov esi,1 122 | 123 | jmp newread 124 | 125 | all_terminated: 126 | 127 | mov eax,5 128 | mov ebx,25 129 | int 0x40 130 | 131 | mov eax,19 132 | mov ebx,panel 133 | mov ecx,0 134 | int 0x40 135 | 136 | 137 | no_apply: 138 | 139 | cmp ah,11 140 | jb no_entry 141 | shr eax,8 142 | sub eax,11 143 | imul eax,55 144 | add eax,17 145 | mov [ent],eax 146 | mov [text+eax],dword '0000' 147 | call draw_window 148 | jmp still 149 | no_entry: 150 | 151 | 152 | jmp still 153 | 154 | 155 | ent dd 17 156 | filename db 'PANEL DAT' 157 | panel db 'PANEL ' 158 | 159 | ; ********************************************* 160 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 161 | ; ********************************************* 162 | 163 | 164 | draw_window: 165 | 166 | 167 | mov eax,12 ; function 12:tell os about windowdraw 168 | mov ebx,1 ; 1, start of draw 169 | int 0x40 170 | 171 | ; DRAW WINDOW 172 | mov eax,0 ; function 0 : define and draw window 173 | mov ebx,100*65536+400 ; [x start] *65536 + [x size] 174 | mov ecx,100*65536+200 ; [y start] *65536 + [y size] 175 | mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl 176 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl 177 | mov edi,0x005080d0 ; color of frames RRGGBB 178 | int 0x40 179 | 180 | ; WINDOW LABEL 181 | mov eax,4 ; function 4 : write text to window 182 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 183 | mov ecx,0x00ddeeff ; color of text RRGGBB 184 | mov edx,labelt ; pointer to text beginning 185 | mov esi,labellen-labelt ; text length 186 | int 0x40 187 | 188 | mov eax,8 189 | mov ebx,25*65536+160 190 | mov ecx,172*65536+12 191 | mov edx,10 192 | mov esi,0x6677cc 193 | int 0x40 194 | 195 | mov eax,8 196 | mov ebx,340*65536+20 197 | mov ecx,34*65536+10 198 | mov edx,11 199 | newb: 200 | int 0x40 201 | add ecx,10*65536 202 | inc edx 203 | cmp edx,24 204 | jb newb 205 | 206 | mov ebx,25*65536+35 ; draw info text with function 4 207 | mov ecx,0x224466 208 | mov edx,text 209 | mov esi,55 210 | newline: 211 | mov eax,4 212 | int 0x40 213 | add ebx,10 214 | add edx,55 215 | cmp [edx],byte 'x' 216 | jne newline 217 | 218 | mov eax,12 ; function 12:tell os about windowdraw 219 | mov ebx,2 ; 2, end of draw 220 | int 0x40 221 | 222 | ret 223 | 224 | 225 | ; DATA AREA 226 | 227 | 228 | text: 229 | 230 | db 'width 0000 : 0 for full screen width <' 231 | db 'buttons 0000 : 0 no frames , 1 frames <' 232 | db 'soften_up 0001 : 0 no , 1 yes <' 233 | db 'soften_down 0001 : 0 no , 1 yes <' 234 | db 'minimize_left 0001 : 0 no , 1 yes <' 235 | db 'minimize_right 0001 : 0 no , 1 yes <' 236 | db 'icons_position 0130 : position in pixels <' 237 | db 'menu_enable 0001 : 0 no , 1 yes <' 238 | db 'setup_enable 0001 : 0 no , 1 yes <' 239 | db 'graph_text 0001 : 0 graphics , 1 text <' 240 | db 'soften_middle 0001 : 0 no , 1 yes <' 241 | db 'icons 0001 : 0 start , 1 activate <' 242 | db 'cpu_usage 0000 : 0 no , 1 yes <' 243 | db ' ' 244 | db ' APPLY ' 245 | db 'x' 246 | 247 | 248 | labelt: 249 | db 'PANEL SETUP' 250 | labellen: 251 | 252 | I_END: 253 | 254 | 255 | 256 | -------------------------------------------------------------------------------- /Apps/STACKINF.ASM: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; ETHERNET SETUP 4 | ;; 5 | 6 | use32 7 | 8 | org 0x0 9 | db 'MENUET00' ; 8 byte id 10 | dd 38 ; required os 11 | dd START ; program start 12 | dd I_END ; program image size 13 | dd 0x100000 ; required amount of memory 14 | dd 0x00000000 ; reserved=no extended header 15 | 16 | START: ; start of execution 17 | 18 | call draw_window ; at first, draw the window 19 | 20 | still: 21 | 22 | mov eax,10 ; wait here for event 23 | int 0x40 24 | 25 | cmp eax,1 ; redraw request ? 26 | jz red 27 | cmp eax,2 ; key in buffer ? 28 | jz key 29 | cmp eax,3 ; button in buffer ? 30 | jz button 31 | 32 | jmp still 33 | 34 | red: ; redraw 35 | call draw_window 36 | 37 | jmp still 38 | 39 | key: ; key 40 | mov eax,2 ; just read it and ignore 41 | int 0x40 42 | 43 | jmp still 44 | 45 | button: ; button 46 | mov eax,17 47 | int 0x40 48 | 49 | cmp ah,1 ; button id=1 ? 50 | jnz noclose 51 | mov eax,-1 ; close this program 52 | int 0x40 53 | noclose: 54 | 55 | cmp ah,2 56 | jne no_details_s 57 | mov eax,19 58 | mov ebx,file1 59 | mov ecx,file2 60 | int 0x40 61 | jmp still 62 | 63 | 64 | no_details_s: 65 | 66 | cmp ah,3 67 | jne still 68 | mov eax,19 69 | mov ebx,file1 70 | mov ecx,file3 71 | int 0x40 72 | jmp still 73 | 74 | 75 | 76 | ; WINDOW DEFINITIONS AND DRAW 77 | 78 | 79 | draw_window: 80 | 81 | mov eax,12 ; function 12:tell os about windowdraw 82 | mov ebx,1 ; 1, start of draw 83 | int 0x40 84 | 85 | ; DRAW WINDOW 86 | mov eax,0 ; function 0 : define and draw window 87 | mov ebx, 50*65536+370 ; [x start] *65536 + [x size] 88 | mov ecx,100*65536+230 ; [y start] *65536 + [y size] 89 | mov edx,0x03ffffff ; color of work area RRGGBB 90 | mov esi,0x80557799 ; color of grab bar RRGGBB,8->color glide 91 | mov edi,esi ; color of frames RRGGBB 92 | and edi,0xffffff 93 | int 0x40 94 | 95 | ; WINDOW LABEL 96 | mov eax,4 ; function 4 : write text to window 97 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 98 | mov ecx,0x00ffffff ; color of text RRGGBB 99 | mov edx,labelt ; pointer to text beginning 100 | mov esi,labellen-labelt ; text length 101 | int 0x40 102 | ; BUTTON 103 | mov eax,8 ; function 8 : define and draw button 104 | mov ebx,202*65536+135 ; [x start] *65536 + [x size] 105 | mov ecx,190*65536+16 ; [y start] *65536 + [y size] 106 | mov edx,2 ; button id 107 | mov esi,edi ; button color RRGGBB 108 | int 0x40 109 | 110 | mov eax,8 ; function 8 : define and draw button 111 | mov ebx,30*65536+135 ; [x start] *65536 + [x size] 112 | mov ecx,190*65536+16 ; [y start] *65536 + [y size] 113 | mov edx,3 ; button id 114 | mov esi,edi ; button color RRGGBB 115 | int 0x40 116 | 117 | 118 | 119 | mov ebx,6*65536+35 ; draw info text with function 4 120 | mov ecx,0;xffffff 121 | mov edx,text 122 | mov esi,60 123 | newline: 124 | mov eax,4 125 | int 0x40 126 | add ebx,10 127 | add edx,60 128 | cmp [edx],byte 'x' 129 | jnz newline 130 | 131 | mov eax,12 ; function 12:tell os about windowdraw 132 | mov ebx,2 ; 2, end of draw 133 | int 0x40 134 | 135 | ret 136 | 137 | 138 | ; DATA AREA 139 | 140 | 141 | text: 142 | db ' ETHERNET CONNECTION BETWEEN MENUET AND REMOTE HOST ' 143 | db ' ' 144 | db ' 1) START STACK CONFIG FROM NET MENU AND PRESS THE ' 145 | db ' READ BUTTON, ACTIVATE PACKET DRIVER, SET DESIRED ' 146 | db ' IP ADDRESS & APPLY ' 147 | db ' 2) SET THE SERVERS IP ADDRESS TO SAME NETWORK ' 148 | db ' ' 149 | db ' THE MENUET MACHINE SHOULD NOW BE ABLE TO RESPOND TO A ' 150 | db ' PING FROM THE SERVER, TRANSFER FILES USING TFTP AND USE ' 151 | db ' IRC CLIENT. SEE NET MENU FOR MORE TCP/IP APPLICATIONS. ' 152 | db ' ' 153 | db ' MOST LINUX DISTRIBUTIONS HAVE A TFTP SERVER INCLUDED ' 154 | db ' FOR MS YOU CAN DOWNLOAD TFTPD FROM ' 155 | db ' http://perso.wanadoo.fr/philippe.jounin/tftpd32.html ' 156 | db ' ' 157 | db ' ' 158 | db ' USING PPP DETAILED DESCRIPTION ' 159 | db 'x' 160 | 161 | file1: db 'TINYPAD ' 162 | file2: db 'STACK.TXT',0 163 | file3: db 'PPP.TXT',0 164 | 165 | labelt: 166 | db 'NETWORK INFO' 167 | labellen: 168 | 169 | I_END: 170 | -------------------------------------------------------------------------------- /Apps/SYSMETER.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPU USAGE for MenuetOS - Compile with FASM 1.30+ 3 | ; 4 | 5 | use32 6 | 7 | org 0x0 8 | db 'MENUET00' ; 8 byte id 9 | dd 38 ; required os version 10 | dd START ; program start 11 | dd I_END ; program image size 12 | dd 0x100000 ; reguired amount of memory 13 | dd 0x00000000 ; reserved=no extended header 14 | 15 | START: 16 | 17 | call set_variables 18 | 19 | call draw_window 20 | 21 | mov edi,0 22 | 23 | still: 24 | 25 | mov eax,23 26 | mov ebx,10 27 | int 0x40 28 | 29 | cmp eax,1 30 | je red 31 | cmp eax,2 32 | je key 33 | cmp eax,3 34 | je button 35 | 36 | inc edi 37 | cmp edi,10 38 | jb still 39 | 40 | mov edi,0 41 | call draw_usage 42 | 43 | jmp still 44 | 45 | red: 46 | call draw_window 47 | jmp still 48 | 49 | key: 50 | mov eax,2 51 | int 0x40 52 | jmp still 53 | 54 | button: 55 | mov eax,17 56 | int 0x40 57 | cmp al,byte 0 58 | jnz still 59 | mov eax,-1 60 | int 0x40 61 | 62 | 63 | set_variables: 64 | 65 | pusha 66 | 67 | mov ecx,190 68 | mov edi,pros 69 | mov eax,100 70 | cld 71 | rep stosb 72 | 73 | popa 74 | ret 75 | 76 | 77 | draw_window: 78 | 79 | pusha 80 | 81 | mov eax,12 ; tell os about redraw 82 | mov ebx,1 83 | int 0x40 84 | 85 | mov eax,0 ; define and draw window 86 | mov ebx,50*65536+207 87 | mov ecx,50*65536+127 88 | mov edx,0x04ffffff 89 | mov esi,window_label 90 | mov edi,0 91 | int 0x40 92 | 93 | mov eax,12 ; tell os about redraw end 94 | mov ebx,2 95 | int 0x40 96 | 97 | popa 98 | ret 99 | 100 | 101 | 102 | draw_usage: 103 | 104 | pusha ; CPU usage 105 | 106 | cld 107 | mov eax,18 ; TSC / SEC 108 | mov ebx,5 109 | int 0x40 110 | shr eax,20 111 | push eax 112 | 113 | mov eax,18 ; IDLE / SEC 114 | mov ebx,4 115 | int 0x40 116 | shr eax,20 117 | xor edx,edx 118 | mov ebx,100 119 | mul ebx 120 | 121 | xor edx,edx 122 | pop ebx 123 | add ebx,1 124 | div ebx 125 | push eax 126 | 127 | mov esi,pros+1 128 | mov edi,pros 129 | mov ecx,195 130 | cld 131 | rep movsb 132 | 133 | pop eax 134 | cmp al , 100 135 | jbe alfine 136 | mov al , 100 137 | alfine: 138 | mov [pros+99],al 139 | 140 | mov eax,13 141 | mov ebx,5*65536+1 142 | mov esi,pros 143 | mov edi,pros+99 144 | 145 | newpros: 146 | 147 | add esi,1 148 | 149 | xor eax,eax ; up 150 | mov al,[esi] 151 | add eax,1 152 | mov ecx,22*65536 153 | mov cx,ax 154 | mov eax,13 155 | mov edx,0xffffff 156 | int 0x40 157 | 158 | pusha ; down 159 | xor eax,eax 160 | mov al,[esi] 161 | mov ecx,22 162 | add ecx,eax 163 | shl ecx,16 164 | mov cx,101 165 | sub cx,ax 166 | mov eax,13 167 | mov edx,0x000000 168 | int 0x40 169 | popa 170 | 171 | add ebx,2*65536 172 | 173 | cmp esi,edi 174 | jb newpros 175 | 176 | popa 177 | ret 178 | 179 | 180 | ; DATA AREA 181 | 182 | window_label: 183 | 184 | db 'CPU USE',0 185 | 186 | pros: 187 | 188 | I_END: 189 | -------------------------------------------------------------------------------- /Apps/SYSTRACE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; SYSTEM CALL TRACE , V.Turjanmaa 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | 20 | START: ; start of execution 21 | 22 | call draw_window ; at first, draw the window 23 | 24 | still: 25 | 26 | mov eax,23 ; wait here for event 27 | mov ebx,50 28 | int 0x40 29 | 30 | call display_calls 31 | 32 | cmp eax,1 ; redraw request ? 33 | je red 34 | cmp eax,2 ; key in buffer ? 35 | je key 36 | cmp eax,3 ; button in buffer ? 37 | je button 38 | 39 | jmp still 40 | 41 | red: ; redraw 42 | call draw_window 43 | jmp still 44 | 45 | key: ; key 46 | mov eax,2 ; just read it and ignore 47 | int 0x40 48 | jmp still 49 | 50 | button: ; button 51 | mov eax,17 ; get id 52 | int 0x40 53 | 54 | cmp ah,1 ; button id=1 ? 55 | jne noclose 56 | mov eax,-1 ; close this program 57 | int 0x40 58 | noclose: 59 | 60 | jmp still 61 | 62 | 63 | ; ********************************************* 64 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 65 | ; ********************************************* 66 | 67 | 68 | draw_window: 69 | 70 | mov eax,12 ; function 12:tell os about windowdraw 71 | mov ebx,1 ; 1, start of draw 72 | int 0x40 73 | 74 | ; DRAW WINDOW 75 | mov eax,0 ; function 0 : define and draw window 76 | mov ebx,100*65536+465 ; [x start] *65536 + [x size] 77 | mov ecx,50*65536+265 ; [y start] *65536 + [y size] 78 | mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl 79 | mov esi,0x808899ff ; color of grab bar RRGGBB,8->color gl 80 | mov edi,0x008899ff ; color of frames RRGGBB 81 | int 0x40 82 | 83 | ; WINDOW LABEL 84 | mov eax,4 ; function 4 : write text to window 85 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 86 | mov ecx,0x00ddeeff ; color of text RRGGBB 87 | mov edx,labelt ; pointer to text beginning 88 | mov esi,labellen-labelt ; text length 89 | int 0x40 90 | 91 | mov eax,4 92 | mov ebx,15*65536+55 93 | mov ecx,0x0 94 | mov edx,text 95 | mov esi,70 96 | int 0x40 97 | 98 | ; CLOSE BUTTON 99 | mov eax,8 ; function 8 : define and draw button 100 | mov ebx,(465-19)*65536+12 ; [x start] *65536 + [x size] 101 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 102 | mov edx,1 ; button id 103 | mov esi,0x6677cc ; button color RRGGBB 104 | ; int 0x40 105 | 106 | call display_calls 107 | 108 | mov eax,12 109 | mov ebx,2 110 | int 0x40 111 | 112 | ret 113 | 114 | 115 | 116 | display_calls: 117 | 118 | 119 | pusha 120 | 121 | mov eax,13 122 | mov ebx,15*65536+70 123 | mov ecx,35*65536+10 124 | mov edx,0xffffff 125 | int 0x40 126 | 127 | mov eax,59 128 | mov ebx,0 129 | mov ecx,I_END 130 | mov edx,64*16 131 | int 0x40 132 | 133 | mov ecx,eax 134 | mov eax,47 135 | mov ebx,10*65536 136 | mov edx,15*65536+35 137 | mov esi,0 138 | int 0x40 139 | 140 | 141 | mov ebx,75 142 | mov edx,I_END 143 | newline: 144 | 145 | push ebx 146 | push edx 147 | 148 | mov edi,0 149 | 150 | new_x: 151 | 152 | mov eax,13 153 | mov ebx,edi 154 | shl ebx,6+16 155 | add ebx,15*65536 156 | mov bx,6*8 157 | mov ecx,[esp+4] 158 | shl ecx,16 159 | mov cx,10 160 | mov edx,0xffffff 161 | int 0x40 162 | 163 | mov eax,47 164 | mov ebx,1+1*256+8*65536 165 | 166 | mov ecx,[pos+edi*4] 167 | shl ecx,2 168 | add ecx,[esp+0] 169 | 170 | mov edx,edi 171 | shl edx,6+16 172 | mov dx,[esp+4] 173 | or edx,15*65536 174 | mov esi,0x0 175 | int 0x40 176 | 177 | inc edi 178 | 179 | cmp edi,7 180 | jb new_x 181 | 182 | pop edx 183 | pop ebx 184 | 185 | add ebx,10 186 | add edx,64 187 | 188 | cmp edx,I_END+16*64 189 | jb newline 190 | 191 | popa 192 | ret 193 | 194 | 195 | 196 | 197 | ; DATA AREA 198 | 199 | pos dd 0,15,12,14,13,9,8 200 | 201 | text: 202 | db ' PID EAX EBX ECX EDX ESI EDI ' 203 | 204 | 205 | labelt: 206 | db 'SYSTEM CALL TRACE' 207 | labellen: 208 | 209 | I_END: 210 | 211 | -------------------------------------------------------------------------------- /Apps/TERMINAL.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/TERMINAL.ASM -------------------------------------------------------------------------------- /Apps/TEST.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; MENUET PROTECTION TEST (C) Ville Turjanmaa 3 | ; 4 | 5 | use32 6 | 7 | org 0x0 8 | 9 | db 'MENUET01' ; 8 byte id 10 | dd 0x01 ; header version 11 | dd START ; start of code 12 | dd I_END ; size of image 13 | dd 0x10000 ; memory for app 14 | dd 0xfff0 ; esp 15 | dd 0x0 , 0x0 ; I_Param , I_Icon 16 | 17 | START: ; start of execution 18 | 19 | call draw_window ; at first, draw the window 20 | 21 | still: 22 | 23 | mov eax,10 ; wait here for event 24 | int 0x40 25 | 26 | cmp eax,1 ; redraw request ? 27 | jz red 28 | cmp eax,2 ; key in buffer ? 29 | jz key 30 | cmp eax,3 ; button in buffer ? 31 | jz button 32 | 33 | jmp still 34 | 35 | red: ; redraw 36 | call draw_window 37 | 38 | jmp still 39 | 40 | key: ; key 41 | mov eax,2 ; just read it and ignore 42 | int 0x40 43 | 44 | jmp still 45 | 46 | button: ; button 47 | mov eax,17 48 | int 0x40 49 | 50 | cmp ah,1 ; button id=1 ? 51 | jnz noclose 52 | mov eax,0xffffffff ; close this program 53 | int 0x40 54 | noclose: 55 | 56 | cmp ah,2 57 | jnz notest2 58 | cli 59 | notest2: 60 | 61 | cmp ah,3 62 | jnz notest3 63 | sti 64 | notest3: 65 | 66 | cmp ah,4 67 | jnz notest4 68 | mov [0x10000],byte 1 69 | notest4: 70 | 71 | cmp ah,5 72 | jnz notest5 73 | jmp dword 0x10000 74 | notest5: 75 | 76 | cmp ah,6 77 | jnz notest6 78 | mov esp,0 79 | push eax 80 | notest6: 81 | 82 | cmp ah,7 83 | jnz notest7 84 | in al,0x60 85 | notest7: 86 | 87 | cmp ah,8 88 | jnz notest8 89 | out 0x60,al 90 | notest8: 91 | 92 | cmp ah,9 93 | jnz notest9 94 | int 0x3f 95 | notest9: 96 | 97 | 98 | jmp still 99 | 100 | 101 | ; ********************************************* 102 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 103 | ; ********************************************* 104 | 105 | 106 | draw_window: 107 | 108 | mov eax,12 ; function 12:tell os about windowdraw 109 | mov ebx,1 ; 1, start of draw 110 | int 0x40 111 | 112 | ; DRAW WINDOW 113 | mov eax,0 ; function 0 : define and draw window 114 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] 115 | mov ecx,100*65536+260 ; [y start] *65536 + [y size] 116 | mov edx,0x04ffffff ; color of work area RRGGBB 117 | mov esi,window_label ; color of grab bar RRGGBB,8->color glid 118 | mov edi,0 ; color of frames RRGGBB 119 | int 0x40 120 | 121 | mov eax,8 ; function 8 : define and draw button 122 | mov ebx,25*65536+9 ; [x start] *65536 + [x size] 123 | mov ecx,74*65536+9 ; [y start] *65536 + [y size] 124 | mov edx,2 ; button id 125 | mov esi,0x104466bb ; button color RRGGBB 126 | newb: 127 | mov edi,0 128 | int 0x40 129 | add ecx,20*65536 130 | inc edx 131 | cmp edx,10 132 | jb newb 133 | 134 | mov ebx,25*65536+36 ; draw info text with function 4 135 | mov ecx,0x000000 136 | mov edx,text 137 | mov esi,40 138 | newline: 139 | mov eax,4 140 | int 0x40 141 | add ebx,10 142 | add edx,40 143 | cmp [edx],byte 'x' 144 | jnz newline 145 | 146 | 147 | mov eax,12 ; function 12:tell os about windowdraw 148 | mov ebx,2 ; 2, end of draw 149 | int 0x40 150 | 151 | ret 152 | 153 | 154 | ; DATA AREA 155 | 156 | 157 | text: 158 | 159 | db 'APPLICATION USES 0x10000 BYTES OF MEMORY' 160 | db ' ' 161 | db 'OPEN DEBUG BOARD FOR PARAMETERS ' 162 | db ' ' 163 | db ' CLI ' 164 | db ' ' 165 | db ' STI ' 166 | db ' ' 167 | db ' MOV [0x10000],BYTE 1 ' 168 | db ' ' 169 | db ' JMP DWORD 0x10000 ' 170 | db ' ' 171 | db ' MOV ESP,0 & PUSH EAX ' 172 | db ' ' 173 | db ' IN AL,0x60 ' 174 | db ' ' 175 | db ' OUT 0x60,AL ' 176 | db ' ' 177 | db ' INT 0x3F ' 178 | db 'x ' 179 | 180 | 181 | 182 | 183 | window_label: 184 | 185 | db 'PROTECTION TEST',0 186 | 187 | I_END: 188 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /Apps/THREAD.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; THREAD EXAMPLE 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x200000 ; memory for app 16 | dd 0x80000 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | 20 | 21 | 22 | START: ; start of execution 23 | 24 | call draw_window ; at first, draw the window 25 | 26 | still: 27 | 28 | mov eax,10 ; wait here for event 29 | int 0x40 30 | 31 | cmp eax,1 ; redraw request ? 32 | je red 33 | cmp eax,2 ; key in buffer ? 34 | je key 35 | cmp eax,3 ; button in buffer ? 36 | je button 37 | 38 | jmp still 39 | 40 | red: ; redraw 41 | call draw_window 42 | jmp still 43 | 44 | key: ; key 45 | mov eax,2 ; just read it and ignore 46 | int 0x40 47 | jmp still 48 | 49 | button: ; button 50 | mov eax,17 ; get id 51 | int 0x40 52 | 53 | cmp ah,1 ; button id=1 ? 54 | jne noclose 55 | mov eax,-1 ; close this program (thread) 56 | int 0x40 57 | noclose: 58 | 59 | cmp ah,2 60 | jne no_thread 61 | 62 | cmp [thread_stack],0x1f0000 63 | jge no_thread 64 | 65 | add [thread_stack],0x1000 66 | mov eax,51 67 | mov ebx,1 68 | mov ecx,START 69 | mov edx,[thread_stack] 70 | int 0x40 71 | 72 | jmp still 73 | 74 | no_thread: 75 | 76 | jmp still 77 | 78 | thread_stack dd 0x80000 79 | 80 | 81 | ; ********************************************* 82 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 83 | ; ********************************************* 84 | 85 | 86 | draw_window: 87 | 88 | mov eax,12 ; function 12:tell os about windowdraw 89 | mov ebx,1 ; 1, start of draw 90 | int 0x40 91 | 92 | ; DRAW WINDOW 93 | mov eax,0 ; function 0 : define and draw window 94 | mov ebx,10*65536+290 ; [x start] *65536 + [x size] 95 | mov ecx,10*65536+130 ; [y start] *65536 + [y size] 96 | mov esi,[thread_stack] 97 | sub esi,0x80000 98 | shr esi,11 99 | shl esi,16 100 | add ebx,esi 101 | add ecx,esi 102 | mov edx,0x04ffffff ; color of work area RRGGBB,8->color gl 103 | mov esi,window_label ; color of grab bar RRGGBB,8->color gl 104 | mov edi,0 ; color of frames RRGGBB 105 | int 0x40 106 | 107 | 108 | mov eax,8 ; NEW THREAD BUTTON 109 | mov ebx,25*65536+128 110 | mov ecx,88*65536+20 111 | mov edx,2 112 | mov esi,0x10000000 113 | mov edi,button_label 114 | int 0x40 115 | 116 | 117 | mov ebx,25*65536+35 ; draw info text with function 4 118 | mov ecx,0x000000 119 | mov edx,text 120 | mov esi,40 121 | newline: 122 | mov eax,4 123 | int 0x40 124 | add ebx,10 125 | add edx,40 126 | cmp [edx],byte 'x' 127 | jne newline 128 | 129 | 130 | mov eax,12 ; function 12:tell os about windowdraw 131 | mov ebx,2 ; 2, end of draw 132 | int 0x40 133 | 134 | ret 135 | 136 | 137 | ; DATA AREA 138 | 139 | 140 | text: 141 | db 'THIS EXAMPLE CREATES THREADS BY RUNNING ' 142 | db 'THE SAME CODE MULTIPLE TIMES. ALL WE ' 143 | db 'NEED IS A NEW STACK FOR EACH THREAD. ' 144 | db 'ALL THREADS SHARE THE SAME MEMORY. ' 145 | db ' ' 146 | db 'x <- END MARKER, DONT DELETE ' 147 | 148 | 149 | window_label: 150 | 151 | db 'THREAD EXAMPLE',0 152 | 153 | button_label: 154 | 155 | db 'CREATE NEW THREAD',0 156 | 157 | I_END: 158 | 159 | 160 | -------------------------------------------------------------------------------- /Apps/TINYPAD.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/TINYPAD.ASM -------------------------------------------------------------------------------- /Apps/TRANSP.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; TRANSPARENT EXAMPLE 3 | ; 4 | ; Compile with FASM for Menuet 5 | ; 6 | 7 | use32 8 | 9 | org 0x0 10 | 11 | db 'MENUET01' ; 8 byte id 12 | dd 0x01 ; header version 13 | dd START ; start of code 14 | dd I_END ; size of image 15 | dd 0x100000 ; memory for app 16 | dd 0x7fff0 ; esp 17 | dd 0x0 , 0x0 ; I_Param , I_Icon 18 | 19 | 20 | START: ; start of execution 21 | 22 | call draw_window ; at first, draw the window 23 | 24 | still: 25 | 26 | mov eax,10 ; wait here for event 27 | int 0x40 28 | 29 | cmp eax,1 ; redraw request ? 30 | je red 31 | cmp eax,2 ; key in buffer ? 32 | je key 33 | cmp eax,3 ; button in buffer ? 34 | je button 35 | 36 | jmp still 37 | 38 | red: ; redraw 39 | call draw_window 40 | jmp still 41 | 42 | key: ; key 43 | mov eax,2 ; just read it and ignore 44 | int 0x40 45 | jmp still 46 | 47 | button: ; button 48 | mov eax,17 ; get id 49 | int 0x40 50 | 51 | cmp ah,1 ; button id=1 ? 52 | jne noclose 53 | mov eax,-1 ; close this program 54 | int 0x40 55 | noclose: 56 | 57 | jmp still 58 | 59 | 60 | ; ********************************************* 61 | ; ******* WINDOW DEFINITIONS AND DRAW ******** 62 | ; ********************************************* 63 | 64 | 65 | draw_window: 66 | 67 | mov eax,12 ; function 12:tell os about windowdraw 68 | mov ebx,1 ; 1, start of draw 69 | int 0x40 70 | 71 | ; DRAW WINDOW 72 | mov eax,0 ; function 0 : define and draw window 73 | mov ebx,[x_start] 74 | shl ebx,16 75 | add ebx,[x_size] 76 | dec ebx 77 | mov ecx,[y_start] 78 | shl ecx,16 79 | add ecx,[y_size] 80 | dec ecx 81 | mov edx,0x01ffffff ; color of work area RRGGBB,8->color gl 82 | mov esi,0x808899ff ; color of grab bar RRGGBB,8->color gl 83 | mov edi,0x008899ff ; color of frames RRGGBB 84 | int 0x40 85 | 86 | call get_transparent 87 | 88 | ; WINDOW LABEL 89 | mov eax,4 ; function 4 : write text to window 90 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] 91 | mov ecx,0x00ddeeff ; color of text RRGGBB 92 | mov edx,labelt ; pointer to text beginning 93 | mov esi,labellen-labelt ; text length 94 | int 0x40 95 | 96 | call draw_transparent 97 | 98 | 99 | 100 | ; CLOSE BUTTON 101 | mov eax,8 ; function 8 : define and draw button 102 | mov ebx,[x_size] 103 | sub ebx,19 104 | shl ebx,16 105 | mov bx,12 ; [x start] *65536 + [x size] 106 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] 107 | mov edx,1 ; button id 108 | mov esi,0x6677cc ; button color RRGGBB 109 | int 0x40 110 | 111 | mov eax,12 ; function 12:tell os about windowdraw 112 | mov ebx,2 ; 2, end of draw 113 | int 0x40 114 | 115 | ret 116 | 117 | 118 | draw_transparent: 119 | 120 | pusha 121 | 122 | mov eax,7 123 | mov ebx,0x10000 124 | mov ecx,[x_size] 125 | shl ecx,16 126 | add ecx,[y_size] 127 | mov edx,0 128 | int 0x40 129 | 130 | popa 131 | ret 132 | 133 | 134 | get_transparent: 135 | 136 | pusha 137 | 138 | mov eax,9 139 | mov ebx,I_END 140 | mov ecx,-1 141 | int 0x40 142 | mov eax,[I_END+34] 143 | mov [x_start],eax 144 | mov eax,[I_END+38] 145 | mov [y_start],eax 146 | 147 | mov eax,14 148 | int 0x40 149 | 150 | shr eax,16 151 | inc eax 152 | mov [scx],eax 153 | 154 | mov eax,[x_start] 155 | add eax,[x_size] 156 | mov [x_end],eax 157 | mov eax,[y_start] 158 | add eax,[y_size] 159 | mov [y_end],eax 160 | 161 | mov eax,[x_start] 162 | mov ebx,[y_start] 163 | 164 | dtpl1: 165 | 166 | push eax 167 | push ebx 168 | 169 | imul ebx,[scx] 170 | add ebx,eax 171 | mov eax,35 172 | int 0x40 173 | 174 | shr eax,1 175 | and eax,0x7f7f7f 176 | 177 | mov ebx,[esp+4] 178 | mov ecx,[esp] 179 | sub ebx,[x_start] 180 | sub ecx,[y_start] 181 | imul ecx,[x_size] 182 | imul ebx,3 183 | imul ecx,3 184 | add ebx,ecx 185 | mov [0x10000+ebx],eax 186 | 187 | pop ebx 188 | pop eax 189 | 190 | inc eax 191 | cmp eax,[x_end] 192 | jb dtpl1 193 | mov eax,[x_start] 194 | inc ebx 195 | cmp ebx,[y_end] 196 | jb dtpl1 197 | 198 | popa 199 | 200 | ret 201 | 202 | 203 | 204 | 205 | ; DATA AREA 206 | 207 | x_start dd 100 208 | y_start dd 80 209 | 210 | x_size dd 160 211 | y_size dd 200 212 | 213 | x_end dd 0 214 | y_end dd 0 215 | 216 | scx dd 640 217 | 218 | labelt: 219 | db 'EXAMPLE APPLICATION' 220 | labellen: 221 | 222 | I_END: 223 | 224 | 225 | -------------------------------------------------------------------------------- /Apps/TUBE.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/TUBE.ASM -------------------------------------------------------------------------------- /Apps/WRITE.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Apps/WRITE.BMP -------------------------------------------------------------------------------- /Kernel/BOOTENG.INC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Kernel/BOOTENG.INC -------------------------------------------------------------------------------- /Kernel/EGA.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Ega.inc 4 | ;; 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | 8 | checkEgaCga: 9 | 10 | cmp [0xfe0c],dword 0x13 11 | je cnvl 12 | ret 13 | cnvl: 14 | 15 | pusha 16 | mov ecx,[0xfb0a] 17 | cmp ecx,[novesachecksum] 18 | jne novesal 19 | popa 20 | ret 21 | 22 | novesal: 23 | mov [novesachecksum],ecx 24 | mov ecx,0 25 | movzx eax,word [0xfb0c] 26 | cmp eax,100 27 | jge m13l3 28 | mov eax,100 29 | m13l3: 30 | cmp eax,480-100 31 | jbe m13l4 32 | mov eax,480-100 33 | m13l4: 34 | sub eax,100 35 | imul eax,640*4 36 | add ecx,eax 37 | movzx eax,word [0xfb0a] 38 | cmp eax,160 39 | jge m13l1 40 | mov eax,160 41 | m13l1: 42 | cmp eax,640-160 43 | jbe m13l2 44 | mov eax,640-160 45 | m13l2: 46 | sub eax,160 47 | shl eax,2 48 | add ecx,eax 49 | mov esi,[0xfe80] 50 | add esi,ecx 51 | mov edi,0xa0000 52 | mov edx,200 53 | mov ecx,320 54 | cld 55 | m13pix: 56 | lodsd 57 | push eax 58 | mov ebx,eax 59 | and eax,(128+64+32) ; blue 60 | shr eax,5 61 | and ebx,(128+64+32)*256 ; green 62 | shr ebx,8+2 63 | add eax,ebx 64 | pop ebx 65 | and ebx,(128+64)*256*256 ; red 66 | shr ebx,8+8 67 | add eax,ebx 68 | stosb 69 | loop m13pix 70 | mov ecx,320 71 | add esi,4*(640-320) 72 | dec edx 73 | jnz m13pix 74 | 75 | popa 76 | ret 77 | 78 | 79 | palette320x200: 80 | 81 | mov edx,0x3c8 82 | mov eax,0 83 | out dx,al 84 | mov ecx,256 85 | mov edx,0x3c9 86 | xor eax,eax 87 | 88 | palnew: 89 | mov al,0 90 | test ah,64 91 | jz pallbl1 92 | add al,21 93 | pallbl1: 94 | test ah,128 95 | jz pallbl2 96 | add al,42 97 | pallbl2: 98 | out dx,al 99 | mov al,0 100 | test ah,8 101 | jz pallbl3 102 | add al,8 103 | pallbl3: 104 | test ah,16 105 | jz pallbl4 106 | add al,15 107 | pallbl4: 108 | test ah,32 109 | jz pallbl5 110 | add al,40 111 | pallbl5: 112 | out dx,al 113 | mov al,0 114 | test ah,1 115 | jz pallbl6 116 | add al,8 117 | pallbl6: 118 | test ah,2 119 | jz pallbl7 120 | add al,15 121 | pallbl7: 122 | test ah,4 123 | jz pallbl8 124 | add al,40 125 | pallbl8: 126 | out dx,al 127 | add ah,1 128 | loop palnew 129 | 130 | ret 131 | -------------------------------------------------------------------------------- /Kernel/EGAVGA.INC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Kernel/EGAVGA.INC -------------------------------------------------------------------------------- /Kernel/FDC.INC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Kernel/FDC.INC -------------------------------------------------------------------------------- /Kernel/IP.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; IP.INC ;; 4 | ;; ;; 5 | ;; IP Processes for Menuet OS TCP/IP stack ;; 6 | ;; ;; 7 | ;; Version 0.3 29 August 2002 ;; 8 | ;; ;; 9 | ;; Copyright 2002 Mike Hibbett, mikeh@oceanfree.net ;; 10 | ;; ;; 11 | ;; See file COPYING for details ;; 12 | ;; ;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | 15 | 16 | ;******************************************************************* 17 | ; Interface 18 | ; 19 | ; ip_rx processes all packets received by the network layer 20 | ; It calls the appropriate protocol handler 21 | ; 22 | ; 23 | ; 24 | ;******************************************************************* 25 | 26 | 27 | ;*************************************************************************** 28 | ; Function 29 | ; ip_rx 30 | ; 31 | ; Description 32 | ; Handles received IP packets 33 | ; This is a kernel function, called by stack_handler 34 | ; 35 | ;*************************************************************************** 36 | ip_rx: 37 | ; Look for a buffer to tx 38 | mov eax, IPIN_QUEUE 39 | call dequeue 40 | cmp ax, NO_BUFFER 41 | je ipr_exit ; Exit if no buffer available 42 | 43 | push eax 44 | 45 | ; convert buffer pointer eax to the absolute address 46 | mov ecx, IPBUFFSIZE 47 | mul ecx 48 | add eax, IPbuffs 49 | 50 | mov edx, eax ; Save the address in edx for use by future processes 51 | 52 | ; Validate the IP checksum 53 | mov ebx, edx 54 | mov ah, [ebx + 10] 55 | mov al, [ebx + 11] ; Get the checksum in intel format 56 | mov [ebx + 10], word 0 ; clear checksum field - need to when 57 | ; recalculating checksum 58 | 59 | ; this needs two data pointers and two size #. 60 | ; 2nd pointer can be of length 0 61 | mov ebx, edx 62 | mov [checkAdd1], ebx 63 | mov [checkSize1], word 20 64 | mov [checkAdd2], dword 0 65 | mov [checkSize2], word 0 66 | 67 | call checksum ; Recalculate IP checksum 68 | cmp ax, [checkResult] 69 | jnz ipr_dump 70 | 71 | ; If the IP address is 255.255.255.255, accept it 72 | ; - it is a broadcast packet, which we need for dhcp 73 | mov eax, [edx + 16] 74 | cmp eax, 0xffffffff 75 | je ipr_p0 76 | 77 | ; Validate the IP address, if it isn't broadcast 78 | cmp eax, [stack_ip] 79 | jnz ipr_dump 80 | 81 | ipr_p0: 82 | mov al, [edx] 83 | and al, 0x0f 84 | cmp al, 0x05 85 | jnz ipr_dump 86 | 87 | cmp [edx+8], byte 0 88 | jz ipr_dump 89 | 90 | mov ax, [edx + 6] 91 | and ax, 0xFFBF 92 | cmp ax, 0 93 | jnz ipr_dump 94 | 95 | ; Check the protocol, and call the appropriate handler 96 | ; Each handler will re-use or free the queue buffer as appropriate 97 | mov al, [edx + 9] 98 | cmp al , PROTOCOL_ICMP 99 | jnz ipr_p1 100 | pop eax 101 | call icmp_rx 102 | jmp ipr_exit 103 | 104 | ipr_p1: 105 | cmp al , PROTOCOL_TCP 106 | jnz ipr_p2 107 | pop eax 108 | call tcp_rx 109 | jmp ipr_exit 110 | 111 | ipr_p2: 112 | cmp al , PROTOCOL_UDP 113 | jnz ipr_dump 114 | pop eax 115 | call udp_rx 116 | jmp ipr_exit 117 | 118 | ipr_dump: 119 | ; No protocol handler available, so 120 | ; silently dump the packet, freeing up the queue buffer 121 | 122 | ; inc dword [dumped_rx_count] 123 | 124 | pop eax 125 | call freeBuff 126 | 127 | ipr_exit: 128 | ret 129 | 130 | 131 | 132 | ;*************************************************************************** 133 | ; Function 134 | ; icmp_rx 135 | ; 136 | ; Description 137 | ; ICMP protocol handler 138 | ; This is a kernel function, called by ip_rx 139 | ; edx contains the address of the buffer in use. 140 | ; This buffer must be reused or marked as empty afterwards 141 | ; 142 | ;*************************************************************************** 143 | icmp_rx: 144 | cmp [edx + 20], byte 8 ; Is this an echo request? discard if not 145 | jz icmp_echo 146 | 147 | call freeBuff 148 | jmp icmp_exit 149 | 150 | icmp_echo: 151 | push eax 152 | mov [edx + 10], word 0 ; I think this was already done by IP rx 153 | 154 | ; swap the source and destination addresses 155 | mov ecx, [edx + 16] 156 | mov eax, [edx + 12] 157 | mov [edx + 16], eax 158 | mov [edx + 12], ecx 159 | 160 | ; recaluculate the IP header checksum 161 | 162 | mov ebx, edx 163 | mov [checkAdd1], ebx 164 | mov [checkSize1], word 20 165 | mov [checkAdd2], dword 0 166 | mov [checkSize2], word 0 167 | 168 | call checksum 169 | mov ax, [checkResult] 170 | mov [edx + 10], ah 171 | mov [edx + 11], al ; ?? correct byte order? 172 | 173 | mov [edx + 20], byte 0 ; change the request to a response 174 | mov [edx + 22], word 0 ; clear ICMP checksum prior to re-calc 175 | 176 | ; Calculate the length of the ICMP data ( IP payload) 177 | mov ah, [edx + 2] 178 | mov al, [edx + 3] 179 | sub ax, 20 180 | 181 | mov [checkSize1], ax 182 | mov ebx, edx 183 | add ebx, 20 184 | 185 | mov [checkAdd1], ebx 186 | mov [checkAdd2], dword 0 187 | mov [checkSize2], word 0 188 | 189 | call checksum 190 | 191 | mov ax, [checkResult] 192 | mov [edx + 22], ah 193 | mov [edx + 23], al 194 | 195 | ; Queue packet for transmission 196 | 197 | pop ebx 198 | mov eax, NET1OUT_QUEUE 199 | call queue 200 | 201 | icmp_exit: 202 | ret 203 | 204 | -------------------------------------------------------------------------------- /Kernel/KERNEL.MNT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GameMaker2k/MenuetOS/c0521ebce533ea629c492db67e830a0266fd6162/Kernel/KERNEL.MNT -------------------------------------------------------------------------------- /Kernel/KERNEL16.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Kernel16.inc (c) Ville Turjanmaa 4 | ;; License: GPL. See file copying for details. 5 | ;; 6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 | 8 | ;% +include 9 | 10 | include "BOOTENG.INC" ; english system boot messages 11 | include "BOOTCODE.INC" ; 16 bit system boot code 12 | 13 | include "PCI16.INC" 14 | 15 | ;% -include 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Kernel/KERNEL32.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Kernel32.inc (c) Ville Turjanmaa 4 | ;; License: GPL. See file copying for details. 5 | ;; 6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 | 8 | ;% +include 9 | 10 | ; processes 11 | 12 | include "SYS32.INC" ; process scheduling 13 | 14 | ; shutdown 15 | 16 | include "SHUTDOWN.INC" ; shutdown or restart 17 | 18 | ; file system 19 | 20 | include "FS.INC" ; syscall 21 | include "FAT32.INC" ; read / write 22 | include "RD.INC" ; ramdisk read / write 23 | 24 | ; sound 25 | 26 | include "SB16.INC" ; playback for Sound Blaster 16 27 | 28 | ; display 29 | 30 | include "VESA12.INC" ; Vesa 1.2 functions 31 | include "VESA20.INC" ; Vesa 2.0 functions 32 | include "VGA.INC" ; VGA 16 color functions 33 | 34 | ; Network Interface & TCPIP Stack 35 | 36 | include "STACK.INC" 37 | 38 | ; Mouse pointer 39 | 40 | include "MOUSE.INC" 41 | 42 | ; Window skinning 43 | 44 | include "SKINCODE.INC" 45 | 46 | ; Pci functions 47 | 48 | include "PCI32.INC" 49 | 50 | ; Floppy drive controller 51 | 52 | include "FDC.INC" 53 | 54 | ; EGA 55 | 56 | include "EGA.INC" 57 | 58 | ; MIDI 59 | 60 | include "MIDI.INC" 61 | 62 | ;% -include 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Kernel/MIDI.INC: -------------------------------------------------------------------------------- 1 | is_input: 2 | 3 | push edx 4 | mov dx,word [midisp] 5 | in al,dx 6 | and al,0x80 7 | pop edx 8 | ret 9 | 10 | 11 | is_output: 12 | 13 | push edx 14 | mov dx,word [midisp] 15 | in al,dx 16 | and al,0x40 17 | pop edx 18 | ret 19 | 20 | 21 | get_mpu_in: 22 | 23 | push edx 24 | mov dx,word [mididp] 25 | in al,dx 26 | pop edx 27 | ret 28 | 29 | 30 | put_mpu_out: 31 | 32 | push edx 33 | mov dx,word [mididp] 34 | out dx,al 35 | pop edx 36 | ret 37 | 38 | 39 | setuart: 40 | 41 | su1: 42 | call is_output 43 | cmp al,0 44 | jnz su1 45 | mov dx,word [midisp] 46 | mov al,0xff 47 | out dx,al 48 | su2: 49 | mov dx,word [midisp] 50 | mov al,0xff 51 | out dx,al 52 | call is_input 53 | cmp al,0 54 | jnz su2 55 | call get_mpu_in 56 | cmp al,0xfe 57 | jnz su2 58 | su3: 59 | call is_output 60 | cmp al,0 61 | jnz su3 62 | mov dx,word [midisp] 63 | mov al,0x3f 64 | out dx,al 65 | 66 | ret 67 | 68 | 69 | align 4 70 | 71 | sys_midi: 72 | 73 | cmp [mididp],0 74 | jnz sm0 75 | mov [esp+36],dword 1 76 | ret 77 | sm0: 78 | 79 | cmp eax,1 80 | mov [esp+36],dword 0 81 | jnz smn1 82 | call setuart 83 | ret 84 | smn1: 85 | 86 | cmp eax,2 87 | jnz smn2 88 | sm10: 89 | call get_mpu_in 90 | call is_output 91 | test al,al 92 | jnz sm10 93 | mov al,bl 94 | call put_mpu_out 95 | ret 96 | smn2: 97 | 98 | ret 99 | 100 | -------------------------------------------------------------------------------- /Kernel/PCI16.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; PCI16.INC ;; 4 | ;; ;; 5 | ;; 16 bit PCI driver code ;; 6 | ;; Version 0.2 December 21st, 2002 ;; 7 | ;; Author: Victor Prodan, victorprodan@yahoo.com ;; 8 | ;; ;; 9 | ;; See file COPYING for details ;; 10 | ;; ;; 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | 13 | init_pci_16: 14 | 15 | pushad 16 | 17 | xor ax,ax 18 | mov es,ax 19 | mov byte [es:0x9020],1 ;default mechanism:1 20 | mov ax,0xb101 21 | int 0x1a 22 | or ah,ah 23 | jnz pci16skip 24 | 25 | mov [es:0x9021],cl ;last PCI bus in system 26 | mov [es:0x9022],bx 27 | mov [es:0x9024],edi 28 | 29 | ; we have a PCI BIOS, so check which configuration mechanism(s) 30 | ; it supports 31 | ; AL = PCI hardware characteristics (bit0-mechanism1,bit1-mechanism2) 32 | 33 | test al,1 34 | jnz pci16skip 35 | test al,2 36 | jz pci16skip 37 | mov byte [es:0x9020],2 ; if (al&3)==2 => mechanism2 38 | 39 | pci16skip: 40 | 41 | mov ax,0x1000 42 | mov es,ax 43 | 44 | popad 45 | 46 | -------------------------------------------------------------------------------- /Kernel/QUEUE.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; QUEUE.INC ;; 4 | ;; ;; 5 | ;; Buffer queue management for Menuet OS TCP/IP Stack ;; 6 | ;; ;; 7 | ;; Version 0.3 29 August 2002 ;; 8 | ;; ;; 9 | ;; Copyright 2002 Mike Hibbett, mikeh@oceanfree.net ;; 10 | ;; ;; 11 | ;; See file COPYING for details ;; 12 | ;; ;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | 15 | 16 | ;******************************************************************* 17 | ; Interface 18 | ; 19 | ; queueInit Configures the queues to empty 20 | ; dequeue Removes a buffer pointer from a queue 21 | ; queue Inserts a buffer pointer into a queue 22 | ; freeBuff Adds the buffer pointer to the list of free buffers 23 | ; queueSize Returns the number of entries in a queue 24 | ; 25 | ; The various defines for queue names can be found in stack.inc 26 | ; 27 | ;******************************************************************* 28 | 29 | 30 | ;*************************************************************************** 31 | ; Function 32 | ; freeBuff 33 | ; 34 | ; Description 35 | ; Adds a buffer number to the beginning of the free list. 36 | ; buffer number in eax ( ms word zeroed ) 37 | ; all other registers preserved 38 | ; This always works, so no error returned 39 | ;*************************************************************************** 40 | freeBuff: 41 | push ebx 42 | push ecx 43 | mov ebx, EMPTY_QUEUE 44 | shl ebx, 1 45 | add ebx, queues 46 | cli ; Ensure that another process does not interfer 47 | movzx ecx, word [ebx] 48 | mov [ebx], ax 49 | shl eax, 1 50 | add eax, queueList 51 | mov [eax], cx 52 | sti 53 | pop ecx 54 | pop ebx 55 | 56 | ret 57 | 58 | 59 | ;*************************************************************************** 60 | ; Function 61 | ; queueSize 62 | ; 63 | ; Description 64 | ; Counts the number of entries in a queue 65 | ; queue number in ebx ( ms word zeroed ) 66 | ; Queue size returned in eax 67 | ; This always works, so no error returned 68 | ;*************************************************************************** 69 | queueSize: 70 | xor eax, eax 71 | shl ebx, 1 72 | add ebx, queues 73 | movzx ecx, word [ebx] 74 | cmp cx, NO_BUFFER 75 | je qs_exit 76 | 77 | qs_001: 78 | inc eax 79 | shl ecx, 1 80 | add ecx, queueList 81 | movzx ecx, word [ecx] 82 | cmp cx, NO_BUFFER 83 | je qs_exit 84 | jmp qs_001 85 | 86 | qs_exit: 87 | ret 88 | 89 | 90 | ;*************************************************************************** 91 | ; Function 92 | ; queue 93 | ; 94 | ; Description 95 | ; Adds a buffer number to the *end* of a queue 96 | ; This is quite quick because these queues will be short 97 | ; queue number in eax ( ms word zeroed ) 98 | ; buffer number in ebx ( ms word zeroed ) 99 | ; all other registers preserved 100 | ; This always works, so no error returned 101 | ;*************************************************************************** 102 | queue: 103 | push ebx 104 | shl ebx, 1 105 | add ebx, queueList ; eax now holds address of queue entry 106 | mov [ebx], word NO_BUFFER ; This buffer will be the last 107 | 108 | cli 109 | shl eax, 1 110 | add eax, queues ; eax now holds address of queue 111 | movzx ebx, word [eax] 112 | 113 | cmp bx, NO_BUFFER 114 | jne qu_001 115 | 116 | pop ebx 117 | ; The list is empty, so add this to the head 118 | mov [eax], bx 119 | jmp qu_exit 120 | 121 | qu_001: 122 | ; Find the last entry 123 | shl ebx, 1 124 | add ebx, queueList 125 | mov eax, ebx 126 | movzx ebx, word [ebx] 127 | cmp bx, NO_BUFFER 128 | jne qu_001 129 | 130 | mov ebx, eax 131 | pop eax 132 | mov [ebx], ax 133 | 134 | qu_exit: 135 | sti 136 | ret 137 | 138 | 139 | 140 | ;*************************************************************************** 141 | ; Function 142 | ; dequeue 143 | ; 144 | ; Description 145 | ; removes a buffer number from the head of a queue 146 | ; This is fast, as it unlinks the first entry in the list 147 | ; queue number in eax ( ms word zeroed ) 148 | ; buffer number returned in eax ( ms word zeroed ) 149 | ; all other registers preserved 150 | ; 151 | ;*************************************************************************** 152 | dequeue: 153 | push ebx 154 | shl eax, 1 155 | add eax, queues ; eax now holds address of queue 156 | mov ebx, eax 157 | cli 158 | movzx eax, word [eax] 159 | cmp ax, NO_BUFFER 160 | je dq_exit 161 | push eax 162 | shl eax, 1 163 | add eax, queueList ; eax now holds address of queue entry 164 | mov ax, [eax] 165 | mov [ebx], ax 166 | pop eax 167 | 168 | dq_exit: 169 | sti 170 | pop ebx 171 | ret 172 | 173 | 174 | ;*************************************************************************** 175 | ; Function 176 | ; queueInit 177 | ; 178 | ; Description 179 | ; Initialises the queues to empty, and creates the free queue 180 | ; list. 181 | ; 182 | ;*************************************************************************** 183 | queueInit: 184 | mov esi, queues 185 | mov ecx, NUMQUEUES 186 | mov ax, NO_BUFFER 187 | 188 | qi001: 189 | mov [esi], ax 190 | inc esi 191 | inc esi 192 | loop qi001 193 | 194 | mov esi, queues + ( 2 * EMPTY_QUEUE ) 195 | 196 | ; Initialise empty queue list 197 | 198 | xor ax, ax 199 | mov [esi], ax 200 | 201 | mov ecx, NUMQUEUEENTRIES - 1 202 | mov esi, queueList 203 | 204 | qi002: 205 | inc ax 206 | mov [esi], ax 207 | inc esi 208 | inc esi 209 | loop qi002 210 | 211 | mov ax, NO_BUFFER 212 | mov [esi], ax 213 | 214 | ret 215 | -------------------------------------------------------------------------------- /Kernel/SB16.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; Sb16.inc ;; 4 | ;; ;; 5 | ;; Sound Blaster 16 functions for MenuetOS ;; 6 | ;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;; 7 | ;; See file COPYING for details ;; 8 | ;; - 11.07.2002 8 bit stereo mode - VT ;; 9 | ;; ;; 10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 11 | 12 | SB16_load_music equ 0xc0000000 13 | SB16_play_music equ 0xc0000001 14 | DMAPage equ 0x2A 15 | Rate equ 44100 16 | SB16Buffer equ 0x2A0000 17 | SB16_Status equ SB16Buffer+65536 18 | 19 | sound_data_format: 20 | 21 | dd 0x1 22 | 23 | sound_data_length: 24 | 25 | dd 65536 26 | 27 | sound_data_freq: 28 | 29 | dd 44100 30 | 31 | sound_interface: 32 | 33 | cmp eax,0 ; Load data 34 | jne no_SB16_load_music 35 | mov edi,[0x3010] 36 | add edi,0x10 37 | add ebx,[edi] 38 | call code_SB16_load_music 39 | ret 40 | no_SB16_load_music: 41 | 42 | cmp eax,1 ; Play data 43 | jne no_SB16_play_music 44 | call code_SB16_play_music 45 | ret 46 | no_SB16_play_music: 47 | 48 | cmp eax,2 ; Set data formats 49 | jne no_SB16_data_format 50 | cmp ebx,0 ; ebx=0 play format 51 | jne no_sound_format 52 | mov [sound_data_format],ecx ; 1=8b mono, 2=8b stereo 53 | ret 54 | no_sound_format: 55 | cmp ebx,1 ; ebx=1 data length 56 | jne no_sound_length 57 | mov [sound_data_length],ecx ; 58 | ret 59 | no_sound_length: 60 | cmp ebx,2 ; ebx=2 sound data frequency 61 | jne no_sound_freq 62 | mov [sound_data_freq],ecx 63 | ret 64 | no_sound_freq: 65 | ret 66 | 67 | no_SB16_data_format: 68 | 69 | ret 70 | 71 | code_SB16_play_music: 72 | 73 | cmp [sound_data_format],dword 1 74 | jne no_sound_8bm 75 | call sb_play_8b_mono 76 | ret 77 | no_sound_8bm: 78 | 79 | cmp [sound_data_format],dword 2 80 | jne no_sound_8bs 81 | call sb_play_8b_stereo 82 | ret 83 | no_sound_8bs: 84 | 85 | ret 86 | 87 | Blaster_command: 88 | 89 | push eax 90 | push ecx 91 | push edx 92 | 93 | mov dx,word [sb16] 94 | add dx,0xc 95 | mov cx,1000 96 | bcl1: 97 | in al,dx 98 | and al,128 99 | jz bcl2 100 | loop bcl1 101 | bcl2: 102 | mov al,[esp+8] 103 | mov dx,[esp+0] 104 | add dx,word [sb16] 105 | out dx,al 106 | 107 | pop edx 108 | pop ecx 109 | pop eax 110 | 111 | ret 112 | 113 | sb_play_8b_stereo: 114 | 115 | pusha 116 | 117 | call sb_set_dma 118 | 119 | call sb_set_stereo 120 | 121 | mov dx,0xc 122 | mov al,0xa8 123 | call Blaster_command 124 | 125 | mov al,0x40 126 | call Blaster_command 127 | 128 | mov al,245 129 | call Blaster_command 130 | 131 | mov al,0x48 132 | call Blaster_command 133 | 134 | mov al,0xff 135 | call Blaster_command 136 | call Blaster_command 137 | 138 | mov al,0x91 139 | call Blaster_command 140 | 141 | popa 142 | ret 143 | 144 | sb_set_stereo: 145 | 146 | push eax 147 | push edx 148 | 149 | call sb_wait 150 | 151 | mov dx,word [sb16] 152 | add dx,0x4 153 | mov al,0xe 154 | out dx,al 155 | inc dx 156 | in al,dx 157 | and al,253 158 | or al,2 ; stereo 159 | out dx,al 160 | 161 | pop edx 162 | pop eax 163 | 164 | ret 165 | 166 | code_SB16_load_music: 167 | 168 | cmp byte [SB16_Status],1 169 | je nol 170 | mov edi,SB16Buffer 171 | mov esi,ebx 172 | mov ecx,65536/4 173 | cld 174 | rep movsd 175 | nol: 176 | ret 177 | 178 | dma_table: 179 | 180 | db 0x87,0x83,0x81,0x82 181 | 182 | 183 | sb_set_dma: 184 | 185 | pusha 186 | 187 | mov eax,[sound_dma] 188 | add eax,4 189 | out 0xa,al 190 | 191 | mov al,0 192 | out 0xc,al 193 | 194 | mov eax,[sound_dma] 195 | add eax,0x48 196 | out 0xb,al 197 | 198 | mov edx,[sound_dma] 199 | shl edx,1 200 | mov al,0 201 | out dx,al 202 | 203 | mov al,0 204 | out dx,al 205 | 206 | mov edx,[sound_dma] 207 | add edx,dma_table 208 | movzx edx,byte [edx] 209 | mov al,DMAPage 210 | out dx,al 211 | 212 | mov edx,[sound_dma] 213 | shl edx,1 214 | inc edx 215 | mov eax,[sound_data_length] 216 | dec eax 217 | and eax,0xff 218 | ; mov al,(DataLength-1) and 0xff 219 | out dx,al 220 | 221 | mov eax,[sound_data_length] 222 | dec eax 223 | shr eax,8 224 | ; mov al,(DataLength-1) shr 8 225 | out dx,al 226 | 227 | mov eax,[sound_dma] ; DMA 228 | out 0xa,al 229 | 230 | popa 231 | ret 232 | 233 | 234 | sb_play_8b_mono: 235 | 236 | call sb_set_dma 237 | 238 | cmp byte [SB16_Status],1 239 | jne contsb16 240 | jmp retserve 241 | 242 | contsb16: 243 | 244 | mov dx,word [sb16] 245 | add dx,4 246 | mov ecx,[sound_dma] 247 | mov ax,0x01 248 | shl ax,cl 249 | shl ax,8 250 | add ax,0x81 251 | out dx,ax 252 | 253 | mov ax,0f280h ;enable irq5 254 | out dx,ax 255 | 256 | adr1_SB: 257 | 258 | mov dx,word [sb16] 259 | add dx,0ch 260 | in al,dx 261 | and al,080h 262 | jnz adr1_SB 263 | 264 | call sb_set_stereo 265 | 266 | mov al,0d1h 267 | out dx,al 268 | 269 | mov dx,word [sb16] 270 | add dx,0ch 271 | 272 | call sb_wait 273 | 274 | mov al,40h ; Rate 275 | out dx,al 276 | call sb_wait 277 | mov al,256-1000000/Rate 278 | out dx,al 279 | 280 | call sb_wait 281 | 282 | mov al,14h ; Datalength 283 | out dx,al 284 | call sb_wait 285 | 286 | mov eax,[sound_data_length] 287 | dec eax 288 | and eax,0xff 289 | ;mov al,(DataLength-1) and 0xff 290 | out dx,al 291 | call sb_wait 292 | mov eax,[sound_data_length] 293 | dec eax 294 | shr eax,8 295 | ;mov al,(DataLength-1) shr 8 296 | out dx,al 297 | 298 | retserve: 299 | 300 | ret 301 | 302 | 303 | sb_wait: 304 | 305 | in al,dx ; Wait 306 | and al,080h 307 | jnz sb_wait 308 | 309 | ret 310 | 311 | 312 | ;**************************************** 313 | ; END CODE SB16 by Minazzi Paolo 314 | ;*************************************** 315 | 316 | 317 | -------------------------------------------------------------------------------- /Kernel/SKINDATA.INC: -------------------------------------------------------------------------------- 1 | 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;; ;; 4 | ;; WINDOW SKIN for MenuetOS ;; 5 | ;; ;; 6 | ;; entryway@bkg.lt ;; 7 | ;; ;; 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | 10 | 11 | 12 | _skinh dd 22 13 | 14 | _refleft dd 0 15 | _skinleft dd 0 16 | _skinleftw dd 66 17 | 18 | _refbase dd 0 19 | _skinbase dd 66 20 | _skinbasew dd 10 21 | 22 | _refoper dd 0 23 | _skinoper dd -58 24 | _skinoperw dd 58 25 | 26 | _buttonCx dd 5 27 | _buttonCy dd 5 28 | _buttonCw dd 11 29 | _buttonCh dd 11 30 | 31 | _buttonMx dd 24 32 | _buttonMy dd 2 33 | _buttonMw dd 17 34 | _buttonMh dd 18 35 | 36 | _buttonPx dd 41 37 | _buttonPy dd 2 38 | _buttonPw dd 17 39 | _buttonPh dd 18 40 | 41 | 42 | defbuttoncolor dd 0x465670 ; 364660 ; 365260 43 | defbuttoncolor2 dd 0xc8c8c8 ; c0c0c0 44 | 45 | _colorframe dd 0x33465f ; 23364F ; 00365260 46 | _colorborder dd 0x0 47 | _coloroutborder dd 0x0 48 | 49 | _fileleft db 'LEFT.RAW ' 50 | _filebase db 'BASE.RAW ' 51 | _fileoper db 'OPER.RAW ' 52 | 53 | _skinwinw dd 0 54 | 55 | ; 56 | 57 | v_skinh dd 38 58 | 59 | v_skinleft dd 0 60 | v_skinleftw dd 66 61 | 62 | v_skinbase dd 66 63 | v_skinbasew dd 10 64 | 65 | v_skinoper dd -58 66 | v_skinoperw dd 58 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Kernel/UDP.INC: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; UDP.INC ;; 4 | ;; ;; 5 | ;; UDP Processes for Menuet OS TCP/IP stack ;; 6 | ;; ;; 7 | ;; Version 0.3 29 August 2002 ;; 8 | ;; ;; 9 | ;; Copyright 2002 Mike Hibbett, mikeh@oceanfree.net ;; 10 | ;; ;; 11 | ;; See file COPYING for details ;; 12 | ;; ;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | 15 | 16 | ;******************************************************************* 17 | ; Interface 18 | ; 19 | ; udp_rx Handles received IP packets with the UDP protocol 20 | ; 21 | ;******************************************************************* 22 | 23 | 24 | 25 | 26 | ;*************************************************************************** 27 | ; Function 28 | ; udp_rx 29 | ; 30 | ; Description 31 | ; UDP protocol handler 32 | ; This is a kernel function, called by ip_rx 33 | ; IP buffer address given in edx 34 | ; Free up (or re-use) IP buffer when finished 35 | ; 36 | ;*************************************************************************** 37 | udp_rx: 38 | push eax 39 | 40 | ; First validate the header & checksum. Discard buffer if error 41 | 42 | ; Look for a socket where 43 | ; IP Packet UDP Destination Port = local Port 44 | ; IP Packet SA = Remote IP 45 | 46 | movzx ebx, word [edx + 22] ; get the local port from 47 | ; the IP packet's UDP header 48 | mov eax, SOCKETBUFFSIZE * NUM_SOCKETS 49 | mov ecx, NUM_SOCKETS 50 | 51 | fs1: 52 | sub eax, SOCKETBUFFSIZE 53 | cmp [eax + sockets + 12], bx ; bx will hold the 'wrong' value, 54 | ; but the comparision is correct 55 | loopnz fs1 ; Return back if no match 56 | jz fs_done 57 | 58 | ; No match, so exit 59 | jmp udprx_001 60 | 61 | fs_done: 62 | ; For dhcp, we must allow any remote server to respond. 63 | ; I will accept the first incoming response to be the one 64 | ; I bind to, if the socket is opened with a destination IP address of 65 | ; 255.255.255.255 66 | mov ebx, [eax + sockets + 16] 67 | cmp ebx, 0xffffffff 68 | je udprx_002 69 | 70 | mov ebx, [edx + 12] ; get the Source address from the IP packet 71 | cmp [eax + sockets + 16], ebx 72 | jne udprx_001 ; Quit if the source IP is not valid 73 | 74 | udprx_002: 75 | ; OK - we have a valid UDP packet for this socket. 76 | ; First, update the sockets remote port number with the incoming msg 77 | ; - it will have changed 78 | ; from the original ( 69 normally ) to allow further connects 79 | movzx ebx, word [edx + 20] ; get the UDP source port 80 | ; ( was 69, now new ) 81 | mov [eax + sockets + 20], bx 82 | 83 | ; Now, copy data to socket. We have socket address as [eax + sockets]. 84 | ; We have IP packet in edx 85 | 86 | ; get # of bytes in ecx 87 | movzx ecx, byte [edx + 3] ; total length of IP packet. Subtract 88 | mov ch, byte [edx + 2] ; 20 + 8 gives data length 89 | sub ecx, 28 90 | 91 | mov ebx, eax 92 | add ebx, sockets ; ebx = address of actual socket 93 | 94 | mov eax, [ebx+ 4] ; get socket owner PID 95 | push eax 96 | 97 | mov eax, [ebx + 24] ; get # of bytes already in buffer 98 | add [ebx + 24], ecx ; increment the count of bytes in buffer 99 | 100 | ; point to the location to store the data 101 | add ebx, eax 102 | add ebx, SOCKETHEADERSIZE 103 | 104 | ; ebx = location for first byte, ecx has count, 105 | ; edx points to data 106 | 107 | add edx, 28 ; edx now points to the data 108 | mov edi, ebx 109 | mov esi, edx 110 | 111 | cld 112 | rep movsb ; copy the data across 113 | 114 | ; flag an event to the application 115 | pop eax 116 | mov ecx,1 117 | mov esi,0x3020+0x4 118 | 119 | newsearch: 120 | cmp [esi],eax 121 | je foundPID 122 | inc ecx 123 | add esi,0x20 124 | cmp ecx,[0x3004] 125 | jbe newsearch 126 | 127 | foundPID: 128 | shl ecx,8 129 | or dword [ecx+0x80000+0xA8],dword 10000000b ; stack event 130 | 131 | mov [check_idle_semaphore],200 132 | 133 | udprx_001: 134 | pop eax 135 | call freeBuff ; Discard the packet 136 | ret 137 | --------------------------------------------------------------------------------