file_id.diz0100664000076500007650000000015306674025274012425 0ustar prool2prool2OS Proolix by Serge Pustovoitoff 2:461/35@Fidonet http://prool.kharkov.org/proolix/ files.bbs0100664000076500007650000000042007007553102012074 0ustar prool2prool2FILE_ID.DIZ description INSTALLD.BAT install Proolix to HDD (D:) INSTALLF.BAT install Proolix to FDD (A:) INSTALLH.BAT install Proolix to HDD (C:) MKBOOT.BAT make proolix boot sector README.1ST read me SUPPORT.TXT proolix support VERSION Proolix SlimeWare version installd.bat0100664000076500007650000000335706474646144012640 0ustar prool2prool2@echo off cls echo Ŀ echo ⠫ Proolix ࠧ d: FAT-12 echo echo Installator (install.bat) version D-0.0.3.1 24-Feb-98 echo echo ⠫, ஬ ᯠ 䠩 slime?.arj echo ⥪騬. echo echo , -ᥪ ᪠ Master Boot Record, ⠪ echo ଠ, ᮤঠ ᪥, 祭 ! echo CTRL BREAK, ᫨ ।㬠. echo ⨢ 砥 ANY KEY echo pause>nul cls src\boot\bp -d@ boot.mbr src\boot\bp -d3 -i -a0 boot.mbr src\boot\bp -d4 -i src\boot\booth12.bin copy src\bm\boot d:\boot > nul echo Kernel to disk d: copy src\kernel\kernel d:\kernel > nul echo on REM REM Doc to disk d: copy *.doc d:\ REM REM Files description to disk d: copy files.bbs d:\ REM REM Utilities to disk d: mkdir d:\bin copy src\command\kernel.ovl d:\ > nul REM a: REM cd \bin REM c: copy src\command\*. d:\bin REM Fonts to disk d: copy src\command\*.fnt d:\bin REM REM Man mkdir d:\usr mkdir d:\usr\man copy man\*.* d:\usr\man REM REM Installation done. REM Reboot, please, from diskette a: REM Press, please, Ctrl Alt Del REM goto End :Error echo ! echo ! Installation error echo ! :End installf.bat0100664000076500007650000000337506501351132012617 0ustar prool2prool2@echo off cls echo Ŀ echo ⠫ Proolix ᪥ a: echo echo Installator (install.bat) version F-0.0.1.4 10-Mar-98 echo echo ⠫, ஬ ᯠ 䠩 slime?.arj echo ⥪騬. echo echo , -ᥪ ᪥ echo ଠ, ᮤঠ ᪥, 祭 !!! echo CTRL BREAK, ᫨ ।㬠 뢠 Proolix'. echo ⨢ 砥 ANY KEY echo pause>nul cls src\boot\bp -d0 -i -y src\boot\boots.bin if errorlevel 1 goto Error echo Boot manager to diskette a: copy src\bm\bootf a:\boot > nul echo Kernel to diskette a: copy src\kernel\kernel a:\kernel > nul echo on REM REM Files description to diskette a: copy files.bbs a:\ REM REM Utilities to diskette a: mkdir a:\bin copy src\command\kernel.ovl a:\ > nul REM a: REM cd \bin REM c: copy src\command\*. a:\bin REM Fonts to diskette a: copy src\command\*.fnt a:\bin del a:\bin\makefile > nul REM Man to diskette mkdir a:\usr mkdir a:\usr\man copy man\*.* a:\usr\man REM REM Installation done. REM Reboot, please, from diskette a: REM Press, please, Ctrl Alt Del REM goto End :Error echo ! echo ! Installation error echo ! :End installh.bat0100664000076500007650000000350106604515346012625 0ustar prool2prool2@echo off cls echo Ŀ echo ⠫ Proolix a: c: (boot manager a:, c: ) echo echo Installator (install.bat) version H-0.0.2.1 30-Sep-98 echo echo ⠫, ஬ ᯠ 䠩 slime?.arj echo ⥪騬. echo ன⢥ a: ᪥! echo echo , -ᥪ ᪠ ᪥, ⠪ echo ଠ, ᮤঠ ᪥ ᪥, 祭 ! echo CTRL BREAK, ᫨ ।㬠. echo ⨢ 砥 ANY KEY echo pause>nul cls src\boot\bp -d0 -i -y src\boot\boots.bin if errorlevel 1 goto Error echo Boot manager to diskette a: copy src\bm\booth a:\boot > nul echo Kernel to disk c: copy src\kernel\kernel c:\kernel > nul echo on REM REM Doc to disk c: copy *.doc c:\ REM REM Files description to disk c: copy files.bbs c:\ REM REM Utilities to disk c: mkdir c:\bin copy src\command\kernel.ovl c:\ > nul REM a: REM cd \bin REM c: copy src\command\*. c:\bin REM Fonts to disk c: copy src\command\*.fnt c:\bin REM REM Man mkdir c:\usr mkdir c:\usr\man copy man\*.* c:\usr\man REM REM Installation done. REM Reboot, please, from diskette a: REM Press, please, Ctrl Alt Del REM goto End :Error echo ! echo ! Installation error echo ! :End man/0040775000076500007650000000000007725636715011107 5ustar prool2prool2man/help.doc0100664000076500007650000000276506674024326012524 0ustar prool2prool2Proolix commands (internal & external): ScrollLock - rus/lat shutdown - shutdown & reboot ver - version clear, cls - clear screen l - list files (internal command). Use l -? for help ls - list files (external). Use ls -? for help mount [digit|dos_drive_letter] - mount new device (new disk) E [arg...] - show arguments (internal) e - show arguments (external) mem - memory map memd - memory dump (use /? subcommand for memd help) fcb - show FCB list alloc - allocate memory block garbage - garbage collection (memory blocks optimize - squeeze) free - free memory block open - open file Cat - copy file (files) to stdout (CATenate files) (internal) cat - (external) vec - show interrupt vectors Xonix - running one xonix on screen (save screen surf) (internal) xonix - (external) int0 - simulate interrupt 0 de - disk editor echo - echo arguments env, set - show environment date - show current date & time timer [-y] [-n] - set time on/off setmore [-y] [-n] - set more on/off buf - show cache buffers' status rm [files...] - delete (ReMove) file (files) mv file1 file2 - rename files: file1 to file2 (MoVe file link) cp file1 file2 - CoPy files: file1 to file2 (external) Cp - (internal cp) cd dir - change directory md dir - make directory pwd - print work directory touch - touch file (external) more file - show file start - start scheduler (with bugs!) Files: files.bbs - all files description (ASCII text) memmap.doc - memory map man/help.src0100664000076500007650000000241306337417724012540 0ustar prool2prool2; ᥬ஢ 䠩 bin/help Proolix ; ਩ (c) G.Shepelev ; #include ; void main(void) a0100: jmp a0104 ; 室 ᨣ a0102 DB 0DEh,0ADh ; ᨣ Proolix' a0104: push cs ; 㦭 a0105: pop ax ; ࠭ 祭 ᥣ a0106: mov [a0110],ax ; ணࠬ a0109: call a0112 ; 맮 ⥫ ணࠬ help a010C: jmp dword ptr [000C] ; 室 ணࠬ - ᥣ ; 室 襭 PSP ; ( .⮭ 㣮! ) a0110 DW ? ; ࠭ (cs) ; { ; ⥫ ணࠬ... ; printf("Usage `more /usr/man/help.doc' for help\n"); a0112: push ds ; 1- ࠬ ᥣ ⥪⮢ ப a0113: mov ax,a0124 ; ᬥ饭 ⥪⮢ ப a0116: push ax ; 2- ࠬ a0117: call a011E ; 맮 printf a011A: add sp,4 ; 祭 ࠬ஢ ⥪ ; } a011D: ret ; main ; =printf a011E: mov ax,10h ; 㭪樨 printf 뢠 INT_NO a0121: int 84h ; int INT_NO a0123: ret ; ⥪, 뤠 ᯫ a0124 DB "Usage `more /usr/man/help.doc' for help",0Ah,0 ; ⢥ ᨬ ॢ ப ᯮ 0Ah, ᫥- ; ⥫쭮 0Dh 0Ah MS-DOS! man/key.src0100664000076500007650000000613406337425140012373 0ustar prool2prool2; ᥬ஢ 䠩 bin/key Proolix ; ਩ (c) G.Shepelev ; #include ; #include ; #include ; void main() a0100: jmp a0104 ; 室 ᨣ a0102 DB 0DEh,0ADh ; ᨣ Proolix' a0104: push cs ; 㦭 a0105: pop ax ; ࠭ 祭 ᥣ a0106: mov [a0110],ax ; ணࠬ a0109: call a0112 ; 맮 ⥫ ணࠬ key a010C: jmp dword ptr [000C] ; 室 ணࠬ - ᥣ ; 室 襭 PSP ; ( .⮭ 㣮! ) a0110 DW ? ; ࠭ (cs) ; { ; ⥫ ணࠬ... ; int i; ; ६ 楫 ⨯, 㤥 ᯮ짮 si a0112: push si ; ࠭塞 si ; printf("View Key Codes\n\nPress Ctrl-D for exit\n\n"); a0113: push ds ; 1- ࠬ ᥣ ⥪⮢ ப a0114: mov ax,a0166 ; ᬥ饭 ⥪⮢ ப a0117: push ax ; 2- ࠬ a0118: call a0160 ; 맮 printf a011B: add sp,4 ; 祭 ࠬ஢ ⥪ ; while(1) ; 横 ;) ; { ; i=getch(); a011E: call a015A ; 맮 getch a0121: mov si,ax ; 祭 i ; printf("%i\n",i); ࠭쪨 祭... a0123: push si ; ᫥ ࠬ a0124: push ds ; 1- ࠬ ᥣ ⥪⮢ ப a0125: mov ax,a018E ; ᬥ饭 ⥪⮢ ப a0128: push ax ; 2- ࠬ a0129: call a0160 ; 맮 printf("%i\n",i) a012C: add sp,6 ; 祭 ࠬ஢ ⥪ ; switch(i) ; { ; case 4: printf("\n"); exit(0); a012F: mov ax,si ; ᫥ ࠬ a0131: cmp ax,4 ; case 4 a0134: jz a0138 ; ᮢ - ॢ ப 室 a0136: jmp a011E ; while a0138: push ds ; 1- ࠬ ᥣ ⥪⮢ ப a0139: mov ax,a018C ; ᬥ饭 ⥪⮢ ப a013C: push ax ; 2- ࠬ a013D: call a0160 ; 맮 printf("\n") a0140: add sp,4 ; 祭 ࠬ஢ ⥪ a0143: xor ax,ax ; 0 a0145: push ax ; ࠬ ⥪ a0146: call a014F ; exit(int) a0149: inc sp ; 祭 ࠬ஢ ⥪ :) a014A: inc sp a014B: jmp a011E ; while ; /* case 0: i=getch(); printf("%i\n",i); */ ; } ᮡ⢥  ... ; } ; } a014D: pop si ; ⠭ si a014E: ret ; main - 㤥... ; =exit a014F: add sp,2 ; ... a0152: mov ax,word ptr [bp+4] ; ࠬ ⥪ ; ( ⮫쪮 ॣ bp ந!) a0155: jmp dword ptr [000C] ; 室 ணࠬ - ᥣ ; 室 襭 PSP ; ( .⮭ 㣮! ) a0159 DB 0 ; ஬! ;) ; =getch a015A: mov ax,0 ; 㭪樨 getch 뢠 INT_NO a015D: int 84h ; int INT_NO a015F: ret ; =printf a0160: mov ax,10h ; 㭪樨 printf 뢠 INT_NO a0163: int 84 ; int INT_NO a0165: ret a0166 DB "View Key Codes",0Ah,0Ah ; "\n" - 0Ah DB "Press Ctrl-D for exit",0Ah,0Ah,0 a018E DB "%i",0Ah,0 ; "%i\n" man/memmap.doc0100664000076500007650000000145706331121214013025 0ustar prool2prool2Memory map for Proolix (80x86 real mode) 00000 Vectors 00400 ROM BIOS data 00500 Kernel PSP 00600 Kernel Begin (see KERNEL_BEGIN in boot.c) 07C00 =0:7C00 (=0070:7500) Boot sector 07E00 Boot sector end xxxxx Kernel end xxxxx+1 Begin of dynamic memory allocate area 30500 (=3050:0000) /boot (boot manager) (see boots.asm, PSPSeg constant) MemTop (f.e. 9FFFF) End of dynamic memory allocate area A0000 EGA (in graph modes) B0000 MDA, Hercules 1st videopage B8000 CGA, EGA, VGA 1st videopage (mode=3, symbol mode) C8000 Additional ROM modules (2K blocks) E0000 End of addtn ROM E0000 Bg AT ROM BIOS EFFFF End AT ROM BIOS F6000 ROM Basic FE000 ROM BIOS, POST FFFF0 JMP - COLD REBOOT FFFF5 BIOS version/date (ASCII) FFFFE PC/XT/AT identefication byte man/cp.src0100664000076500007650000003125406340612670012206 0ustar prool2prool2; ᥬ஢ 䠩 cp Proolix ; ਩ (c) G.Shepelev ; #include ; #include ; #include ; #include ; #include ; #include ; #include ; ⠭⭮ 砫 ணࠬ. ; ⥪ । ࠬ ᨢ ᨬ ப! a0100: jmp a0104 ; 室 ᨣ a0102 DB 0DEh,0ADh ; ᨣ Proolix' a0104: push cs ; 㦭 a0105: pop ax ; ࠭ 祭 ᥣ a0106: mov [a0110],ax ; ணࠬ a0109: call a0242 ; 맮 main ; ax 頥 襭... a010C: jmp dword ptr [000Ch] ; 室 ணࠬ - ᥣ ; 室 襭 PSP ; ( .⮭ 㣮! ) a0110 DW ? ; ࠭ (cs) ; void cp_help(void) ; { ; puts("Uses: cp [file1] [file2]"); 뤠 ᪠... a0112: push ds ; 1- ࠬ ᥣ ⥪⮢ ப a0113: mov ax,a034C ; ᬥ饭 ⥪⮢ ப ; "Uses: cp [file1] [file2]",0 a0116: push ax ; 2- ࠬ a0117: call a031C ; 맮 puts a011A: add sp,4 ; } a011D: ret ; int copy(char *path1, char *path2) ; ணࠬ ਧ ஢ 䠩 㣮 ; {int h1, h2, i1, i2; long n, m; ; char buf [SECTOR_SIZE]; a011E: push bp ; ࠭ ᮤন ॣ bp a011F: mov bp,sp ; bp - 㪠⥫ ⥪; ; "ᢥ" - । 㭪樨 ࠬ, ; "᭨" - ६ ६. a0121: sub sp,210h ; १ࢨ஢ 200h , ; 4 n m, ; 2 h1, h2, i1 i2 ; if((h1=open(path1,O_RDONLY))==-1) return -1; ; 䠩1 ⥭ a0125: mov ax,1 ; O_RDONLY a0128: push ax ; ࠬ ⥪ - ਡ 㯠 a0129: push ds ; ன ࠬ ⥪ - seg path1 a012A: push [bp+4] ; ன ࠬ ⥪ - offset path1 a012D: call a0328 ; open a0130: add sp,6 ; ४ 㪠⥫ ⥪ a0133: mov [bp-210h],ax ; h1 = 䠩1 a0137: cmp ax,-1 ; == -1 a013A: jnz a013F ; , த... a013C: jmp a0235 ; 室 ਧ . -1 ; if((h2=open(path2,O_WRONLY|O_CREAT|O_TRUNC))==-1) ; 0- ( ᫨ - ᮧ) ; 䠩, a013F: mov ax,0302h ; O_WRONLY or O_CREAT or O_TRUNC a0142: push ax ; ࠬ ⥪ - ਡ 㯠 a0143: push ds ; ன ࠬ ⥪ - seg path2 a0144: push [bp+6] ; ன ࠬ ⥪ - offset path2 a0147: call a0328 ; open a014A: add sp,6 ; ४ 㪠⥫ ⥪ a014D: mov [bp-20Eh],ax ; h2 = 䠩2 a0151: cmp ax,-1 ; == -1 a0154: jnz a0162 ; , த... ; {close(h1); return -1;} a0156: push [bp-210h] ; h1 = 䠩1 a015A: call a033A ; close a015D: inc sp ; ४ 㪠⥫ ⥪ a015E: inc sp a015F: jmp a0235 ; 室 ਧ . -1 ; while(1) ; ᪮ 横 ⥭- ᥪ஢ ; { ; if((n=read(h1,buf,SECTOR_SIZE))==-1) break; ; ⥭ । ᥪ a0162: xor dx,dx a0164: mov ax,a0200 ; dx ax = (= ᥪ.) a0167: push dx ; ࠬ ⥪ - 襥 ᫮ a0168: push ax ; ࠬ ⥪ - 襥 ᫮ ; 뢠, 16-⭠, ; 祭 ᮬ⥫쭮, ⮡ 襥 ᫮ ... a0169: push ss ; ன ࠬ ⥪ - seg buf a016A: lea ax,[bp-200h] a016E: push ax ; ன ࠬ ⥪ - offset buf a016F: push [bp-210h] ; ⨩ ࠬ ⥪ - h1 a0173: call a032E ; read a0176: add sp,10 ; ४ 㪠⥫ ⥪ a0179: mov [bp-206h],dx ; n = ᫮ ⠭ ⮢ a017D: mov [bp-208h],ax a0181: cmp dx,-1 ; == -1 a0184: jnz a018B a0186: cmp ax,-1 a0189: jz a01E4 ; break 訡 ⥭ ; if(n==0) {m=0; break;} ஢ઠ 䠩 a018B: mov ax,[bp-208h] a018F: or ax,[bp-206h] ; n == 0 ? a0193: jnz a01A3 a0195: mov word ptr [bp-202h],0 ; m = 0 a019B: mov word ptr [bp-204h],0 ; 祣 ᠭ a01A1: jmp a01E4 ; break 䠩1 ; if((m=write(h2,buf,n))==-1) break; ; । ᥪ a01A3: push [bp-206h] ; ࠬ ⥪ - n a01A7: push [bp-208h] ; (᫮ ) ; 뢠, 16-⭠, ; 祭 ᮬ⥫쭮, ⮡ 襥 ᫮ ... a01AB: push ss ; ன ࠬ ⥪ - seg buf a01AC: lea ax,[bp-200h] a01B0: push ax ; ன ࠬ ⥪ - offset buf a01B1: push [bp-20Eh] ; ⨩ ࠬ ⥪ - h2 a01B5: call a0334 ; write a01B8: add sp,10 ; ४ 㪠⥫ ⥪ a01BB: mov [bp-202h],dx ; m = ᫮ ᠭ ⮢ a01BF: mov [bp-204h],ax a01C3: cmp dx,-1 ; == -1 a01C6: jnz a01CD a01C8: cmp ax,-1 a01CB: jz a01E4 ; break 訡 ; if (m!=n) break; ஢ઠ ࠢ쭮 a01CD: mov dx,[bp-202h] ; m a01D1: mov ax,[bp-204h] ; ᫮ ᠭ a01D5: cmp dx,[bp-206h] ; == n ᫮ ⠭ a01D9: jnz a01E4 a01DB: cmp ax,[bp-208h] a01DF: jnz a01E4 ; break 㤠 ; } a01E1: jmp a0162 ; ᫥騩 ᥪ... ;  䠩 ᪮஢ 砥 訡 ; ࠧ 뫮 ࠧ 窨 室 ; ନ஢ ⤥ ਧ 訡... ; i1=close(h1); a01E4: push [bp-210h] ; h1 ( 䠩1) a01E8: call a033A ; close a01EB: inc sp ; ४ 㪠⥫ ⥪ a01EC: inc sp a01ED: mov [bp-20Ch],ax ; i1 - ਧ ᯥ譮 䠩1 ; i2=close(h2); a01F1: push [bp-20Eh] ; h2 ( 䠩2) a01F5: call a033A ; close a01F8: inc sp ; ४ 㪠⥫ ⥪ a01F9: inc sp a01FA: mov [bp-20Ah],ax ; i2 - ਧ ᯥ譮 䠩2 ; if (n==-1) return -1; a01FE: cmp word ptr [bp-206h],-1 ; n == -1 a0203: jnz a020C a0205: cmp word ptr [bp-208h],-1 a020A: jz a0235 ; 室 ਧ . -1 ; if (m==-1) return -1; a020C: cmp word ptr [bp-202h],-1 ; m == -1 a0211: jnz a021A a0213: cmp word ptr [bp-204h],-1 a0218: jz a0235 ; 室 ਧ . -1 ; if (m!=n) return -1; a021A: mov dx,[bp-202h] ; m (᫮ ᠭ ⮢) a021E: mov ax,[bp-204h] a0222: cmp dx,[bp-206h] ; n (᫮ ⠭ ⮢) a0226: jnz a0235 a0228: cmp ax,[bp-208h] a022C: jnz a0235 ; 室 ਧ . -1 ; if (i1==-1) return -1; a022E: cmp word ptr [bp-20Ch],-1 ; i1 (ਧ ᯥ譮 䠩1) a0233: jnz a023A ; =return -1 a0235: mov ax,-1 ; -1 a0238: jmp a023E ; return (i2); a023A: mov ax,[bp-20Ah] ; i2 (ਧ ᯥ譮 䠩2) ; ࠧ ⭥ 뫮 , ᫨ ஢ન 믮﫨 ᪨ ; if... ; } ; 室 ணࠬ copy a023E: mov sp,bp ; 室 ﭨ ⥪ a0240: pop bp ; ⠭ ᮤন bp a0241: ret ; main(int argc, char *argv[] ) ᭮ 楤 ; argc - ᫮ । ப ᨬ ; *argv - 㪠⥫ ᨢ ᨬ ; { ; int ii, j, n, Files=0; ; char path[2][PATH_MAX]; a0242: push bp ; ࠭ ᮤন ॣ bp a0243: mov bp,sp ; bp - 㪠⥫ ⥪; ; "ᢥ" - । ணࠬ ࠬ, ; "᭨" - ६ ६. a0245: sub sp,206h ; १ࢨ஢ 2*FFh , ; 2 ii, j, n Files a0249: mov word ptr [bp-200h],0 ; Files=0 ; 䠩 ; 뫮 ᮬ ii... ; argc--; a024F: dec word ptr [bp+4] ; argc=argc-1 ; (㫥 ப 㥬) ; ii=1; a0252: mov word ptr [bp-206h],1 ; ii=1 ; ப ᨢ (砫 ࢮ ப) ; do ; ஢ ⥪⮢ ப ᨢ ६ ; (⥫ 祬...) ࠡ⪨ 権 ; { ; if (argc) a0258: cmp word ptr [bp+4],0 ; argc == 0 a025C: jz a02C8 ; ப ஢ ... ; { ; if (argv[ii][0]=='-') ਧ 樨? a025E: mov bx,[bp-206h] ; ii a0262: shl bx,1 ; ii*2 a0264: add bx,[bp+6] ; offset argv + ii*2 ; (. 㪠⥫ ii- ப ᨬ) a0267: mov bx,[bx] ; 㪠⥫ 0- ᨬ ii- ப a0269: cmp byte ptr [bx],2Dh ; == "-" a026C: jnz a029A ; else ; { ; ॠ 樨 ; n=(int)strlen(argv[ii]); a026E: push ds ; ࠬ ⥪ - seg argv[ii] a026F: mov bx,[bp-206h] ; ii a0273: shl bx,1 ; ii*2 a0275: add bx,[bp+6] ; offset argv + ii*2 a0278: push [bx] ; ࠬ ⥪ - offset argv[ii] a027A: call a0346 ; strlen a027D: add sp,4 ; ४ 㪠⥫ ⥪ a0280: mov [bp-202h],ax ; n= ப ; for (j=1;j= ; switch (argv[ii][j]) ; { ; case 'N': 権 ;) ; default : cp_help(); return 1; a0294: call a0112 ; 뤠 ᪠... a0297: jmp a0311 ; return 1 ; } ; } ; else ; { ; strcpy(path[Files++],argv[ii]); ; ஢ ii- ப ᨢ , ; 稪 Files ४ 㪠 ᫥ a029A: push ds ; ࠬ seg arg[ii] a029B: mov bx,[bp-206h] ; ii a029F: shl bx,1 ; ii*2 a02A1: add bx,[bp+6] ; offset argv + ii*2 ; (. 㪠⥫ ii- ப ᨬ) a02A4: push [bx] ; ࠬ offset argv[ii] a02A6: push ds ; ன ࠬ seg path[Files] a02A7: mov ax,[bp-200h] ; Files 0...1 a02AB: inc word ptr [bp-200h] ; Files=Files+1 a02AF: mov dx,0FFh ; path a02B2: mul dx ; ax=⥪ 砫쭠 a02B4: lea dx,[bp-1FEh] ; 砫 path a02B8: add ax,dx ; ᬥ饭 ⥪饩 樨 a02BA: push ax ; ன ࠬ offset path[Files] a02BB: call a0340 ; strcpy ஢ ப ASCIIZ a02BE: add sp,8 ; ४ 㪠⥫ ⥪ ; if (Files>2) {cp_help(); return 3;} a02C1: cmp word ptr [bp-200h],2 a02C6: jg a02DF ; Files>2 ; } ; } ; } ; while (ii++= a02D5: jmp a0258 ; DO ; if (Files<2) {cp_help(); return 3;} ; ஢ઠ ⮣, 뫨 । 䠩 (譨 .) a02D8: cmp word ptr [bp-200h],2 a02DD: jge a02E7 ; Files>=2 类 OK ; =cp_help();return 3 a02DF: call a0112 ; 뤠 ᪠... a02E2: mov ax,3 a02E5: jmp a0318 ; if ((copy(path[0],path[1]))==-1) ; ஢ 䠩 ஢મ ᯥ譮 a02E7: lea ax,[bp-0FFh] a02EB: push ax ; ࠬ path[1] a02EC: lea ax,[bp-1FEh] a02F0: push ax ; ன ࠬ path[0] a02F1: call a011E ; ணࠬ copy a02F4: add sp,4 ; ४ 㪠⥫ ⥪ a02F7: cmp ax,-1 ; == -1 a02FA: jnz a0316 ; , ୮ 䠩 ᪮஢ 㯥譮... ; { ; printf("Can't copy %s to %s\n",path[0],path[1]); a02FC: lea ax,[bp-0FFh] a0300: push ax ; ࠬ - path[1] a0301: lea ax,[bp-1FEh] a0305: push ax ; ன ࠬ - path[0] a0306: push ds ; ࠬ seg ப a0307: mov ax,a0365 ; ᬥ饭 ⥪⮢ ப ; "Can't copy %s to %s",0Ah,0 a030A: push ax ; ࠬ offset ப ; 쬠 । ᮢ ⥪⮢ ப, ; 祭 ᥣ, 㣨 ... ; ??? a030B: call a0322 ; printf a030E: add sp,8 ; ४ 㪠⥫ ⥪ ; return 1; a0311: mov ax,1 a0314: jmp a0318 ; } ; return 0; a0316: xor ax,ax ; } ; 室 ணࠬ main a0318: mov sp,bp ; 室 ﭨ ⥪ a031A: pop bp ; ⠭ ᮤন bp a031B: ret ; =puts a031C: mov ax,7 a031F: int 84h a0321: ret ; =printf a0322: mov ax,10h a0325: int 84h a0327: ret ; =open a0328: mov ax,24h a032B: int 84h a032D: ret ; =read a032E: mov ax,26h a0331: int 84h a0333: ret ; =write a0334: mov ax,27h a0337: int 84h a0339: ret ; =close a033A: mov ax,28h a033D: int 84h a033F: ret ; =strcpy a0340: mov ax,3Ch a0343: int 84h a0345: ret ; =strlen a0346: mov ax,40h a0349: int 84h a034B: ret a034C DB "Uses: cp [file1] [file2]",0 a0365 DB "Can't copy %s to %s",0Ah,0 man/files.bbs0100664000076500007650000000005606704425530012662 0ustar prool2prool2HELP.DOC help MEMMAP.DOC proolix memory map mkboot.bat0100664000076500007650000000203506050135426012273 0ustar prool2prool2@echo off cls echo Ŀ echo 㧮筮 ᥪ Proolix ᪥ a: echo echo Boot maker (mkboot.bat) version 0.0.0.24 8-Nov-95 echo echo ⠫, ஬ ᯠ 䠩 proolix.arj echo ⥪騬. echo echo , -ᥪ ᪥ echo ଠ, ᮤঠ ᪥, 祭 !!! echo CTRL BREAK, ᫨ ।㬠 뢠 Proolix'. echo ⨢ 砥 ANY KEY echo pause>nul cls bp -i -y boots.bin readme.1st0100664000076500007650000002756307010271632012210 0ustar prool2prool2 樮 ⥬ Proolix - 䠩 readme Copyright (C) 1993-1999 Serge Pustovoitoff, prool@itl.net.ua, 2:461/35@FidoNet Portions copyright: PKLITE (tm) Executable File Compressor Version 1.15 7-30-92 (C) 1990-1992 PKWARE Inc. All Rights Reserved. Patent No. 5,051,745 PKWARE, Inc. 9025 N. Deerwood Drive Brown Deer, WI 53223 Content 1. PROOLIX not UNIX 2. Warranties & license 3. [skipped] 4. Install (⠭ 㫨) 5. RTFM - Read The F$%& Manual 6. VIRUS! 7. History 8. Trademarks 9. Credits 10. Contact & e-mail support 11. 1. PROOLIX not UNIX 頥 । 室 ࠧࠡ⪨ POSIX-ᮢ⨬ 樮 ⥬ Proolix. H POSIX ᥩ 室 ਬ୮ ஢ MSDOS 3.0 ( 筮). ;) 2. Warranties & license ⨫ Proolix DOS-ᨨ OS/2 ࠧ . .設 p蠥 pᯮp ᯮ짮 室 ⥪⮢ ᠬ pp, ⮬ ᫥ p, p 믮 ᫥y y᫮: 室 ⥪ pᯮp p 襮ᠭ p, ᯨ᪠ y᫮ p饩 p樨 ⢥⢥. ணࠬ,p த y ⥩ ᯮ짮 ⮣ pp py, 뢮 ᫥y饥 ᮮ饭 ᪮, ࠨ᪮ / ᪮ 몠: > py 砥 pp, pp⠭ ࣥ ⮢⮢ > 楩 த ᢮ ᪫i ணࠬ, i ஧஡ > i ⮢ii > This product includes software developed by the Serge Pustovoitoff 砥 אַ ᢥ ਡ뫨 ࠭ த. ᯮ짮 ᯮᮡ⢮ pᯮp py⮢, ᮧ pp py, ᯥ樠쭮 쬥 pp襭. pp py pᯮp 祭묨 栬 ਭ⮬ ୮ ࠪ⨪ ਭ樯 "AS IS" (" () " - ⠪() ।). p⨨, py騥  p, ( p稢) py騥 p⨨ ⮢p p p p, ⢨⥫. ࠭⨩, , ࠧ㬥, ணࠬ 뢥 ⭮ ணࠬ ᯥ祭 稭 ᢥ ⪮ 襬 ﭨ ஢. H y砥 ⢥⢥ pאַ, ᢥ, y砩, ᮡ, ⨯筮 ᪨ 訥 p (, p稢, ⠢y ᮯyy ⮢p yy, p pᯮᮡ, , p뫨 p⠭y ⥫쭮)  p⮢ ⢥⢥, p, p ⢥⢥ ppy襭 ( p -), ⥪騥 ᯮ짮 py p, ᫨ p ⭮ p. 砥 ० ⥭ ਭ, , ᫨ ᮮ ᫮, ந諠 , , , ᬮ : ਬ, ᮢ⮬, ⠭ , 祭 樥 ਬ 㫨 뫪 ᨨ ࠢ 祭 訡 㫨. ࠢ 祭 , ⮡ । ਩ 﫮. 4. Install "Make Proolix not war" 쭮 ( 室 ⥪) ⠢ 娢 (⥪饩 ⠢  Proolix SlimeWare 娢 slime?.arj), 娢஬ arj. ⠭ 室 ᯠ 娢 ⠫ c:\proolix 襬 ⪮ ᪥ ணࠬ install?.bat. (installb.bat ⠫ 㫨 ᪥ A:, 㤠 㤥 ⮬ 㧨. installh.bat ⠫ 㫨 , C: (master boot record boot-sector , 㧪 ࠢ 㤥 ᪥, 㧨 boot-manager । ࠢ 室饬 )). 設 㫨 ᯠ ᪥ B: ᪠ installb 㤠. 設 ண ᪮, ⮡ ᤥ 㦠 㫨-᪥, 室 ᮧ ᪥ -ᥪ 㫨, ⨢ mkboot.bat ᪮஢ ୥ ⠫ ᪥ 䠩 kernel.bin, २ kernel. (: 䠩 install.bat 뫠 訡 ଠ쭮 ࠡ⠥ ⮫쪮, 稭 ᨨ 0.0.0.8 5-Jan-94, ( 祭 ᠬ 䠩 install.bat)). ᫥ 祣 㦠 ᪥ A: ࠡ Proolix. 5. RTFM - Read The F$%& Manual 㬥 Proolix': - MSDOS-ணࠬ Boot Processor (bp.com) 㬥 ஢ 䠩, 䠩 ⠫஢ (com) 䠩 ᥪ ᪥, ࠬ஢ ᪥, , ⭮, 室 . ࠧ, ⮩ ணࠬ ᬮ ᢮ . (쪮 祬? 祬, . ⥭ ⨢ VITAMINB . ⥭ (- ⯠ࠬ ), ⪥ 㧪 ᪥ ந 㧪 - ⮦ ⨢᭮ 祭 㤮⢠ 㦨). - ணࠬ boot.asm - -稪, ᯮ ࢮ ᥪ ᪥. 㦠 ᪠ ᪨ 䠩 /BOOT (boot manager). ⮬ 䠩 ୥ ⠫ ᪥ ᪮쪮 㣮 ᬥ ஢. ᫥ FAT. - /BOOT - ⮭ ணࠬ, 㦠 -稪. - boot manager Proolix. Hᠭ . Boot manager 㦠 㫨 ᪥ A:, ࠧ C:, ਭ㤨⥫쭮 㦠 MSDOS ( ) 稨 ᪥ A: .. - KERNEL - ⮭ ணࠬ, 㦠 -஬. - Proolix. Hᠭ . ஢, . ⥫쭮 䠩 makefile 室 - 䠩 kernel.c. ࠡ⠥ ⮭, , ⮫쪮 ⢨ ROM BIOS, 設⢮ 㭪権 몠 , ᯮ , ࠡ⠥. ᠫ ᥬ 㭪権. H 뢭 ᪠ ᨨ 묨 㭪ﬨ ࠢ 祭 . - ᠭ 㣨 䠩 䠩 dir files.bbs, ⠪ 㣨 䠩 㬥樨. ⪨ ᢮ ७ 譨 㫨 , ᯮ help. ( "७" ⮬ ᫥, ஬ cd/chdir MSDOS UNIX'  ७). 6. ⨢᭠ , ਥ஢ MSDOS 樮 ⥬ Proolix ।, ⨢ ⮢ ᮢ ஢ઠ ᥪ 砫 . (஢ઠ ᤥ , । ਥ 檨, bela@padco.kharkov.ua). -ᥪ 㫨, 㦨 ᪥, ண 㦠 㫨, ⮢ , 뢮 ᨬ V ࠭  . ᨬ V ४ ⠢ ᪮ A: ਫ ᪥ MSDOS ⨢묨 ।⢠, ⥬ १㧨 ᪠ A: ( Ctrl-Alt-Del, reset!) ந 祭 騬 ।⢠ (Aidstest, ADinf Cure Module, Dr.Web, format c: etc). ⠪ 䨫⨪ ⮢ ᮢ ᯮ짮 樭 VitaminB . 7. 䠩 history.doc 8. Trademarks , Prool, PROOL, prool, , Proolix, PROOLIX, 㫨, , 㫨, , XProolix, XPROOLIX, xproolix, 㫨, , 㫨, , 㫨, 㫨 - ࣮ ન JNP, jnp, -- - - ࣮ ન ୮ 㡠 JNP (쪮) ⠫ 㯮 ⥪ ࣮ ન imho - ਭ 9. Credits , ⮩ ⥯ ᮢ 㫨ᮬ / אַ ᢥ . ᯨ᮪: ਩ , .欠 (ࠨ), 㭨娭, Sprint, igor@ktts.kharkov.ua, , vega@itl.net.ua, ᪨, ⢮ "䠪", zema@interfax.kiev.ua, ਩ த砭, Linux Team, ૮, 2:461/27@Fidonet ३ 祭, ३ ஢, 2:461/35.444@Fidonet, , ﭮ, 2:461/144@Fidonet, 堨 . 殢, ਩ 檨, "PADCO", C (2:461/61.99@Fido), , ஢, 猪, ਤ, 堨 ࡠ, Mike Aizatsky, 2:461/21.100@Fidonet, ࣨ H.., 쪮᪨ 㤠⢥ 㭨, Sergey Goudzenko, 2:461/416, (Ralf Brown) - Interrupt List - 訩 ஡訩 ࠢ筨 ⥪ PC! ࣥ 設, ⮪, Tony Perminov, 2:461/200.12@Fidonet PKWARE, Inc free 㯠騪 PKLITE ஢, Linux Team, Soft-ICE by Nu-Mega Technologies, MARQUIS DE SOIREE, PartitionMagic by PowerQuest 10. Contact & e-mail support 易 ஬, ᬮ 䠩 support.txt Proolix - ࣥ ⮢⮢, ⠪ Serge Pustovoitoff (Prool). : Internet prool@infocom.kharkov.ua FidoNet 2:461/35 WWW http://www.infocom.kharkov.ua/~prool Voice phone +380(572)235102, 123445 11. [] " UNIX" . (ॢ ᪮ ...  ..) ("THE DESIGN OF THE UNIX OPERATING SYSTEM" by Maurice J. Bach) Copyright c 1986 ௮ Bell Telephone Laboratories. ௮樥 Prentice-Hall. ⤥ Simon & Schuster , - 07632 ணࠬ ᯥ祭 ⥫⢠ Prentice Hall. ⠭ ࠩ . ୨ ISBN 0-13-201757-1 025 [] . 㪮⢮ 樮 ⥬ UNIX / . . - .: ⨪, 1985. - 232 . [] 쭠 樮 ⥬: ࠢ筨. - .: , 1991. - 208 . ISBN 5-256-00581-2 [୨ ] ୨ .., . UNIX - 㭨ᠫ쭠 । ணࠬ஢. - .: ⨪, 1992 [H⥭] H⥭ ᠭ, "PTS-DOS MS-DOS?". - "Computer World ", 28 1994, No 23(23), .6. [Amstrad] Amstrad personal computer PC 1640. User instructions. Second edition, 1987 [Interrupt List] Interrupt List, Release 48, Last change 10/29/95 This compilation is Copyright (c) 1989,1990,1991,1992,1993,1994,1995 Ralf Brown [TECH Help!] TECH Help! ver 1.2 Copyright (c) 1985,1986,1987 by Dan Rollins and Flambeaux Software ॢ ᪨ .. [PC Help] [Help PC] HelpPC 2.10 Quick Reference Utility Copyright (c) 1991, David Jurgens readme.2nd0100664000076500007650000001513106474633266012172 0ustar prool2prool2 ⠫஢ 㫨 ( 㧪 ) ver.2 24.Feb.98 --------------------------------------------------------- ⠫஢ ᥪ ᥪ , । ⠡ ࠬ஢, BP.C (Boot Processor). ࠢ, ᯮ짮 ⨫ BP ७ ࠧ. ஡ ᠭ, ஥ 㤮⢮ਫ ᪠⥫ ࣨ , 娭⮢: 1. BP ᠭ १ 2. BP ࠬ஢ , 뤠 奫 3. ࠬ ப -d<> ன⢠, : 0 - 䫮 A: 1 - 䫮 B: 2 - (ࠧ C:) 3 - ... 㬠, 3 - ࠧ D: ? ७ ⠬! , ਤ㬠 Extended Partition, 宦, Microsoft ࢠ... . த ᢮ ६, ᪮쪮 ਭ᫠ (  ᯮ). ⠪, ᬮਬ ⨯ 䨣 ᪮ : ⮨ C: Windows 95, Extended partition, 騩 ᪮ ᪠ - D: (ਬ, 뤥 㫨). , ணࠬ BP ⠥ extended partition ⤥ ࠧ (㫥 ), ᪨ - ࠧ (- ). ⮬ 㤥: 2 - ࠧ C: (Primary partition) 3 - Extended partition 4 - logical disk D: (⨬ ᪮, Extended partition 祭 宦 Partition Table MBR (Master Boot Record)) H . ⠭묨 ।⢠ Windows 95 ᤥ D: 㦠 ! ᤥ sys d:, ⮬ fdisk ᤥ ⨢ ࠧ D:, 㧨 㤥 ! 祬? ᬮਬ 㧪 ஡. 砫 㧪 㦠 Master Boot Record, ᮤঠ Partition Table । ࠢ. ঠ MBR ணࠬ । ⨢ ࠧ, 㦠 ᥪ । ࠢ, ᥪ ᢮ । 㦠 ᢮ 樮 ⥬. Windows 95 C: ( D: 㬥 ⠢?), ࠡ⠥ ଠ쭮, 뫮 㬠. H ᮧ ࠧ, C: FAT-ࠧ Windows 95 ᮧ , ᮧ ⮫ extended ࠧ, - ᪮쪮 ᪨ ᪮. - 稭 ᠬ ᭮. ⨢ (㦠) ᤥ ⮫쪮 extended ࠧ ( 㯮 Master Partition Table). H 㧨 ⮣ ࠧ , ⠪ ᥪ ﬨ ( ணࠬ 㧪) ⠭묨 ।⢠ Windows 祬 㣨 ). ⮬ ⮫쪮 ᤥ extended partition ⨢ fdisk, ९ 㤠 ணࠬ 㧪 MBR (ᤥ ⮫쪮 ணࠬ BP ⮭᪨ -஬, BP 㤮 ;) bp -d@ mbr bp -d3 -i -a0 mbr 㧨 ⮩ 樮 ⥬, ⠭ ᪮ ᪥ D: 㤠 ⠭ MSDOS/MS Windows sys d: format d: /s 㫨 bp -d4 -i booth16 copy a:*.* d: (᫨ ᯠ ਡ⨢ 㫨 a:) ਫ. ࠬ ணࠬ BP. ⮩ 맮 BP ਬ୮ ⠪: bp -d0 file ⮬ ᥪ ன⢠ 0 䠩 file ⮡ࠦ ࠭ ଥ ⠡. ᮮ⢥⢨ ॠ ᪠ 㦥 ਫ , ⮫쪮, ᥢன⢮ @ - Master Boot Record. (஢ 䠩 ᥪ) ⢫ 䫠 -r ("ॢ"). , ᪮஢ MBR bp -d@ -r nechto HH! 祭 ४ ஢ - MBR ᢮ , ᫨ 㢥७ ४⭮ 室 ⢨. ࠧ ଠ, ᮤঠ (᪥). (祬, Windows ࠧ ᤥ...) ४ ᯮ짮 -r , ⠪ १뢠 __ ᥪ, ⮬ ᫥ ⠡ ࠬ஢ ⮬ ⮦ 筮  (⮦ ଠ ᪠) ⠫樨 ᢮ ணࠬ 㧪 ᥪ ४ -i ("⠫"), ᥪ ⮫쪮 ணࠬ , ⠢ ⠡ ࠬ஢ ⠡ ࠧ 襩. ⠪ ந⠫஢ 㫨 ᥪ ᪥ A: bp -d0 -i boots.bin , , ࠬ -a<> ᯮ ⠫樨 ணࠬ 㧪 MBR- ᥢன⢮ (MBR (-d@) extended partition). ᯮ ࠬ, 㪠 ⨢ (㦠) ࠧ - ਬ, ⨢ ᪨ Extended 樨. ( ࠬ஬ -a MBR ⥫쭮 ४, ⮣ ⥬ ணࠬ fdisk. 祬, -, ணࠬ BP ⠭ 䫠 -d@ -a -i -r . ⠪ ...) , ணࠬ BP ࠡ 뤠 ⠡ ࠧ 襬 . ᬮ ⠡. ਬ ⠪ ⠡ , 饣 ࠧ c:, d:, e: Boot Processor 0.1.4 24-Feb-98 (C) 1993-1998, S.Pustovoitoff Dev Head Sec Trk/cyl Partition ------------------------------- 0 floppy drive 1 floppy drive 2 1 1 0 LARGE (06) 3 0 193 15 EXTENDL (0F) 4 1 193 15 FAT-12 (01) 5 0 193 18 EXTEND (05) 6 1 193 18 FAT-12 (01) , 2 - ࠧ c: (primary partition), 3 - ࢠ extended partition, 4 - ࠧ (᪨ ) d:, 5 - extended partition, 6 - ࠧ (᪨ ) e: , ᪮ । extended partition 졠 ᥬ, ⠥: ᫨ , ᥪ. ⮣ ⠫஢ 㫨. ⠫, ᪠ D:, ᥪ (䠩 src/boot/booth16.bin ਡ⨢, ᫨ FAT-16 booth12.bin, ᫨ FAT-12) ᪮ D: ७ ⬥ (䠩 src/bm/boot) ( 室 ⠫ Extended partition ணࠬ 㧪 MBR, , ᠭ ). D: (Extended partition) ⨢ ஡ ॣ㧨 (࠭ ਣ⮢ 㧮 rescue ᪥!). १ : E-mail prool@prool.kharkov.ua Fido 2:461/35 src/0040775000076500007650000000000007725636627011125 5ustar prool2prool2src/gist.doc0100664000076500007650000000257206445007324012545 0ustar prool2prool2 19Prool's activity for Proolix development 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 199319941995 DecJanFebMarAprMayJunJulAugSepOctNovDecJanFebMarAprMayJunJulAugSepOctNov src/kernel/0040775000076500007650000000000007725636544012403 5ustar prool2prool2src/kernel/fprintf.c0100664000076500007650000000137106100170276014173 0ustar prool2prool2#include #include #include #include "kernel.h" /****************************************************************************/ int fprintf(FILE far *stream, const char far *format, ...) { va_list v; int counter; char buf [MAX_LEN_STR]; va_start(v,0); counter=vsprintf(buf,format,v); if(fputs(buf, stream)==EOF) return EOF; return counter; } /****************************************************************************/ int vfprintf(FILE *stream, const char *format, va_list v) { int counter; char buf [MAX_LEN_STR]; va_start(v,0); counter=vsprintf(buf,format,v); if(fputs(buf,stream)==EOF)return EOF; return counter; } /****************************************************************************/ src/kernel/kernel.h0100664000076500007650000000403607007576356014031 0ustar prool2prool2/* Include file for external c-functions for kernel (as memd.c) */ #include /* structures */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /******************************** External variables ************************/ #ifdef MOUSE extern unsigned int PORT; #endif /* . ᠭ ६ 䠩 kernel.c */ extern int Mode, User; extern int HeadCnt, TrkSecs; extern unsigned long MaxSectors; extern unsigned int ProcessPar; extern struct {unsigned int ParNo; void (*Entry)(void);} SysTable []; extern unsigned long RootBeg, RootEnd, ResSecs; extern unsigned int CluSize; extern unsigned long DataStart; extern unsigned int MaxClusters; extern char Russian []; extern struct BufPool far *Cache; extern struct DevRecord Dev []; extern FILE FCBS [OPEN_MAX]; extern unsigned int CurDirClu; extern int Trace; extern int _argc; extern char far *_argv []; extern char far * far *pEnv; extern char far *hEnv; extern int curX, curY, maxX, maxY; extern char far *curAddr; extern char VideoAttrib; extern int CurrentDevice; extern int ReadOnly; extern int FATMode; extern int msdos_verbose; extern int SectorsOnCyl, FatSize, FatCnt; extern char MasterBootRecord [SECTOR_SIZE]; extern unsigned int CluSizeBytes; extern char far *OldInt; extern char far *KbdStatus; extern unsigned int MemTop; extern char Russian [256]; extern void interrupt (*OldTimerVec) (void); extern void far * Fin; extern struct DeviceStruct Devices []; extern int NextDOSDrive; extern struct processes process_table [PROC_MAX]; extern user_ss; extern user_sp; extern int emulation_mode; /* ६, 㯭 ᪨ ᮢ */ extern int errno; extern int More; extern int NLine; #define _HDD_ 0x80 #define EXTEND 5src/kernel/syscall.tbl0100664000076500007650000000605006667335156014555 0ustar prool2prool2; OS Proolix. System Calls Table ; 맮 ᫮ࠬ஢ [窠室 [ ਩]] _getch 0 _getchar 0 _getche 0 _kbhit 0 _kbhit0 _gets 2 __gets _putch 1 _putchar 1 _puts 2 _htoi 2 _htol 2 _atoi 2 _atol 2 _itoa 4 _ltoa 5 _ultoa 5 _ohs 2 _printf 50 _sprintf 50 _fprintf 50 _vsprintf 6 _vprintf 4 _clrscr 0 _inport 1 _inportb 1 _outport 2 _outportb 2 _textattr 1 _gotoxy 2 _inicom_ 0 _getcom_ 1 _putcom_ 2 _getcomstat_ 1 _getvect 1 _setvect 3 _geninterrupt 1 _end 0 _open 5 _creat 3 _read 5 _write 5 _close 1 _lseek 4 _filelength 1 _tell 1 _unlink 2 _rename 4 _dup 1 _minus dup _shutdown 0 _perror 2 _memccpy 7 _memchr 5 _memcmp 6 _memcpy 6 _memicmp 6 _memmove 6 _memset 5 _stpcpy 5 _strcat 5 _strchr 4 _strcmp 5 _strcpy 5 _strcspn 5 _strdup 3 ;_strerror 1 _stricmp 5 _strlen 2 _strlwr 2 _strncat 6 _strncmp 6 _strncpy 6 _strnicmp 6 _strnset 5 _strpbrk 5 _strrchr 4 _strrev 2 _strset 3 _strspn 5 _strstr 5 _strtok 5 _strupr 2 _tolower 1 _toupper 1 _isgraph 1 _isprint 1 _isalnum 1 _isalpha 1 _iscntrl 1 _isdigit 1 _islower 1 _ispunct 1 _isspace 1 _isupper 1 _isxdigit 1 _malloc 2 _calloc 4 _realloc 4 _free 2 _div 2 _ldiv 4 _chmod 4 __chmod 4 _access 3 _fopen 4 _freopen 6 _fdopen 3 _fileno 2 _fgetc 2 _fgets 6 __fgets _fputc 3 _fputs 4 _fread 8 _fwrite 8 _vfprintf 50 _fclose 2 _fflush 2 _ftell 2 _fseek 5 _fgetpos 4 _fsetpos 4 _rewind 2 _int86 5 _getcwd 3 _chdir 2 _opendir 2 _readdir 2 _telldir 2 _seekdir 5 _rewinddir 2 _closedir 2 _mkdir 4 _rmdir 2 _getenv 2 _stat 4 _fstat 3 _isatty 1 _qsort 8 _getftime 3 _setftime 3 _gettime 2 _getdate 2 _time 2 _ctime 2 _rand 0 _srand 1 _getcolor 0 _wherex 0 _wherey 0 _absread 7 _abswrite 7 _exit 1 _strtoul 6 _fork 0 _service 1 _exec 2 _wait 1 src/kernel/time.c0100664000076500007650000000423705733067274013503 0ustar prool2prool2#include #include #include "kernel.h" #include /*==========================================================================*/ #ifdef CMOS extern unsigned char hour, min, secund; #else extern unsigned long Tick; unsigned long trash; #endif extern unsigned char century, year, month, day, flag; /*==========================================================================*/ unsigned char unpack(unsigned char c) { return (c>>4)*10 + (c & 0xf); } /*==========================================================================*/ #ifdef CMOS void gettime (struct time far * timep) { readRTC (&hour, &min, &secund, &flag); (*timep).ti_min=unpack(min); (*timep).ti_hour=unpack(hour); (*timep).ti_sec=unpack(secund); (*timep).ti_hund=0; } /*==========================================================================*/ void getdate (struct date far * datep) { readRTCdate (¢ury, &year, &month, &day); (*datep).da_year=unpack(century)*100+unpack(year)-1980; (*datep).da_day=unpack(day); (*datep).da_mon=unpack(month); } /*==========================================================================*/ #else /*==========================================================================*/ void gettime (struct time far * timep) { ReadTick(&Tick,&flag); trash=(Tick*1000)/182; (*timep).ti_hund=trash%100; trash/=100; (*timep).ti_sec=trash%60; trash/=60; (*timep).ti_min=trash%60; (*timep).ti_hour=trash/60; } /*==========================================================================*/ void getdate (struct date far * datep) { ReadTick(&Tick,&flag); (*datep).da_year=century*100+year-1980; (*datep).da_day=day+flag; (*datep).da_mon=month; } #endif /*==========================================================================*/ time_t time (time_t far *tloc) {struct time timep; struct date datep; time_t l; gettime (&timep); getdate (&datep); l=dostounix(&datep, &timep); if (tloc!=NULL) *tloc=l; return l; } /*==========================================================================*/ #pragma warn -par char far *ctime (time_t timer) { return"Day Jan 00 99:99:99 1900\n"; } #pragma warn +par src/kernel/gets.c0100664000076500007650000000044606664343142013500 0ustar prool2prool2#include #include #include "kernel.h" /* #define DEBUG */ /****************************************************************************/ char *gets (char *s) { #include "gets.inc" } /****************************************************************************/ src/kernel/mem.c0100664000076500007650000000421006076527574013317 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ void far *memcpy(void far *dest, const void far *src, size_t n) {size_t i; void far *ret; /* if (dest==NULL) return NULL; */ /* if (src==NULL) return NULL; */ ret=dest; for (i=0;ic2) return 1; else if (c1c2) return 1; else if (c12) if (path[1]==':') path+=2; #endif if (path[0]==SLASH) path++; cc=path; while(*path++); while(--path>cc) if (*path==SLASH) break; if(path==cc) c1=cc; else c1=path+1; #ifdef MSDOS if ((cc=strchr(c1,'.'))!=NULL)*cc=0; #endif return c1; } src/kernel/strlen.c0100664000076500007650000000053206075157640014043 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ size_t strlen (const char far *s) { size_t i; /* if (s==NULL) return NULL; */ i=0; while (*s++)i++; return i; } /****************************************************************************/ src/kernel/memd.c0100664000076500007650000000340106157115430013444 0ustar prool2prool2#include #include #include "kernel.h" char cmd [MAX_LEN_STR]; void memd(void) { char far * Adr0; char far * Adr; char c; int i; char Option = 'H'; int segm, off; /* Adr0 = (char far *) 0; */ segm = 0; off = 0; Adr0 = MK_FP (segm, off); printf("End=%x:%x\nUse /? command for help\n",FP_SEG(end()),FP_OFF(end())); while (1) { printf("%4x:%4x ",FP_SEG(Adr0),FP_OFF(Adr0)); switch (Option) { case 'A': case 'M': for(i=0,Adr=Adr0;i<16;i++,Adr++) { if (*Adr>=' ') putch(*Adr); else putch('.'); printf(" "); } if (Option=='A')break; else puts(""); printf(" "); case 'H': for(i=0,Adr=Adr0;i<16;i++,Adr++){printf("%2X ",*Adr);} break; } puts(""); putch(':'); gets(cmd); i=0; while (cmd[i]) if (cmd[i]=='\r') {cmd[i]=0; break;} else i++; if (cmd[0]=='/') { switch (c=toupper(cmd[1])) { case 'R': saycsip(); break; case 'Q': puts(""); return; case 'A': case 'H': case 'M': Option=c; break; case 'S': segm=htoi(cmd+2); Adr0=MK_FP(segm, off); break; case 'O': off=htoi(cmd+2); Adr0=MK_FP(segm, off); break; case '?':puts( "Commands:\n\ /Q - Quit\n\ /A - Ascii mode\n\ /H - Hex mode\n\ /M - Mix (hex & ascii) mode\n\ /S - set Segment\n\ /O - set Offset\n\ /R - registers dump\n\ Enter - next string"); break; default: puts("Invalid command"); } printf("\n "); } else if (!cmd[0]) {off+=16; Adr0 = MK_FP(segm, off);} else ; } } src/kernel/tr.c0100664000076500007650000000017006330443226013147 0ustar prool2prool2#include "kernel.h" int TR (int curdev) { if (curdev>1) return _HDD_; /* HDD */ else return curdev; /* FDD */ } src/kernel/mv.c0100664000076500007650000000200105741033740013140 0ustar prool2prool2/*-------------------------------------------------------------------------*/ /* internal mv */ /*-------------------------------------------------------------------------*/ #include #include #include "kernel.h" void mv_help(void) { puts("Uses: mv [file1] [file2]"); } void mv(int argc, char far *argv[] ) { int ii, j, n, Files=0; char path[2][PATH_MAX]; argc--; ii=1; do { if (argc) { if (argv[ii][0]=='-') { n=(int)strlen(argv[ii]); for (j=1;j2) {mv_help(); return;} } } } while (ii++ #include #include "kernel.h" /****************************************************************************/ /* ᫥ 䬥⨪ */ /****************************************************************************/ div_t div(int number, int denom) {div_t R; R.quot=number / denom; R.rem=number % denom; return R; } /****************************************************************************/ ldiv_t ldiv(long number, long denom) {ldiv_t R; R.quot=number / denom; R.rem=number % denom; return R; } /****************************************************************************/ int system (const char far *command) { if (command==NULL) return 0; else return 1; } /****************************************************************************/ char far *getenv (const char far *name) {int i, lname; lname=(int)strlen(name); for (i=0;i #include #include "kernel.h" int CatLine; void cat (int argc, char far *argv[] ) { int h; unsigned char c, far *cc; int i, Files=0; #ifdef DEBUG printf("Cat: %s\n",argv[1]); #endif CatLine=0; cc=&c; argc--; More=1; NLine=1; i=1; do { if (argc) { Files++; if ((h=open(argv[i],O_RDONLY))==-1) { printf("Can't open %s\n",argv[i]); } while (1) { if(read(h,cc,1)<=0) break; putch(c); } close(h); } } while (i++ #include #include "kernel.h" int putch3 (int ch) { int LastRowOffset, i; switch(ch) { case 0: break; case '\n': curX=1; curY++; curAddr=MK_FP(VIDEO_SEG,maxX*(curY-1)*2); if (curY>maxY) goto scroll; break; default: *curAddr++=ch; *curAddr++=VideoAttrib; if (++curX>maxX) { curX=1; if (++curY>maxY) {scroll: curY=maxY; curAddr-=maxX*2; LastRowOffset=(maxY-1)*maxX*2; memcpy(MK_FP(VIDEO_SEG,0),MK_FP(VIDEO_SEG,maxX*2),LastRowOffset); for (i=0;i #include #include "kernel.h" void qsort (void far *base, size_t nmemb, size_t size, int (far *compar)(void far *, void far *)) {int i, Permute; void far *b1, far *b2; char far *Bolvan; if (base==NULL) return; if ((Bolvan=malloc(size))==NULL) return; do { Permute=0; for (i=0; i<(nmemb-1); i++) { if (compar(b1=(char far *)base+(int)( i *size), b2=(char far *)base+(int)((i+1)*size) )>0) { /* swap */ Permute=1; memcmp(Bolvan,b1,size); memcmp(b1,b2,size); memcmp(b2,Bolvan,size); } } } while (Permute); free(Bolvan); } src/kernel/rand.c0100664000076500007650000000400506070344604013450 0ustar prool2prool2/* rand.c - pseudorandom numbers generation */ /* rand() srand() */ /* NICE.SOURCES (2:461/35.301) Msg : 34 of 167 From : Al xCruel 2:4653/1.8 Fri 07 Apr 95 12:00 To : Jura Lobunets Subj : H! 砩 ᥫ! .MSGID: 2:4653/1.8 f85748e0 .REPLY: 2:463/212.5 2f71f91a .PID: timEd-g2+ .TID: FastEcho 1.41/g 1995 Jura Lobunets wrote in a message to All: JL> 祭 subj! , 樨 ᥢ砩 ᥫ ࢠ ⭮ 2 ⠪: - ६ ᤢ ॣ, - 뢠 ⮢ 祭, | ( 横筮) | | - 砥 ᥢ砩 ᫮ ॣ (!), | - ६ 2 ॣ 㥬 , | - ६ 1 ॣ XOR' 2 ⮬, | - ६ 0 ॣ XOR' ।騬 १⮬, | - 稢訩 ⮣ 娢 訩 ࠧࠤ ॣ, | - ᤢ ॣ, | | (横 ⢮ 権) ⢥ ⮪ - ய᪠ 樨 ⨯ 1010 0101 .. ᮮ⢥⢨ ࠧ來. ! ⠫ 㬭 㪥, ⠬ ⨭ 뫠: ----- - - - - - - - - - ------------- | N | | 2 | 1 | 0 | Shift register ----- - - - - - - - - - ------------- ^ | | | | | | | | ------- | | | ---| XOR O<-------------- | | | |<------------------ | | |<---------------------- ------- bk00l! Al XCRUEl. --- * Origin: la sagrada familia (2:4653/1.8) .PATH: 4653/1 51/2 5100/8 5020/251 144 400 461/21 35 */ static unsigned int RandomSave; int rand (void) {unsigned int reg, bit; reg=RandomSave; bit=((!(reg&4))^(reg&2))^(reg&1); reg>>=1; reg|=(bit<<15); RandomSave=reg; if (reg<0) reg=-reg; return reg; } void srand (unsigned seed) { RandomSave=seed; } src/kernel/gets.inc0100664000076500007650000000246606664341336014036 0ustar prool2prool2int i; char buf[MAX_LEN_STR]; int c; if (s==NULL) {errno=EINVAL; return NULL;} for(i=0;i'); #endif switch (c) { case '\b' : /* ERASE=8 */ if (i) { if (wherex()==0) {int y; y=wherey(); if (y!=0) y--; buf[--i]=0; gotoxy(79,y); putch(' '); gotoxy(79,y); } else { buf[--i]=0; putch('\b'); putch(' '); putch('\b'); } } else buf[i]=0; break; case EOF : case 4 : /* CTRL D */ case '\r' : /* CR */ case '\n' : /* LF */ buf[i]=0; i=MAX_LEN_STR; break; default: buf[i++]=c; } } buf[MAX_LEN_STR-1]=0; #ifdef DEBUG printf(" gets:buf=",buf); puts(buf); #endif #if 1 for (i=0;i #include #include "kernel.h" #include "signal.h" /****************************************************************************/ void null_command(void); void run_boot(int dev,int head,int sec,int trk); void start(char *cmd); /****************************************************************************/ struct internal_commands { char far *command_name; void (*command_entry) (void); } InternalCommand [] = { {"cls", clrscr}, {"clear", clrscr}, {"dev", out_devices}, {"exitw", exitw}, {"", null_command} }; /****************************************************************************/ void null_command (void) { /* null action */ return; } /****************************************************************************/ int print_exec_message(int e) { switch(e) { case 1 : printf("%Fs: not found\n",_argv[0]); break; case 2 : printf("%Fs: not executable\n",_argv[0]); break; case 3 : printf("%Fs: read error\n",_argv[0]); break; case 4 : printf("%Fs: memory fault\n",_argv[0]); break; case 5 : printf("%Fs: no mem\n",_argv[0]); default: ; case 0 : ; } return e; } /****************************************************************************/ void garbage_collection(void) { if (!garbage()) puts("\nGarbage collected"); else puts("\nNo fragmentation"); } /****************************************************************************/ static void fcbs(void) {int i, j; char c; printf( "No ---name---- flag T Beg Size D ino Seek ACl RCl ASc RSc ofset\n"); for (i=0;i1) print_exec_message(i); else printf("%s: not found or not executable\n",_argv[0]); return ; } void boot(char far *argv[]) {int d; if (shutdown()) { printf("Shutdown error!\n"); return; } d=toupper(argv[1][0])-'A'; printf("boot from %c:\n",dos_letter(d)); switch(d) { case 0: case 1: run_boot(d,0,1,0); default: if (Devices[d].sec==0) {printf("Device %c: not present\n",dos_letter(d));return;} run_boot(0x80,Devices[d].head,Devices[d].sec,Devices[d].trk); } } /***************************************************************************** sh() *****************************************************************************/ char sh_str_orig [MAX_LEN_STR]; char sh_str [MAX_LEN_STR]; void interrupt far sh (void) { int i; puts(IDENT); while(1) { /* 뢮 ᨬ-ਣ襭 shell' ப */ #ifndef DOSKEY for (i=0;i "); gets(sh_str_orig); #ifdef DEBUG printf("sh:"); printf(sh_str_orig); #endif #else printf("% "); doskey(sh_str_orig); #endif #if 0 if (!str[0]) goto shut; #endif strncpy(sh_str,sh_str_orig,MAX_LEN_STR); /* ப */ i=0; while (sh_str[i]) if (sh_str[i]=='\r') {sh_str[i]=0; break;} else i++; _argc=0; i=0; /* ய ஡ 砫 ப */ for(;(iMAX_ARG) {printf("Too many arguments"); goto l2;} for(;(i #include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ unsigned long SecForClu (unsigned int CluNo) {unsigned long l; /* Sector=ResSecs + FatCnt*FatSize + (RootSiz*32)/SectSiz + ((CluNo-2)*ClustSiz) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DataStart */ if ((CluNo>MaxClusters)||(CluNo<2)) { printf("SecForClu: Invalid cluster number. CluNo=%u, MaxClusters=%u", CluNo,MaxClusters); return -1; } l=DataStart + ( ((unsigned long)CluNo-2) * CluSize ); #ifdef DEBUG printf("sec4clu: return %li ",l); #endif return l; } src/kernel/string.c0100664000076500007650000001525006312077430014035 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ char far *strcpy (char far *dest, const char far *src) {char far *cc; /* if (dest==NULL) return NULL; */ /* if (src==NULL) return NULL; */ cc=dest; do *dest++ = *src; while (*src++); return cc; } /****************************************************************************/ char far *stpcpy (char far *dest, const char far *src) { /* if (dest==NULL) return NULL; */ /* if (src==NULL) return NULL; */ do *dest++ = *src; while (*src++); return dest-1; } /****************************************************************************/ size_t strcspn(const char far *s1, const char far *s2) { size_t i; /* if (s1==NULL) return NULL; */ /* if (s2==NULL) return NULL; */ i=0; while(*s1) { if (strchr(s2,*s1)!=NULL)break; i++; s1++; } return i; } /****************************************************************************/ char far *strcat (char far *dest, const char far *src) { char far *cc; /* if (dest==NULL) return NULL; */ /* if (src==NULL) return NULL; */ cc=dest; while(*dest++); strcpy(--dest,src); return cc; } /****************************************************************************/ int strcmp (const char far *s1, const char far *s2) {char c1,c2; /* if (s1==NULL) return 0; */ /* if (s2==NULL) return 0; */ do {c1=*s1++; c2=*s2++; if (c1>c2) return 1; else if (c1c2) return 1; else if (c1c2) return 1; else if (c1c2) return 1; else if (c1 #include #include #define MAX_STR_LEN 256 int main(int argc, char *argv[]) {FILE *fi, *fo; char s [MAX_STR_LEN]; int Status; char *cc; printf("APP - Assembler PreProcessor Version 0.0.0.0 9-Feb-95\n\ Copyright (C) by Serge Pustovoitoff, 1995. prool@infocom.kharkov.ua, 2:461/35\n\ \n"); if (argc!=3) {printf("Syntax: app input_file output_file\n"); exit(0);} fi=fopen(argv[1],"r"); if (fi==NULL) {printf("Can't open input file %s\n",argv[1]); exit(1);} fo=fopen(argv[2],"w"); if (fo==NULL) {printf("Can't open output file %s\n",argv[2]); exit(1);} Status=0; if (fputs("\tinclude\tdebug.mac\n", fo)==EOF) {printf("Can't write output file %s\n",argv[1]); goto Ex; } while(1) { s[0]=0; if (fgets(s, MAX_STR_LEN, fi)==NULL) break; switch (Status) { case 0: /* 砫쭮 ﭨ ⮬ */ if (!strcmp(s,"\tifndef\t??version\n")) {Status=1; continue; } break; case 1: /* 諨 ifndef ?? version */ if (!strcmp(s,"\tendif\n")) Status=0; continue; default: ; } /* filtr */ cc=s; if (memcmp(s,"\t?debug\t",7)==0) { switch (s[8]) { case 'S': case 'C': case 'E': case 'B': continue; case 'L': default : s[1]='\t'; cc=s+1; } } else if (memcmp(s+5,"short",5)==0) { strcpy(s+5,s+11); } if (fputs(cc, fo)==EOF) {printf("Can't write output file %s\n",argv[1]); break; } } Ex: fclose(fi); if (fclose(fo)==EOF) {printf("Can't close output file %s\n",argv[1]); exit(1);} exit(0); } src/kernel/k2.c0100664000076500007650000004364407007564464013065 0ustar prool2prool2#include #include #include "kernel.h" /* #define DEBUG */ /* #define PRINTF_DEBUG */ int NextDrive=2; /* disk C: */ void out_boot(void far *buf); /****************************************************************************/ #ifdef PRINTF_DEBUG char far *far_global_init = "far_global_init"; char far *far_global_uninit; char *near_global_init = "near_global_init"; char *near_global_uninit; char global_array_init [] = "global_array_init"; char global_array_uninit [100]; #endif #define EXTEND 5 #define EXTEND2 0xF #include "ppt.c" /****************************************************************************/ int shutdown(void) {int i; if ((i=FlushAll())!=0) puts("flush error"); return i; } /****************************************************************************/ int LinkClu (unsigned int CluNo, unsigned int NeXT) { int nsect, offset; long fat_byte_no; int b1, b2, b_next; unsigned char far *cc; unsigned int far *ii; if (CluNo>MaxClusters) {puts("LinkClu: Invalid cluster number"); return -1;} if (FATMode==FAT12) { /* FAT 12 */ /* ।塞 FAT */ fat_byte_no=(CluNo*3)/2; /* ।塞 ᥪ FAT */ nsect=(int)(fat_byte_no/SECTOR_SIZE); /* nsect-⭮⥫ ᥪ FAT. 0 - ᥪ FAT */ if (nsect>=FatSize) {puts("LinkClu: Invalid FAT's computing"); return -1;} if ( (b1=LoadCache(ResSecs+nsect)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} if (FatCnt==2) if ( (b2=LoadCache(ResSecs+nsect+FatSize)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} offset=(int)(fat_byte_no%SECTOR_SIZE); if (offset==(SECTOR_SIZE-1)) { (*(Cache+b1)).Status=2; cc=(unsigned char far *)((*(Cache+b1)).M+(SECTOR_SIZE-1)); if (CluNo&1) *cc=(unsigned char)(NeXT>>4); else {*cc&=0xf0; *cc|=(unsigned char)(NeXT>>8);} if ( (b_next=LoadCache(ResSecs+nsect+1)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} (*(Cache+b_next)).Status=2; cc=(unsigned char far *)((*(Cache+b_next)).M); if (CluNo&1) {*cc&=0x0f; *cc|=((unsigned char)(NeXT>>8))<<4;} else *cc=(unsigned char)(NeXT&0xff); if (FatCnt==2) { (*(Cache+b2)).Status=2; cc=(unsigned char far *)((*(Cache+b2)).M+(SECTOR_SIZE-1)); if (CluNo&1) *cc=(unsigned char)(NeXT>>4); else {*cc&=0xf0; *cc|=(unsigned char)(NeXT>>8);} if ( (b_next=LoadCache(ResSecs+nsect+1+FatSize)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} (*(Cache+b_next)).Status=2; cc=(unsigned char far *)((*(Cache+b_next)).M); if (CluNo&1) {*cc&=0x0f; *cc|=((unsigned char)(NeXT>>8))<<4;} else *cc=(unsigned char)(NeXT&0xff); } } else { (*(Cache+b1)).Status=2; ii=(unsigned int far *)((*(Cache+b1)).M+offset); if (CluNo&1) {*ii&=0xf; *ii|=NeXT<<4;} else {*ii&=0xf000; *ii|=NeXT&0xfff;} if (FatCnt==2) { (*(Cache+b2)).Status=2; ii=(unsigned int far *)((*(Cache+b2)).M+offset); if (CluNo&1) {*ii&=0xf; *ii|=NeXT<<4;} else {*ii&=0xf000; *ii|=NeXT&0xfff;} } } } else { /* FAT 16 */ /* ।塞 ⠡ FAT-16 */ fat_byte_no=((long)CluNo)*2; /* ।塞 ᥪ FAT */ nsect=(int)(fat_byte_no/SECTOR_SIZE); /* nsect-⭮⥫ ᥪ FAT. 0 - ᥪ FAT */ if (nsect>=FatSize) {puts("LinkClu: Invalid FAT's computing"); return -1;} if ( (b1=LoadCache(ResSecs+nsect)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} if (FatCnt==2) if ( (b2=LoadCache(ResSecs+nsect+FatSize)) == - 1 ) {puts("\nLinkClu: FAT read error"); return -1;} offset=(int)(fat_byte_no%SECTOR_SIZE); (*(Cache+b1)).Status=2; *(int far *)((*(Cache+b1)).M+offset)=NeXT; if (FatCnt==2) { (*(Cache+b2)).Status=2; *(int far *)((*(Cache+b2)).M+offset)=NeXT; } } return 0; } /****************************************************************************/ unsigned int GetFreeClu(void) {int i; /* FAT */ for(i=2;i<=MaxClusters;i++) { if (NextClu(i)==0) {/* 諨 ⮩ */ /* 頥 */ if (LinkClu(i,0xffff)!=-1) return i; else return -1; } } /* ஢ */ return -1; } /****************************************************************************/ unsigned int AppendClu(unsigned int CluNo) {unsigned int i; if (CluNo>MaxClusters) {puts("AppendClu: Invalid cluster number"); return -1;} if ((i=GetFreeClu())==0xFFFF) return 0xFFFF; /* 諨 ⮩ */ /* ନ㥬 ᫥ 楯窨 ஢ */ if (LinkClu(CluNo,i)==-1) return 0xFFFF; else return i; } /*--------------------------------------------------------------------------*/ char dos_letter(int dev) { if (dev<2) { return dev+'A'; } else { return (dev-2)/2+'C'; } } /*--------------------------------------------------------------------------*/ void print_mount(void) { if (CurrentDevice==-1) puts("No device mount"); else { printf("Mount at %i (DOS %c:)",CurrentDevice,dos_letter(CurrentDevice)); printf(" mode read"); if (ReadOnly) printf(" only"); else printf("/write"); if (emulation_mode==1) printf("\n(running under MSDOS or MSDOS-emulator (f.e. Windows 95))"); printf("\n"); } return; } /*--------------------------------------------------------------------------*/ void mount(int NewDevice) { int i; unsigned char sec, head, trk; struct MBRstru *MBR; struct BootStru far *B; char Buf [SECTOR_SIZE]; if (NewDevice==-1) { print_mount(); return; } if (CurrentDevice!=-1) #if 0 { printf("Already "); print_mount(); return; } #else { umount(); } #endif if(Cache==NULL) {puts("mount: No memory for disk cache"); return;} for(i=0;i1) { /* HDD */ if ((Devices[NewDevice].sec==0)||((FATMode=Devices[NewDevice].FileSystem)==NO_FAT)) { printf("mount: invalid device\n"); CurrentDevice=-1; return; } head=Devices[NewDevice].head; sec=Devices[NewDevice].sec; trk=Devices[NewDevice].trk; if (ReadPhysSec2 (_HDD_, sec, head, trk, Buf)) printf ("boot: partition boot sector read error\n"); #ifdef DEBUG printf("partition boot sector loaded OK\n"); #endif B = (void far *) Buf; HeadCnt=B->HeadCnt; TrkSecs=B->TrkSecs; SectorsOnCyl=HeadCnt*TrkSecs; #if 0 ResSecs=(unsigned long)Devices[NewDevice].sec+ (unsigned long)Devices[NewDevice].head*(unsigned long)TrkSecs+ (unsigned long)Devices[NewDevice].trk*SectorsOnCyl; #else ResSecs=(unsigned long)(Devices[NewDevice].sec & 0x3F)+ (unsigned long)Devices[NewDevice].head*(unsigned long)TrkSecs+ (unsigned long)(Devices[NewDevice].trk|((int)(Devices[NewDevice].sec & 0xC0)<<2))* SectorsOnCyl; #endif #ifdef DEBUG printf("ResSecs=%lu\n",ResSecs); #endif MaxSectors=Devices[NewDevice].MaxSectors+ResSecs; } else { /* FDD */ FATMode=FAT12; if (NewDevice==1) if (Devices[NewDevice].sec==0) { printf("mount: invalid device b:\n"); CurrentDevice=-1; return; } if (bootread(CurrentDevice,Buf)) { puts("mount: Boot read error"); CurrentDevice=-1; } B = (void *) Buf; if ((i=B->ResSecs)!=0) ResSecs=i; ResSecs=B->HidnSec+1; if ((i=B->TotSecs)!=0) MaxSectors=i; else MaxSectors=B->BigSect+B->HidnSec; #if 0 out_boot((void far *) Buf); #endif HeadCnt=B->HeadCnt; TrkSecs=B->TrkSecs; SectorsOnCyl=HeadCnt*TrkSecs; } if (CurrentDevice!=-1) { CluSize=B->ClustSiz; CluSizeBytes=CluSize * SECTOR_SIZE; FatSize=B->FatSize; FatCnt=B->FatCnt; #ifdef DEBUG printf("\nQ4 "); #endif RootBeg = ResSecs + B->FatCnt * B->FatSize; #ifdef DEBUG printf("\nB->SectSiz=%i ",B->SectSiz); #endif RootEnd = RootBeg + ( ( B->RootSiz * 32 ) / B->SectSiz ) - 1; #ifdef DEBUG printf(" Q4.2 "); #endif DataStart = RootEnd+1; #ifdef DEBUG printf(" Q4.3 "); #endif MaxClusters=(unsigned int)((MaxSectors-DataStart)/CluSize+1); #ifdef DEBUG printf(" Q5 "); #endif #if defined (DEBUG) /***/ printf("\nHeadCnt =%2i TrkSecs =%2i CluSize =%2i FatSize =%2i FatCnt =%1i\ RootBeg =%lu\nRootEnd =%lu ResSecs =%lu MaxSectors =%lu MaxClusters =%u", HeadCnt,TrkSecs,CluSize,FatSize,FatCnt,RootBeg,RootEnd,ResSecs, MaxSectors,MaxClusters); printf("\nboot: Cluster size = %u\n",CluSizeBytes); #endif /***/ CurDirClu=0; puts(""); } #endif /* NODISK */ #ifdef DEBUG printf(" Q6 "); #endif } /*--------------------------------------------------------------------------*/ void umount (void) {int i; shutdown(); CurrentDevice=-1; if(Cache==NULL) {puts("umount: No memory for disk cache"); return;} for(i=0;i>4); (*MB).SizePar=MemTop-CurPar; /* ஢ 뢠 */ if ((OldInt=malloc(256*4))==NULL) puts("No mem for old interrupt table"); if (OldInt!=NULL) { __cli__(); memcpy(OldInt,MK_FP(0,0),256*4); __sti__(); #ifdef DEBUG puts("\nInterrupt vectors saved"); #endif /* printf("Orig Int5=%04X:%04X\n", *(int far *)5*4,*(int far *)(5*4+2)); */ } else puts("init(): No mem"); setvect(0x0,Int0); setvect(0x3,Int3); #ifdef CHANGE_INTS initv(); setvect(0x18,done); setvect(0x19,CtrlAltDel); setvect(0x1,Int1); setvect(0x2,Int2); setvect(0x4,Int4); setvect(0x6,Int6); setvect(0x7,Int7); setvect(0x75,Int75); #endif /* #ifdef CHANGE_INT5 */ /* setvect(0x5,Int5); */ /* setvect(5, (void interrupt(*)(void))MK_FP(_Begin,FP_OFF(Int5dump))); */ /* puts("Int 5 hooked"); */ /* #endif */ curAddr=MK_FP(VIDEO_SEG,0); /* ਩ ᠭ ⨯ 㭪樨 SysCall1 ( ) */ /* setvect(INT_NO, (void interrupt(*)(void))MK_FP(_Begin,FP_OFF(SysCall1))); */ setvect(INT_NO, SysCall2); #ifdef DEBUG printf("before MSHerc\n"); #endif #if defined(_HERCULES_) && defined(_MSHERC_) if(!mshercinit()) printf("\nHercules Resident Video Support Routines. Version 1.10+Proolix"); else printf("\nHercules Video Card not present."); #endif OldTimerVec=getvect(0x8); /* setvect(0x8,Int8); */ /* setvect(0x85,Int8); */ #if CODETABLE==_RUSSIAN_ /* russification module initialization */ for (i=0;i<256;i++) Russian[i]=i; for (i='A';i<='Z';i++) Russian[i]=RussianUpper[i-'A']; for (i='a';i<='z';i++) Russian[i]=RussianLower[i-'a']; Russian['[']=''; Russian['{']=''; Russian[']']=''; Russian['}']=''; Russian[';']=''; Russian[':']=''; Russian['\'']=''; Russian['"']=''; Russian[',']=''; Russian['<']=''; Russian['.']=''; Russian['>']=''; #endif if ((hEnv=malloc(ARG_MAX))==NULL) puts("init: No mem for argv"); if ((pEnv=malloc(MAX_ENV*4))==NULL) puts("init: No mem for main env."); for (i=0; i1) ReadOnly = HDD_READ_ONLY; else ReadOnly = 0; {unsigned int seg; seg=FP_SEG((unsigned long)getvect(0x21)); printf("int 21h seg=%04X\n",seg); if (seg!=0xF000) {emulation_mode=1; i=2; /* ReadOnly=1; */ } else {emulation_mode=0;} } CurrentDevice=-1; mount(i); } /****************************************************************************/ void test_devices(void) {unsigned int i; struct MBRstru *MBR; char MBRBuf [SECTOR_SIZE]; for (i=0;i>6)+1; #ifdef DEBUG printf("disk drives number = %i\n\n",i); #endif if (i) Devices[0].sec=-1; if (i>1) Devices[1].sec=-1; if (bootread0 (_HDD_, MBRBuf)) printf ("test_devices: MBR read error\n"); #ifdef DEBUG outMBR(MBRBuf); #endif #ifdef DEBUG printf("# head sec trk ResSecs MaxSectors\n"); #endif process_partition_table (MBRBuf); }src/kernel/sayr.asm0100664000076500007650000000136206046773230014047 0ustar prool2prool2; say string locals _TEXT segment byte public 'CODE' assume cs:_TEXT sayr_proc proc ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; All registers saved ; ᪨ ० ࠡ⠥ ; ALL REGS SAVED! push ax push si PUSHF cld sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: POPF pop si pop ax ret sayr_proc endp public sayr_proc _TEXT ends end src/kernel/vec.c0100664000076500007650000000050106076535430013303 0ustar prool2prool2#include #include #include "kernel.h" void vec (int argc,char far *argv[]) {int i; if (argc==2) { i=htoi(argv[1]); OutIntVector(i); return; } else { More=2; NLine=1; for (i=0;i<256;i++) if (OutIntVector(i)==EOF) break; puts(""); More=0; NLine=1; } } src/kernel/syserr.c0100664000076500007650000000422606330442766014067 0ustar prool2prool2char *sys_errlist[] = { /* EZERO 0 */ "Error 0 - no error", /* EINVFNC 1 */ "Invalid function number", /* ENOENT 2 */ "No such file or directory", /* ENOPATH 3 */ "Path not found", /* EMFILE 4 */ "Too many open files", /* EACCES 5 */ "Permission denied", /* EBADF 6 */ "Bad file number", /* ECONTR 7 */ "Memory blocks destroyed", /* ENOMEM 8 */ "Not enough core", /* EINVMEM 9 */ "Invalid memory block address", /* EINVENV 10 */ "Invalid environment", /* EINVFMT 11 */ "Invalid format", /* EINVACC 12 */ "Invalid access code", /* EINVDAT 13 */ "Invalid data", /* 14 */ "Unknown error", /* ENODEV 15 */ "No such device", /* ECURDIR 16 */ "Attempt to remove CurDir", /* ENOTSAM 17 */ "Not same device", /* ENMFILE 18 */ "No more files", /* EINVAL 19 */ "Invalid argument", /* E2BIG 20 */ "Arg list too long", /* ENOEXEC 21 */ "Exec format error", /* EXDEV 22 */ "Cross-device link", /* 23 */ "Unknown error", /* 24 */ "Unknown error", /* 25 */ "Unknown error", /* 26 */ "Unknown error", /* 27 */ "Unknown error", /* 28 */ "Unknown error", /* 29 */ "Unknown error", /* 30 */ "Unknown error", /* 31 */ "Unknown error", /* 32 */ "Unknown error", /* EDOM 33 */ "Math argument", /* ERANGE 34 */ "Result too large", /* EEXIST 35 */ "File already exists", /* EFAULT 36 */ "Unknown error", /* EPERM 37 */ "Unknown error", /* ESRCH 38 */ "Unknown error", /* EINTR 39 */ "Unknown error", /* EIO 40 */ "Unknown error", /* ENXIO 41 */ "Unknown error", /* ECHILD 42 */ "Unknown error", /* EAGAIN 43 */ "Unknown error", /* ENOTBLK 44 */ "Unknown error", /* EBUSY 45 */ "Unknown error", /* ENOTDIR 46 */ "Unknown error", /* EISDIR 47 */ "Unknown error", /* ENFILE 48 */ "Unknown error", /* ENOTTY 49 */ "Unknown error", /* ETXTBSY 50 */ "Unknown error", /* EFBIG 51 */ "Unknown error", /* ENOSPC 52 */ "Unknown error", /* ESPIPE 53 */ "Unknown error", /* EROFS 54 */ "Unknown error", /* EMLINK 55 */ "Unknown error", /* EPIPE 56 */ "Unknown error", /* EUCLEAN 57 */ "Unknown error" }; int sys_nerr = 57; src/kernel/putch2.asm0100664000076500007650000000665206047243372014305 0ustar prool2prool2; int putch3 (int ch) .8086 jumps _TEXT segment byte public 'CODE' assume cs:_TEXT VIDEO_SEG equ 0B800H _curX dw 1 _curY dw 1 _maxX dw 80 _maxY dw 25 _curAddr dd 0 _VideoAttrib db 7 _LastRowOffset dw 0 _putch2 proc near push bp mov bp,sp ; SAVE ALL REGS push ax push bx push cx push dx push si push di PUSHF ; byte ptr [bp+4] - argument # 1 ;int LastRowOffset, i; cld ;switch(ch) ; { ; case 0 : break; mov ax,word ptr [bp+4] or ax,ax jz l_break ; case '\r': break; cmp ax,13 je l_break ; case '\n': curX=1; cmp ax,10 ; '\n' jne l_default mov _curX,1 ; curY++; inc _curY ; curAddr=MK_FP(VIDEO_SEG,maxX*(curY-1)*2); mov word ptr _curAddr+2,VIDEO_SEG mov ax,_curY dec ax shl ax,1 mul _maxX mov word ptr _curAddr,ax ; if (curY>maxY) goto scroll; mov ax,_curY cmp ax,_maxY ; jg l_scroll ; break; jmp l_break ; default : *curAddr++=ch; l_default: les di,_curAddr stosb ; *curAddr++=VideoAttrib; mov al,_VideoAttrib stosb add word ptr _curAddr,2 ; if (++curX>maxX) mov ax,_curX inc ax mov _curX,ax cmp ax,_maxX jle l_1 ; { ; curX=1; mov _curX,1 ; if (++curY>maxY) mov ax,_curY inc ax mov _curY,ax cmp ax,_maxY JMP l_2 ;;;;;;;;;;;;;;;;;;;; jle l_2 ; {scroll: l_scroll: ; curY=maxY; mov ax,_maxY mov _curY,ax ; curAddr-=maxX*2; mov ax,word ptr _curAddr mov bx,_maxX shl bx,1 sub ax,bx mov word ptr _curAddr,ax ; LastRowOffset=(maxY-1)*maxX*2; mov ax,_maxY dec ax mul _maxX shl ax,1 mov cx,ax mov _LastRowOffset,ax ; memcpy(MK_FP(VIDEO_SEG,0),MK_FP(VIDEO_SEG,maxX*2),LastRowOffset); push DS mov ax,VIDEO_SEG mov DS,ax mov ES,ax mov si,_maxX shl si,1 xor di,di rep movsb ; DS:SI -> ES:DI pop DS ; for (i=0;i #include #include "kernel.h" /****************************************************************************/ char far *strchr (const char far *str, int c) { /* if (str==NULL) return NULL; */ while (*str) if (*str==c) return (char far *) str; else str++; return NULL; } /****************************************************************************/ src/kernel/dos.c0100664000076500007650000000161105710520052013302 0ustar prool2prool2#include #include #include #include "kernel.h" /****************************************************************************/ int int86 (int intno, union REGS far *inregs, union REGS far *outregs) {int i; i=(*inregs).x.ax; /* mov bx,word ptr [bp+6] mov ax,word ptr [bx] mov word ptr [bp-2],ax */ i=(*inregs).x.bx; /* mov bx,word ptr [bp+6] mov ax,word ptr [bx+2] mov word ptr [bp-2],ax */ i=(*inregs).h.al; /* mov bx,word ptr [bp+6] mov al,byte ptr [bx] mov ah,0 mov word ptr [bp-2],ax */ } /****************************************************************************/ /* int int86x (int intno, union REGS *inregs, union REGS *outregs, struct SREGS *segregs) { } */ src/kernel/de.c0100664000076500007650000000264106272502154013120 0ustar prool2prool2/*-------------------------------------------------------------------------*/ /* internal disk edit */ /*-------------------------------------------------------------------------*/ #include #include #include "kernel.h" void de (void) { unsigned int n; char str[MAX_LEN_STR]; puts("Proolix Disk Editor by Serge Pustovoitoff\n\n\ The Disk Editor is currently in Read-Only mode"); printf("0 - boot sector\n1 -%i - FAT\n%i-%i - root dir\n%i-%i - data area\n", RootBeg-1,RootBeg,DataStart-1,DataStart,MaxSectors-1); while(1) {int line, adr, b; More=1; NLine=1; printf("Sector no > "); gets(str); *strchr(str,'\r')=0; if (!str[0]) break; n=atoi(str); printf("Sector no %i",n); if (n==0) puts(", boot sector"); else if (n=' ') putch(c); else putch (' '); } puts(""); adr+=16; } More=0; NLine=1; } /* */ } puts(""); ret:return; } src/kernel/pklite.exe0100664000076500007650000003676604547516600014402 0ustar prool2prool2MZ nRPKLITE Copr. 1990-91 PKWARE Inc. All Rights ReservedU=;r ! Not enough memory$JWWRIt«_wF %hE> Nw&6ť1r"MZ $8;OU|#GN(ð+#Jő:=_8O(F@ ]t$Gۊ]00Pɷ}',F?a`!`&{B49\$NW^dmUz"Q4(X\a_9*w[dϚ0!/\u " U*' *e\zM =n[0|1C]1ٰ ? Aʦ=Ƽ4қ 0\}J^}B2JR @;h :$X+®;f .%-t& &&&W0r )逮$s Q3~QyD5gHB18 (LwRFp܈C4<6 4P4G)vO' '(^ڝJ^3CDwV`"5$@h -[ }cUʖAZFo) " HTT1Ny"@;A$9/..K ..cd P(H|*itP@NύM5-R+T IϢ\_>YpGip Y4 Tzr{]֭d"za4yXn±&3 rjMPP8 / 43.(n% -VTo8aPxN`g l?ɤj#9x{/ NP.$C4  bNR% q&?T|.<Fpx Ԁ ?GK H o bNo Q0PX-%xd;fؼ^LW`,|/uDRd'즅} m@'Lx+5 s@Dx F\ªlH I;݄ن ׵<'!L]YJXf5? OD {b {#?   ~ރ H hnz[Ѡ|. d)ge+JFw| Vd}B(-إN*B/#Bv"c0el&S] Od0̍5w >ɍe$t w F 'k/\(L,R(z/< q6 ~   5q* [hP_A1O Ɯi к5 \( ~7Zj,n{_5[%!†ņF ~8AD*k?-(k.B) +b=0C@t2@/D) Q)}@UVz <.)gF"1IaT"xfAp^`aaDT!0Rx &KP.?`XzO_(KKFE I,c Ju/Mt)#M,譇A -N`! ?'w z(  ٗ8nj8J6*'D"&K9]I"z@VJNh k%bqi& +ꟙ=  {,z)/%&$ca8$|,(**@p^, A vUc8xJo|1ँN$ v#yHY~  %GB<$bNy2Dk6dC w53y-NN4yOL [p!FF0̞?&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V p2?h #깕 n~H:|HחgY0 RE=g9M!N~3c ;YQ>Tsla'N*}#rHkFK6~FpWAcTT\ EV8l/cִ'uwwdVB?99?o ,̪Uz9Kb߶;+fn2և&;>8cZ ^n9d$Xac@:n{^ڤ%p\;@b% +Q/>|'avB@R'U]>gcncU .&ǒȺ2&PjU3@3 3rvS dX%y N&X_ϽBn _pn %5&Ocp7nɱ1~ҧfw^KJBW+طjp#9a{<+սdM)Ϙ} H,Hy=rm>.l/[p\r,h3"4( *KA>ilZ/(g|io:k/u5i)[ۀ|H#y8*!Vx 1'CSyZOG"T/g=@^Ƌg? # Dxщ+K0?/ZN/ 7|* $9qlN݅).DJhdDiM:-A1|94`3\niě DO\pv{0x>aN$ȡcq %>$sC~]I{ 8OL[Su+Fha.LdM).eYe.B޿3!e#?S2Y`87bS{Y E陴m-z;9 smi-5w6հ}Y%48v//ֶֻ}OEZ*6t*|noQu9t !n nw[&]X5^e]ATdW@WapJTqs-A)ňr~  CY/XҰ9x0F?cz2D# JƯYSFb:Tdܯ1Eթr*2|$Y.*:p΄(x;Jǐq260,q~ARǮM?U/of֫\tcE/oa拷 M4\)`ٶUH:FjǡI 2bb15Q & ^ZG\DH\JQDBME4 I#0    !kц&0+`U65FJUB:=X ]8= )#quqle-c}o{nkirGX;ko dji*maqoaa#`x03f!6!gec({H#bl..{gikv;.sͻ|xb&~`pv]$<E>Exc`j!{eqIwqQ x\5xjA#raL;WF- GHGDG@G<!CzTfTnTr---CT,src/kernel/e.c0100664000076500007650000000106005741035064012747 0ustar prool2prool2#include #include #include "kernel.h" #define Prec 2 #define Zero 0 /*----------------------------------------------------------------------------*/ /* E M A I N */ /*----------------------------------------------------------------------------*/ void e(int argc, char far*argv[]) { int i; printf("argc = %i\nProg name = %s\n",argc,argv[0]); argc += 1; for (i=0; i #include #include "kernel.h" #include #include /****************************************************************************/ #define CheckUserWriteDir /* #define DEBUG */ /****************************************************************************/ int FlushBuf(unsigned int i) { if ((*(Cache+i)).Status==2) { #if 0 printf(" w"); #endif if (abswrite(TR(CurrentDevice),1,(*(Cache+i)).Sec,(*(Cache+i)).M)) { printf("\nFlushBuf: abswrite error on sector %i\n",(*(Cache+i)).Sec); return -1; } else { (*(Cache+i)).Status=1; } } return 0; } /****************************************************************************/ int FlushAll(void) {int i, err; err=0; for (i=0;imax) { max=(*(Cache+i)).Counter; maxbuf=i; } /* 諨 */ i=maxbuf; if (FlushBuf(i)) return -1; Fill: /* ᯨ뢠 ᥪ ﬨ */ (*(Cache+i)).Status=2; for (j=0;jmax) { max=(*(Cache+i)).Counter; maxbuf=i; } /* 諨 */ i=maxbuf; if (FlushBuf(i)) return -1; Load: if (absread(TR(CurrentDevice), 1, sec, (*(Cache+i)).M )) { printf("\nLoadCache: absread error on sector %i\n",sec); (*(Cache+i)).Status=0; return -1; } (*(Cache+i)).Status=1; (*(Cache+i)).Sec=sec; TouchCache(i); return i; } struct dirent Bolvan; /****************************************************************************/ int open2 (int h, const char far *path, int flag) {int i, j, Search, File, DevNo, SaveCur; struct dirent far *D; struct time timep; struct date datep; DIR far *dir; char far *cc; char far *cc0; const char far *name; char path0 [PATH_MAX+1]; struct dirent *pBolvan; pBolvan=&Bolvan; /* ᯥ樠 䠩 ? */ i=0; File=1; if (!memcmp(path,"/dev/",5)) { do { if (!strcmp(path+5,Dev[i++].Name)) {File=0; DevNo=i; break;} } while (Dev[i].Name[0]); } if (!File) FCBS[h].File=0; else FCBS[h].File=1; /* path ᮡ⢥-path (path0) name */ strncpy(path0,path,PATH_MAX); path0[PATH_MAX]=0; #if 0 /* ᫨ path0 ᫥ ᨬ '/', , ᨬ */ i=strlen(path0); if (i-->1) if (path0[i]=='/') path0[i]=0; #endif cc=path0; cc0=NULL; while ((cc=strchr(cc,'/'))!=NULL) cc0=cc++; if (cc0==NULL) { /* path ᨬ '/', 砥, 쭮 ( ) */ path0[0]=0; name=path; } else { /* path ᮤন ࠩ ᨬ '/', ⥬. (" ⥬" ;) */ /* ⥪騩 ⠫ */ SaveCur=CurDirClu; if (cc0==path0) {/* ᨬ '/' ⢥ ( "/file") */ name=path0+1; /* ⥪騬 ⠫ "/" */ if (chdir("/")==-1) { #ifdef DEBUG printf("L1"); #endif errno=ENOENT; goto ret_err; } } else { *cc0++=0; name=cc0; /* ⥪騬 ⠫ path0 */ if (chdir(path0)==-1) { #ifdef DEBUG printf("L2"); #endif errno=ENOENT; goto ret_err; } } } /* ᫨ 뢠 䠩 "/" ⥪饬 ୥ ⠫ 뢠 "." "..", , 뢠 root dir */ if ( ( strcmp(path,"/")==0 ) || ( (CurDirClu==0) && ( (!strcmp(name,"."))||(!strcmp(name,"..")) ) ) ) {/* open (rootdir) */ FCBS[h].File=3; #ifdef CheckUserWriteDir if (((flag&O_WRONLY)||(flag&O_RDWR)) && Mode) {errno=EACCES; goto ret_err;} #endif strcpy(FCBS[h].Name,"/"); FCBS[h].BegClu=0; FCBS[h].Attr.B.Dir=1; FCBS[h].flag=flag; FCBS[h].Size=-1; FCBS[h].AbsOffset=0l; FCBS[h].AbsSec=RootBeg; goto ret_norm; } if (!strcmp(name,".")) /* 䠩 "." (⥪騩 ⠫) 뢠 ᯥ樠 ᯮᮡ, ᯮ짮 ࠭饩 ⥬ ଠ樨 ⥪饬 ⠫ (६ CurDirClu) */ {/* open (curdir) */ FCBS[h].File=2; #ifdef CheckUserWriteDir if (((flag&O_WRONLY)||(flag&O_RDWR)) && Mode) { errno=EACCES; return -1; } #endif strcpy(FCBS[h].Name,name); FCBS[h].BegClu=CurDirClu; FCBS[h].Attr.B.Dir=1; FCBS[h].DirInode=-1; FCBS[h].flag=flag; FCBS[h].Size=-1; FCBS[h].AbsOffset=0l; FCBS[h].AbsSec=SecForClu(CurDirClu); FCBS[h].AbsClu=CurDirClu; goto ret_norm; } if (File!=0) {/* file or dir */ /* 饬 䠩 (or dir) ⠫ */ PathToDir(name, pBolvan); #ifdef DEBUG printf("open2: `%Fs'->",name); printf("`%s' ",Bolvan.d_name); #endif if ((dir=opendir("."))==NULL) {puts("open: can't search in current dir"); errno=EFAULT; goto ret_err;} while(1) { if ((D=readdir(dir))==NULL) break; if ( (*D).d_name[0]==0 ) continue; if ( (*D).d_name[0]==0xe5 ) continue; if ( (*D).Attr.B.Label ) continue; #ifdef DEBUG /* printf("open2: d1=`%s' d2=`%s' ",(*D).d_name,Bolvan.d_name); */ #endif if (dircmp((*D),Bolvan)==0) {Search=1; FCBS[h].DirInode=CurDirClu; FCBS[h].DirSeekPos=telldir(dir)-32; goto l_cont; } } Search=0; l_cont: if (closedir(dir)==-1) goto ret_err; if (Search) { if ((flag&O_EXCL)&&(flag&O_CREAT)) {errno=EEXIST; goto ret_err;} FCBS[h].Attr.U=(*D).Attr.U; if ((*D).Attr.B.Dir) {/* found dir */ #ifdef CheckUserWriteDir if (((flag&O_WRONLY)||(flag&O_RDWR)) && User) {errno=EACCES; goto ret_err;} #endif FCBS[h].File=2; FCBS[h].Size=-1; } else {/* found ordinary (regular) file (not directory) */ if (flag&O_TRUNC) { /* truncate */ if ((i=(*D).d_fileno)!=0) while(1) { j=NextClu(i); if(LinkClu(i,0)==-1) {errno=EFAULT; goto ret_err;}; if (j==-1) break; else i=j; } (*D).Size=0; (*D).d_fileno=0; #if 0 if ((dir=openwdir("."))==NULL) {puts("open: can't search in current dir"); errno=EFAULT; goto ret_err;} if (seekdir(dir,FCBS[h].DirSeekPos,SEEK_SET)==-1) goto ret_err; if (writedir(dir,D)==-1) goto ret_err; if (closedir(dir)==-1) goto ret_err; #endif } FCBS[h].Size=(*D).Size; } FCBS[h].flag=flag; FCBS[h].FileDateTime.ft_hour =(*D).FileDateTime.ft_hour; FCBS[h].FileDateTime.ft_min =(*D).FileDateTime.ft_min ; FCBS[h].FileDateTime.ft_tsec =(*D).FileDateTime.ft_tsec ; FCBS[h].FileDateTime.ft_day =(*D).FileDateTime.ft_day ; FCBS[h].FileDateTime.ft_month=(*D).FileDateTime.ft_month; FCBS[h].FileDateTime.ft_year =(*D).FileDateTime.ft_year ; if ((FCBS[h].BegClu=(*D).d_fileno)==0) { FCBS[h].AbsSec=RootBeg; FCBS[h].File=3; } else { FCBS[h].AbsClu=FCBS[h].BegClu; FCBS[h].AbsSec=SecForClu(FCBS[h].AbsClu); } FCBS[h].AbsOffset=0l; } else { /* File not exist*/ if (flag&O_RDONLY) { #ifdef DEBUG printf("L3"); #endif errno=ENOENT; goto ret_err; } /* Creating */ /* 饬 ᢮ 室 ⠫ */ if ((dir=openwdir("."))==NULL) {puts("open: can't search in current dir"); errno=EFAULT; goto ret_err;} while(1) { if ((D=(void far *)readdir(dir))==NULL) break; if (!(*D).d_name[0] || ((*D).d_name[0]==0xe5)) {/* 諨 . 室 ⠫ */ /* ᮧ 䠩 */ /* 塞 FCB */ FCBS[h].DirInode=CurDirClu; if ((FCBS[h].DirSeekPos=seekdir(dir,-32l,SEEK_CUR))==-1) printf("open: can't seek cur dir"); (*D).Attr.U=FA_ARCH; PathToDir(name,D); gettime (&timep); (*D).FileDateTime.ft_tsec=timep.ti_sec*2; (*D).FileDateTime.ft_min =timep.ti_min; (*D).FileDateTime.ft_hour=timep.ti_hour; getdate(&datep); (*D).FileDateTime.ft_day =datep.da_day; (*D).FileDateTime.ft_month=datep.da_mon; (*D).FileDateTime.ft_year =datep.da_year; (*D).d_fileno=0; (*D).Size=0; /* 塞 FCB */ FCBS[h].Attr.U =(*D).Attr.U; FCBS[h].flag=flag; FCBS[h].FileDateTime.ft_hour =(*D).FileDateTime.ft_hour; FCBS[h].FileDateTime.ft_min =(*D).FileDateTime.ft_min ; FCBS[h].FileDateTime.ft_tsec =(*D).FileDateTime.ft_tsec ; FCBS[h].FileDateTime.ft_day =(*D).FileDateTime.ft_day ; FCBS[h].FileDateTime.ft_month=(*D).FileDateTime.ft_month; FCBS[h].FileDateTime.ft_year =(*D).FileDateTime.ft_year ; FCBS[h].BegClu=(*D).d_fileno; FCBS[h].Size=(*D).Size; FCBS[h].AbsOffset=0l; FCBS[h].AbsClu=FCBS[h].BegClu; FCBS[h].AbsSec=0; if (writedir(dir, D)==0) { closedir(dir); goto ret_norm; } else goto L1; } } L1: /* . 室 :( */ closedir(dir); errno=ENOSPC; goto ret_err; } /* file not exist. creating */ } /* file */ else { /* dev */ /* DRIVER /dev/?????????? */ /* FCBS[h].Major=Dev[DevNo].Major; FCBS[h].Minor=Dev[DevNo].Minor; */ FCBS[h].Size=-1; if (!Dev[DevNo].Byte) { FCBS[h].AbsOffset=0l; FCBS[h].AbsSec=0; } } /* dev */ ret_norm: errno=0; /* ᫨ 室, ⠭ ० ⥪騩 ⠫ */ if (path0[0]) CurDirClu=SaveCur; return h; ret_err: FCBS[h].Name[0]=0; /* ᫨ 室, ⠭ ० ⥪騩 ⠫ */ if (path0[0]) CurDirClu=SaveCur; return -1; } /****************************************************************************/ int open (const char far *path, int flag,...) {int h, k; /* 䫠 ॠ O_RDONLY O_WRONLY O_RDWR O_CREAT /* create and open file */ O_TRUNC /* open with truncation */ O_EXCL /* exclusive open */ O_APPEND /* to end of file */ 䫠 ॠ? O_NOINHERIT O_DENYALL O_DENYWRITE O_DENYREAD O_DENYNONE */ /* ஢塞 䫠 ४⭮ */ /* ஢塞 易⥫ 䫠 ⢨ */ if (!((O_RDONLY|O_WRONLY|O_RDWR) & flag)) goto L_INVAL; /* ஢塞 䫠 ᮢ⨬ ⠭ */ if ((flag&O_RDONLY)&&((flag&O_WRONLY)||(flag&O_RDWR))) goto L_INVAL; if ((flag&O_RDWR)&&((flag&O_WRONLY))) goto L_INVAL; if ((flag&O_TRUNC)&&((flag&O_RDONLY))) goto L_INVAL; h=-1; if (path==NULL) { goto L_INVAL; } if (*path==0) { L_INVAL: #ifdef DEBUG printf("L4"); #endif errno=ENOENT; return -1; } /* ( ) ᤥ ࠢ 뢠 䠩 㦥 묨 . 䠩 ⥬ */ /* for(k=0;kOPEN_MAX)) {errno=EBADF; return -1;} if (ftimep==NULL) {errno=EINVAL; return -1;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1;} (*ftimep).ft_hour = FCBS[h].FileDateTime.ft_hour ; (*ftimep).ft_min = FCBS[h].FileDateTime.ft_min ; (*ftimep).ft_tsec = FCBS[h].FileDateTime.ft_tsec ; (*ftimep).ft_day = FCBS[h].FileDateTime.ft_day ; (*ftimep).ft_month= FCBS[h].FileDateTime.ft_month ; (*ftimep).ft_year = FCBS[h].FileDateTime.ft_year ; return 0; } /****************************************************************************/ int setftime (int h, struct ftime far *ftimep) {DIR far *fp; struct dirent far *D; if ((h<0)||(h>OPEN_MAX)) {errno=EBADF; return -1;} if (ftimep==NULL) {errno=EINVAL; return -1;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1;} if ( (FCBS[h].flag & O_WRONLY) || (FCBS[h].flag & O_RDWR) ) { if ((fp=openidir(FCBS[h].DirInode))==NULL) return -1; if (seekdir(fp,FCBS[h].DirSeekPos,SEEK_SET)==-1) return -1; if ((D=readdir(fp))==NULL) return -1; if (seekdir(fp,FCBS[h].DirSeekPos,SEEK_SET)==-1) return -1; (*D).FileDateTime.ft_hour = (*ftimep).ft_hour ; (*D).FileDateTime.ft_min = (*ftimep).ft_min ; (*D).FileDateTime.ft_tsec = (*ftimep).ft_tsec ; (*D).FileDateTime.ft_day = (*ftimep).ft_day ; (*D).FileDateTime.ft_month = (*ftimep).ft_month ; (*D).FileDateTime.ft_year = (*ftimep).ft_year ; FCBS[h].FileDateTime.ft_hour = (*ftimep).ft_hour ; FCBS[h].FileDateTime.ft_min = (*ftimep).ft_min ; FCBS[h].FileDateTime.ft_tsec = (*ftimep).ft_tsec ; FCBS[h].FileDateTime.ft_day = (*ftimep).ft_day ; FCBS[h].FileDateTime.ft_month = (*ftimep).ft_month; FCBS[h].FileDateTime.ft_year = (*ftimep).ft_year ; if (writedir(fp,D)==-1) return -1; return closedir(fp); } else { errno=EPERM; } return -1; } /****************************************************************************/ int chmod(const char far *filename, int amode) {int h; h=amode; if ((h=open(filename,O_RDONLY))==-1) return -1; else close(h); return 0; } /****************************************************************************/ int _chmod(const char far *filename, int func, ...) {int h; int attribute; va_list v; /* func: 0 - read attr, 1 - set attr. attr see in */ if ((h=open(filename,func?O_WRONLY:O_RDONLY))==-1) return -1; if (func==1) { /* 㭪 1 - ⠭ ਡ 䠩 */ int Label; int Dir; int Attr1; va_start(v,0); attribute = va_arg(v,int); /* ࠭塞 塞 ਡ */ Label=FCBS[h].Attr.B.Label; Dir =FCBS[h].Attr.B.Dir ; Attr1=FCBS[h].Attr.B.Attr1; /* ⠭ ਡ */ FCBS[h].Attr.U = attribute; /* ⠭ 塞 ਡ */ FCBS[h].Attr.B.Label=Label; FCBS[h].Attr.B.Dir =Dir ; FCBS[h].Attr.B.Attr1=Attr1; } else {/* 㭪 0 - ਡ 䠩 */ attribute=FCBS[h].Attr.U; } if (close(h)==-1) return -1; return attribute; } /****************************************************************************/ int access(const char far *filename, int amode) {int flag, h; if (amode==2) flag=O_WRONLY; else flag=O_RDONLY; if((h=open(filename,flag))==-1) return -1; else if(close(h)==-1) return -1; return 0; } /****************************************************************************/ long int read(int h, void far *buf, unsigned long len) { int i, b; long l; char c; if ((h<0)||(h>OPEN_MAX)) {errno=EBADF; return -1;} if (buf==NULL) {errno=EINVAL; return -1;} if (len==0) {errno=0; return 0;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1;} if (FCBS[h].flag & O_WRONLY) {errno=EACCES; return -1;} if (h==0) if (FCBS[h].File==0) { for(i=0;i FCBS[h].Size) if ((len=FCBS[h].Size-FCBS[h].AbsOffset)==0) {errno=0; return 0; } if ((b=LoadCache(FCBS[h].AbsSec))==-1) {errno=EFAULT; return -1; } SecOffset=(int)(FCBS[h].AbsOffset % SECTOR_SIZE); for (i=0;iOPEN_MAX)) {errno=EBADF; return -1;} if (buf==NULL) {errno=EINVAL; return -1;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1;} if (FCBS[h].flag & O_RDONLY) {errno=EACCES; return -1;} if (len==0) {errno=0; return 0;} if((h>=0)&&(h<=2)) if (FCBS[h].File==0) { for(l=0;lOPEN_MAX)) {errno=EBADF; return -1;} else { if (FCBS[h].Name[0]) { if ( (FCBS[h].File==1) || (FCBS[h].File==2) ) { if ((FCBS[h].flag&O_WRONLY)||(FCBS[h].flag&O_RDWR)) { if ((i=FCBS[h].DirInode)!=-1) { if ((fp=openidir(i))==NULL) return -1; if (seekdir(fp,FCBS[h].DirSeekPos,SEEK_SET)==-1) return -1; if ((D=readdir(fp))==NULL) return -1; if ((*D).d_fileno!=FCBS[h].BegClu) {Update=1; (*D).d_fileno=FCBS[h].BegClu;} if (FCBS[h].File==1) if ((*D).SizeOPEN_MAX)) {errno=EBADF; return -1;} if(FCBS[h].Name[0]) return FCBS[h].Size; else return -1; } /****************************************************************************/ long tell(int h) { if ((h<0)||(h>OPEN_MAX)) {errno=EBADF; return -1L;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1L;} return FCBS[h].AbsOffset; } /****************************************************************************/ long lseek(int h, long offset, int fromwhere) {int i; long j, n; if ((h<0)||(h>OPEN_MAX)) {errno=EBADF; return -1L;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1L;} switch (fromwhere) { case SEEK_SET: if (offset<0) {errno=EINVAL; return -1L;} /* offset>=0 */ /* ⠭ 䠩 砫 (rewind) */ FCBS[h].AbsOffset=0l; if ((FCBS[h].File==1)||(FCBS[h].File==2)) /* file or directory */ { FCBS[h].AbsClu=FCBS[h].BegClu; FCBS[h].AbsSec=SecForClu(FCBS[h].AbsClu); } else if (FCBS[h].File==3) /* root dir */ FCBS[h].AbsSec=RootBeg; /* ᫥ ⮣ ᪠ ᫥騩 㭪 case 믮 , */ case SEEK_CUR: if (offset==0) return FCBS[h].AbsOffset; if (offset>0) {char buf[SECTOR_SIZE]; for (i=0; i int service(int fn) { switch (fn) { case 1: ps_(); } return 0; } src/kernel/msh.h0100664000076500007650000000120305535646522013326 0ustar prool2prool2#define MenuColumn 68 struct DeskTop { int x; int y; char Name [13]; }; struct DeskTop Folder [MAX_LINE]; struct DeskTop Desk [ ] = { {MenuColumn, 4," [Click] "}, {MenuColumn, 5," [Exec] "}, {MenuColumn, 6," [Attr] "}, {MenuColumn, 7," [Cls] "}, {MenuColumn, 8," [Mem] "}, {MenuColumn, 9," [Ls -l] "}, {MenuColumn,10," [Help] "}, {MenuColumn,11," [Echo] "}, {MenuColumn,12," [Vectors] "}, {MenuColumn,13," [Ladder] "}, {MenuColumn,14," [Reboot] "}, {MenuColumn,15," [Int 0] "}, {MenuColumn,16," [Int 18h] "}, {MenuColumn,17," [Int 19h] "}, {MenuColumn,18," [Com Addr] "}, {-1,-1,""} }; int DeskNo; src/kernel/vexe.c0100664000076500007650000000117706120312376013477 0ustar prool2prool2#include #include #include #include "viewexe.c" #define BUFLEN 512 void ident (void) { printf("View EXE ver. 0.0.0.1 9-Mar-96 (c) by Prool\n\n"); } void main (int argc, char *argv[]) {char buf [BUFLEN]; int h, i; if (argc!=2) { ident(); printf("usage: vexe filename"); } else { if ((h=open(argv[1],O_RDONLY | O_BINARY))==-1) printf("Can't open %s\n",argv[1]); if ((i=read(h,buf,BUFLEN))!=BUFLEN) printf("Can't read %s. read()=%i\n",argv[1],i); close(h); printf("File %s\n\n",argv[1]); ViewEXE((void *)buf); printf("\n\n"); ident(); } } src/kernel/ls.c0100664000076500007650000000750406231010314013134 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ void l_help(void) { puts("Uses: l [-l] [-L] [-U] [-H] [-F] [-T] [-M]\n\n\ Switches:\n\n\ -l - long info\n\ -L - very long info\n\ -U - list unused dir records\n\ -H - hex output (default - dec output)\n\ -F - free space\n\ -T - title\n\ -M - more"); } /****************************************************************************/ void OutAttr(struct AttrField far *Attr) { if ((*Attr).Attr1) putch('*'); else putch('.'); if ((*Attr).Attr2) putch('*'); else putch('.'); if ((*Attr).Archive) putch('A'); else putch('.'); if ((*Attr).Dir) putch('D'); else putch('.'); if ((*Attr).Label) putch('L'); else putch('.'); if ((*Attr).System) putch('S'); else putch('.'); if ((*Attr).Hidden) putch('H'); else putch('.'); if ((*Attr).ReadOnly) putch('R'); else putch('.'); } /****************************************************************************/ void OutTimeDate(struct ftime far *t) { printf("%2i:%02i:%02i %2i-%02i-%02i", (*t).ft_hour, (*t).ft_min, (*t).ft_tsec*2, (*t).ft_day, (*t).ft_month,1980+(*t).ft_year); } /****************************************************************************/ int l (int argc, char far *argv[]) {int i, j, k, n; struct dirent far *D; char Path [NAME_MAX+1]; int FlagL=0; int FlagU=0; int FlagLL=0; int FlagH=0; int FlagF=0; int FlagT=0; unsigned long size; unsigned long SumSize=0; unsigned long Total; DIR far *dir; argc--; i=1; do { if (argc) { if (argv[i][0]=='-') { n=(int)strlen(argv[i]); for (j=1;j\n")==EOF) goto l_ret; continue; } printf("%-13s",DirToPath(D,Path)); SumSize+=(size=(*D).Size); if (!FlagL) {if (puts("")==EOF) goto l_ret; continue; } else { OutAttr(&((*D).Attr.B)); if (FlagLL) {putch(' '); for (k=0;k<10;k++)printf("%2X",(*D).Reserv[k]); } putch(' '); OutTimeDate(&((*D).FileDateTime)); printf(FlagH?" %4X":" %5u",(*D).d_fileno); if (printf(FlagH?" %8lX\n":" %8lu\n",size)==EOF) goto l_ret; } } l_ret: if (closedir(dir)==EOF) perror("l: closedir"); if (FlagF) { Total=(MaxSectors - (unsigned long)DataStart) * (unsigned long)SECTOR_SIZE; printf("Total drive size %li\n",Total); printf("Total allocated %li\n",SumSize); printf("Free %li\n",Total-SumSize); } More=0; NLine=1; return 0; } src/kernel/minus.c0100664000076500007650000000014506304067562013665 0ustar prool2prool2#include #include #include "kernel.h" int minus(void) { return -1; } src/kernel/ctype.c0100664000076500007650000000274306075156024013661 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ int isgraph(int c) { return ((c) >= 0x21 && (c) <= 0x7e); } /****************************************************************************/ int isprint(int c) { return ((c) >= 0x20 && (c) <= 0x7e); } /****************************************************************************/ int isalnum (int c) {return isdigit(c)||isalpha(c);} int isalpha (int c) {return islower(c)||isupper(c);} int iscntrl (int c) {return c<' ';} int isdigit (int c) {return (c>='0')&&(c<='9');} int islower (int c) {return (c>='a')&&(c<='z');} int ispunct (int c) { switch(c) { /* (C) ᮪ ᨬ 㭪樨 ணࠬ Connect .૮ . Copyright by KHEMZ, Inc. 1991, 1994 */ case '.': case ',': case '!': case '"': case '\'': case '(': case ')': case '*': case '+': case '-': case '/': case ':': case ';': case '<': case '=': case '>': case '?': case '[': case '\\': case ']': case '^': case '{': case '|': case '}': case '~': return 1; default: return 0; } } /****************************************************************************/ int isspace (int c) {if ((c==' ')||(c=='\t')) return 1; else return 0;} int isupper (int c) {return (c>='A')&&(c<='Z');} int isxdigit(int c) {return ((c>='0')&&(c<='9'))||((c>='a')&&(c<='f'))||((c>='A')&&(c<='F'));} src/kernel/tlib.cmd0100664000076500007650000000140007007553004013770 0ustar prool2prool2kernel/C/E-+stdlib-+ctype-+strchr-+strdup-+string-+strlen-+tolower-+cluread-+nextclu-+sec4clu-+readsec2-+out_mbr-+out_dev-+k2-+int8-+ints-+int0-+ints5-+minus-+nulldev-+setjmp-+out_os-+tr-+videopag-+strtoul-+service-+int1b-+exitw & -+memd-+absread-+abswrite-+cmos-+nocmos-+time-+regdump -+sayr-+port-+ohb-+vector-+clrscr-+cursor-+reboot-+cold-+hdd2-+genint-+msdos-+loop-+comport -+stdio-+initv-+kbhit-+end-+getch0-+putch0-+putch1-+putch2-+putch3-+int13err-+bootread-+bootred0-+readsec & -+txtattr-+intercept-+vec-+out_iv-+out_boot-+mem-+memmove-+ls-+rm-+mv-+cp-+cat-+de-+e-+int86-+stream-+gets-+mouse-+printf-+fprintf-+run_boot & -+char_in-+char_out-+ohw-+msherc-+msherc1-+io-+dir-+debug-+p2d-+d2p-+sh-+stat-+syserr-+viewexe-+rand-+int5dump-+qsort-+conv,kernel.dic src/kernel/vexe.com0100664000076500007650000001647606471563736014064 0ustar prool2prool2.0!.,ڣigc.m>aNjع&=87u&U=umYumaC&8uր̀ىae+>s>DŽr(>r"G;r>t>u;wډ{g+؎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PaP\]Uvvvv PaP@]Uvvvv ~ u3PaP]UCFNV!rP]ú@!'@!UVWvD;tf<|-Du D փ;uD փ;uDD 34|u9$;u2DPY udPDt3P3PV~ uD@uPPDP=uPFPDP=tDu LF^]UVv$PVYY^]UVWv~GDt#O tV^FPYY=uuD@t7|t1D;s*<t VY t3SOWvDPF+~7O t,}^FD \ GV^F7YY=uˋ_^]&6UVת"תת"ת]UVWFFP8W2I_ÈGN~"SQRF+FPWvV FP~~ZY[~llv t<%tGNux<%t牾l3ɉvjudžpdžr2Ћ؀ `sG=v.TQ[k{%x;hhhwj뛀w샎j돀wu+tu|jߵrj hwDju!jQ~Fs p7uቆr)sӵ,0wp |pur |rjjjjj ƆuƆon~3 Ɔon~GGvjtGG~{ u3 u/ru-lptj%t0 jRPWǘPoPSsr !nvz^7CC^j t7CC^:Ɔojz+ϋr;vn~F{2vn~j u =F =F u;rvrvn~r }WQ{SR#jPjt Ft F FP7FF{jtp ~ [+~vu t&=-tvvO&4lp#j=unouvdžvxtXuj@KKv}džvvju  K;j@t 0nv ~'++&<-t< t<+u&IK0+&GN ~ ˰ {v~j u =F=FP*FF&}xl%< u~P}6F_^]UVWv>twu|D 6tt_^]UVWv~~;u>~ ƉF^VY_^]V;~u6Y3~;~wu"VY;6u 3~D~VsY 6~iY6~^UVWv ƉF|u;6t^VY^u vV*YY_^]UVv u;6~u<VY^]Stack overflow! $Ȏغ !1Turbo-C - Copyright (c) 1988 Borland Intl.Divide error Abnormal program termination Bytes on last page %04X Pages in file %04X Relocations %04X Paragraphe in header %04X MinMem %04X par MaxMem %04X par SS:SP %04X:%04X CheckSum %04X CS:IP %04X:%04X Relocation table addr %04X View EXE ver. 0.0.0.1 9-Mar-96 (c) by Prool usage: vexe filenameCan't open %s Can't read %s. read()=%i File %s ###  $4CDBTdt$4D   @print scanf : floating point formats not linked (null)0123456789ABCDEF       src/kernel/stdio.c0100664000076500007650000000454606047675442013673 0ustar prool2prool2#include #include #include #include "kernel.h" /****************************************************************************/ #if 0 /* ࠭ ਨ */ char Hex [] = "0123456789ABCDEF"; void ohb (char c) { putch(Hex[c>>4]); putch(Hex[c&0xf]); } void ohw (int w) { ohb(w>>8); ohb(w&0xff); } void ohd (unsigned long int ll) { ohw(ll>>16); ohw(ll&0xffff); } #endif /****************************************************************************/ void perror(const char far *str) { printf("%s: ",str); puts(sys_errlist[errno]); return; /* ⮬ 㦭 㤥 printf fprintf(stderr, ... */ } /****************************************************************************/ void ohs(const char far *s) { do printf("%2X ",*s); while (*s++); } /****************************************************************************/ int unlink(const char far *path) {int h; /* ஢ઠ ⢮ 䠩 ஢ઠ, ⠫ */ if ((h=open(path,O_RDONLY))==-1) {errno=ENOENT; return -1;} else { if (FCBS[h].Attr.B.Dir) {close(h); errno=EPERM; return -1;} if (close(h)==-1) return -1; } /* ⢥ 㤠 */ return delete(path); } /****************************************************************************/ int delete (const char far *path) {int h, Inode; DIR far *fp; struct dirent far *D; long Pos; if ((h=open(path,O_WRONLY|O_TRUNC))==-1) return -1; Inode=FCBS[h].DirInode; Pos=FCBS[h].DirSeekPos; if (close(h)==-1) return -1; if ((fp=openidir(Inode))==NULL) return -1; if (seekdir(fp,Pos,SEEK_SET)==-1) return -1; if ((D=readdir(fp))==NULL) return -1; (*D).d_name[0]=0xE5; if (seekdir(fp,Pos,SEEK_SET)==-1) return -1; if (writedir(fp,D)==-1) return -1; if (closedir(fp)==-1) return -1; return 0; } /****************************************************************************/ int rename(const char far *old, const char far *new) {int h; struct dirent far *D; DIR far *fp; if((h=open(old,O_WRONLY))==-1) return -1; if ((fp=openidir(FCBS[h].DirInode))==NULL) return -1; if (seekdir(fp,FCBS[h].DirSeekPos,SEEK_SET)==-1) return -1; if ((D=readdir(fp))==NULL) return -1; PathToDir(new,D); if (seekdir(fp,FCBS[h].DirSeekPos,SEEK_SET)==-1) return -1; if (writedir(fp,D)==-1) return -1; FCBS[h].Name[0]=0; if (closedir(fp)==-1) return -1; return 0; } src/kernel/abswrite.c0100664000076500007650000000510206144710170014340 0ustar prool2prool2#include #include #include "kernel.h" extern unsigned char NearBuffer []; int Int13perror(unsigned err); /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ extern unsigned char NearBuffer [SECTOR_SIZE]; /* defined in kernel.c */ /****************************************************************************/ int secwrite (int drive, unsigned long AbsSec, char *Buffer) {/* Write absolute sectors Input: drive (for int 13h Fn=2) abs sec number buffer Output: return!=0 if error */ int Track, SecNoOnCyl, i; char Head, SecOnTrk; Track=(int)(AbsSec/SectorsOnCyl); /* SectorsOnCyl=HeadCnt*TrkSecs, Track == Cyl */ SecNoOnCyl=(int)(AbsSec%SectorsOnCyl); Head=SecNoOnCyl/TrkSecs; SecOnTrk=SecNoOnCyl%TrkSecs+1; /* 2 bytes are combined to a word similar to INT 13: 76543210 1st byte (sector) Sector offset within cylinder High order bits of cylinder # 76543210 2nd byte (cylinder) Low order bits of cylinder # */ if ((i=Track &0x0300)!=0) { SecOnTrk = (SecOnTrk & 0x3F) | (int)(i>>2); } return WritePhysSec(drive, SecOnTrk, Head, Track, Buffer); } /****************************************************************************/ int abswrite (int drive, int nsects, unsigned long lsect, void far *FarBuffer) { int i, j, k; unsigned err; if (ReadOnly) { puts("Drive has mounted read only. Write not allowed!"); return -1; } for (i=0;i=MaxSectors) { puts("absread: lsect >=MaxSectors"); return -1; } #if 1 for (k=0;k>=8; printf("absread: error %2X in sec %i: ",err,lsect); Int13perror(err); printf(" Ignore (i), retry (r) or abort (a) ? "); j=getchar(); puts(""); if (j=='r') continue; else if (j=='a') return -1; else /* ignore */ break; } else break; } /* FarBuffer = (char far *) FarBuffer + SECTOR_SIZE; */ } return 0; } /****************************************************************************/ src/kernel/bios.c0100664000076500007650000000704705703620300013461 0ustar prool2prool2#include #ifndef EXE #include "kernel.h" #include #else #include #endif #include /*---------------------------------------------------------------------------*/ /* ஫ ..,஫ .. ணࠬ஢ .-.:"-", 1993.-240.-(⥪ ⥬ ணࠬ; .4) Portions Copyright by ..஫, ..஫, 1993. */ unsigned com_address ( int portid ) { unsigned base_address; if(( portid > 4) || ( portid < 0 )) return( -1 ); base_address = *(( unsigned far * ) MK_FP( 0x40, portid * 2 )); return( base_address ); } /* OFF */ /*---------------------------------------------------------------------------*/ #ifndef EXE int inicom (unsigned int portid, unsigned char Par) {int i; int ComBase; i=inicom_(portid,Par); if((ComBase=com_address(portid))==0)return -1; outp (ComBase+LCR, inp((ComBase+LCR) | 0x80) ); outp (ComBase+ICR,0); return i; } #endif /*---------------------------------------------------------------------------*/ int getcom(int portid) {int ComBase; if((ComBase=com_address(portid))==0) return -1; if ( inp(ComBase+LSR) & 1 ) return inp(ComBase); else return -2; } /*---------------------------------------------------------------------------*/ int putcom(int portid, unsigned char byte) {int ComBase; if((ComBase=com_address(portid))==0) return -1; while (( inp(ComBase+LSR) & 0x20 )==0); outp(ComBase,byte); return 0; } /*---------------------------------------------------------------------------*/ int getcomstat(int portid) {int ComBase; if((ComBase=com_address(portid))==0) return -1; return inp(ComBase+LSR); } /*---------------------------------------------------------------------------*/ int is_UART_8250 (int port ) { int save_scr, in_scr; int addr; int ComBase; ComBase=com_address(port); #ifdef EXE if (ComBase) printf("%4X",ComBase); #endif if(ComBase==0)return -1; addr=ComBase+(0x3ff-0x3f8); save_scr=inp(addr); outp(addr,0x5a); in_scr=inp(addr); if(in_scr!=0x5a){ outp(addr,save_scr); return UART_8250; } outp(addr,0xa5); in_scr=inp(addr); outp(addr,save_scr); if(in_scr!=0xa5) return UART_8250; return 0; } /*---------------------------------------------------------------------------*/ int is_UART_FIFO(int port) { /*int save_iir;*/ int in_iir; int addr; int ComBase; if((ComBase=com_address(port))==0) return -1; addr=ComBase+(0x3fa-0x3f8); /*save_iir=inp(addr);*/ outp(addr,1); in_iir=inp(addr); outp(addr,0); if((in_iir & 0x40) == 1) return UART_16550A; if((in_iir&0x80)==1) return UART_16550; return UART_16450; } /*---------------------------------------------------------------------------*/ int uart_type (int port) {int test; if( (test=is_UART_8250(port)) == UART_8250 ) return UART_8250; else if (test==-1) return -1; if(( test = is_UART_FIFO(port) ) == UART_16550A ) return UART_16550A; if(test == UART_16550) return UART_16550; return UART_16450; } #ifdef EXE main() {int i; char * UARTname [] = { "8250 without FIFO", "16450 without FIFO", "16550 with FIFO", "16550A with FIFO"}; clrscr(); puts("Port Base addr UART type"); printf( "COM1 ");if((i=uart_type(0))!=-1)printf(UARTname[i-1]);else printf("Not found"); printf("\nCOM2 ");if((i=uart_type(1))!=-1)printf(UARTname[i-1]);else printf("Not found"); printf("\nCOM3 ");if((i=uart_type(2))!=-1)printf(UARTname[i-1]);else printf("Not found"); printf("\nCOM4 ");if((i=uart_type(3))!=-1)printf(UARTname[i-1]);else printf("Not found"); puts(""); } #endif src/kernel/msherc.asm0100664000076500007650000025265306375646612014375 0ustar prool2prool2; MSHerc.com ; Disassembled by Sourcer V 5.04 (C) V COMMUNICATIONS, INC. 1988-1993 ; Copyright (C) Comments for Serge Pustovoitoff, 1995 ;PAGE ,78 ; ; ; MSHERC ; ; Created: 7-Mar-88 ; Passes: 9 Analysis Options on: none ; ; ; The following equates show data references outside the range of the program. Vec10h equ 10h*4 equip_bits_ equ 410h video_mode_ equ 449h video_columns_ equ 44Ah video_buf_siz_ equ 44Ch video_segment_ equ 44Eh vid_curs_pos0_ equ 450h vid_curs_pos1_ equ 452h vid_curs_mode_ equ 460h video_page_ equ 462h data_3e equ 81h data_143e equ 9C38h ;* data_144e equ 0AA39h ;* data_145e equ 0B053h ;* data_146e equ 0B83Ah ;* data_147e equ 2000h data_148e equ 7FA6h data_149e equ 2000h seg_a segment byte public assume cs:seg_a org 100h msherc proc far start: jmp StayResident Trap10h: push bp push es push ds push di push si push dx push cx push bx push ax mov bp,sp push cs pop ds mov es,data_25 cld cmp ah,0EFh je l_Fn_EF ; Fn = EF ; From [Interrupt List]: ;INT 10 - VIDEO - MSHERC.COM - GET VIDEO ADAPTER TYPE AND MODE ; AH = EFh ;Return: DL = video adapter type ; 00h original Hercules ; 01h Hercules Plus ; 02h Hercules InColor??? ; DH = memory mode byte ; 01h "half" mode ; 03h "full" mode or ah,ah jz l_Fn_0 ; Fn = 00 set video mode cmp byte ptr Flag,0 jnz ToOld cmp ah,0Fh ja l_Fn_GT_0F ; Fn > 0F l_Fn: ; Fn <= 0F mov di,[bp+1] and di,0FFh ; di = ah (from stack) shl di,1 ; di *= 2 call word ptr FunTab[di] l_iret: ; 室 뢠 pop ax pop bx pop cx pop dx pop si pop di pop ds pop es pop bp iret l_Fn_GT_0F: cmp ah,0F0h jb l_iret ; Fn > F0 - exit jmp short ToOld l_Fn_EF: call sub_4 jmp short l_iret l_Fn_0: cmp al,8 je l_Fn cmp al,88h je l_Fn mov byte ptr Flag,1 ToOld: ; । . ஬ pop ax pop bx pop cx pop dx pop si pop di pop ds pop es pop bp jmp dword ptr cs:OldVec10h msherc endp public msherc ; ; SUBROUTINE ; Null proc near retn Null endp ; db 7 dup (0) ; Data table (indexed access) FunTab dw offset SetVideoMode ; 0 set video mode data_6 dw offset SetCur ; 1 set cursor data_7 dw offset SetCurPos ; 2 set cur pos data_8 dw offset GetCurPos ; 3 get cur pos data_9 dw offset Null ; 4 get pen data_10 dw offset SetPage ; 5 set page data_11 dw offset ScrollUp ; 6 scroll up data_12 dw offset ScrollDn ; 7 scroll down data_13 dw offset GetSymAttr ; 8 get sym/attr data_14 dw offset WriteSymAttr ; 9 write sym/attr data_15 dw offset WriteSym ; A write sym data_16 dw offset Null ; B set palette/border data_17 dw offset Dot ; C dot data_18 dw offset GetPoint ; D get point data_19 dw offset tty ; E tty data_20 dw offset GetVideoMode ; F get video mode OldVec10h dd 0 public OldVec10h Flag db 1 FlagH db 3 ; or 1 if Flag data_25 dw 0 data_26 db 0 data_27 db 35h db 2Dh, 2Eh, 07h, 5Bh, 02h, 57h db 57h, 02h, 03h db 0, 0, 0, 0 data_29 dw 0 data_30 dw 0 data_32 dw 0 data_33 db 1 ; Data table (indexed access) db 02h, 04h, 08h, 10h, 20h, 40h db 80h data_34 db 0FEh ; Data table (indexed access) db 0FCh,0F8h,0F0h,0E0h,0C0h, 80h db 00h data_35 db 0 ; Data table (indexed access) db 01h, 03h, 07h, 0Fh, 1Fh, 3Fh db 7Fh data_36 dw 0 ; Data table (indexed access) db 00h, 20h, 00h, 40h, 00h, 60h db 5Ah, 00h, 5Ah, 20h, 5Ah, 40h db 5Ah, 60h,0B4h, 00h,0B4h, 20h db 0B4h, 40h,0B4h, 60h, 0Eh, 01h db 0Eh, 21h, 0Eh, 41h, 0Eh, 61h db 68h, 01h, 68h, 21h, 68h, 41h db 68h, 61h,0C2h, 01h,0C2h, 21h db 0C2h, 41h,0C2h, 61h, 1Ch, 02h db 1Ch, 22h, 1Ch, 42h, 1Ch, 62h db 76h, 02h, 76h, 22h, 76h, 42h db 76h, 62h,0D0h, 02h,0D0h, 22h db 0D0h, 42h,0D0h, 62h, 2Ah, 03h db 2Ah, 23h, 2Ah, 43h, 2Ah, 63h db 84h, 03h, 84h, 23h, 84h, 43h db 84h, 63h,0DEh, 03h,0DEh, 23h db 0DEh, 43h,0DEh, 63h, 38h, 04h db 38h, 24h, 38h, 44h, 38h, 64h db 92h, 04h, 92h, 24h, 92h, 44h db 92h, 64h,0ECh, 04h,0ECh, 24h db 0ECh, 44h,0ECh, 64h, 46h, 05h db 46h, 25h, 46h, 45h, 46h, 65h db 0A0h, 05h,0A0h, 25h,0A0h, 45h db 0A0h, 65h,0FAh, 05h,0FAh, 25h db 0FAh, 45h,0FAh, 65h, 54h, 06h db 54h, 26h, 54h, 46h, 54h, 66h db 0AEh, 06h,0AEh, 26h,0AEh, 46h db 0AEh, 66h, 08h, 07h, 08h, 27h db 08h, 47h, 08h, 67h, 62h, 07h db 62h, 27h, 62h, 47h, 62h, 67h db 0BCh, 07h,0BCh, 27h,0BCh, 47h db 0BCh, 67h, 16h, 08h, 16h, 28h db 16h, 48h, 16h db 'hp', 8, 'p(pHph' db 0CAh, 08h,0CAh, 28h,0CAh, 48h db 0CAh db 'h$' db 9, '$' db ')$' db 'I$' db 'i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Ch, 32h,0FCh, 52h db 0FCh, 72h, 56h, 13h, 56h, 33h db 56h, 53h, 56h, 73h,0B0h, 13h db 0B0h loc_7: xor si,ds:data_145e[bx+si] jnc $+0Ch ; Jump if carry=0 adc al,0Ah xor al,0Ah loc_8: push sp or dh,[si+64h] adc al,64h ; 'd' xor al,64h ; 'd' push sp db 64h, 74h,0BEh, 14h,0BEh, 34h db 0BEh, 54h,0BEh, 74h, 18h, 15h db 18h, 35h, 18h, 55h, 18h db 75h, 72h loc_9: adc ax,3572h ;* jc loc_16 ;*Jump if carry Set db 72h, 55h ; Fixup - byte match jc $+77h ; Jump if carry Set int 3 ; Debug breakpoint adc ax,35CCh int 3 ; Debug breakpoint push bp int 3 ; Debug breakpoint jnz loc_14 ; Jump if not zero push ss db 26h, 36h, 26h, 56h, 26h, 76h db 80h, 16h, 80h, 36h, 80h, 56h db 80h, 76h,0DAh loc_12: push ss db 0DAh, 36h,0DAh, 56h,0DAh, 76h db 34h, 17h, 34h, 37h, 34h, 57h db 34h, 77h, 8Eh loc_13: pop ss db 8Eh, 37h, 8Eh, 57h, 8Eh loc_14: ja loc_12 ; Jump if above pop ss call $-17C6h push di call $+427Ah sbb [bp+si+38h],al inc dx pop ax inc dx loc_15: js loc_8 ; Jump if sign=1 sbb ds:data_143e[si],bl pop ax pushf ; Push flags js loc_15 ; Jump if sign=1 ;* sbb dh,dh db 18h,0F6h ; Fixup - byte match ;* cmp dh,dh db 38h,0F6h ; Fixup - byte match pop ax idiv byte ptr [bx+si+50h] ; al,ah rem = ax/data sbb [bx+si+39h],dx push ax pop cx push ax ;* jns loc_10 ;*Jump if not sign db 79h,0AAh ; Fixup - byte match sbb ss:data_144e[bp+si],bp pop cx stosb ; Store al to es:[di] jns loc_17 ; Jump if not sign sbb al,[si] cmp al,[si] loc_17: pop dx add al,7Ah ; 'z' pop si sbb bl,[bp+3Ah] pop si pop dx pop si jp loc_13 ; Jump if parity=1 sbb bh,ds:data_146e[bx+si] pop dx mov ax,127Ah sbb dx,[bp+si] cmp dx,[bp+si] pop bx adc bh,[bp+di+6Ch] sbb bp,[si+3Bh] db 6Ch, 5Bh, 6Ch, 7Bh,0C6h, 1Bh db 0C6h, 3Bh,0C6h, 5Bh,0C6h, 7Bh db 20h, 1Ch db 20h, 3Ch, 20h data_37 dw 205Ch db 7Ch, 7Ah data_38 dw 7A1Ch data_39 dw 7A3Ch ; Data table (indexed access) db 5Ch, 7Ah, 7Ch,0D4h, 1Ch,0D4h db 3Ch,0D4h, 5Ch,0D4h, 7Ch, 2Eh db 1Dh db 2Eh, 3Dh, 2Eh data_40 db 5Dh db 2Eh, 7Dh, 88h, 1Dh, 88h, 3Dh db 88h, 5Dh, 88h, 7Dh,0E2h, 1Dh db 0E2h, 3Dh,0E2h, 5Dh,0E2h, 7Dh db 3Ch, 1Eh, 3Ch, 3Eh, 3Ch, 5Eh db 3Ch, 7Eh, 96h, 1Eh, 96h db 3Eh data_41 dw 0 data_43 db 0 data_44 db 0Eh data_45 db 0 db 0 db 25 dup (0) data_47 db 0 db 15 dup (0) db 7Eh, 81h,0A5h, 81h, 81h,0BDh db 99h, 81h, 7Eh, 00h, 00h, 00h db 00h, 00h, 7Eh,0FFh,0DBh,0FFh db 0FFh,0C3h,0E7h,0FFh, 7Eh, 00h db 00h, 00h, 00h, 00h, 00h, 36h db 7Fh, 7Fh, 7Fh, 7Fh, 3Eh, 1Ch db 08h, 00h, 00h, 00h, 00h, 00h db 00h, 08h, 1Ch, 3Eh, 7Fh, 3Eh db 1Ch, 08h, 00h, 00h, 00h, 00h db 00h, 18h, 3Ch, 3Ch,0E7h,0E7h db 0E7h, 3Ch, 18h, 18h, 3Ch, 00h db 00h, 00h, 00h, 00h, 18h, 3Ch db 7Eh,0FFh,0FFh, 7Eh, 18h, 18h db 3Ch db 8 dup (0) db 18h, 3Ch, 3Ch, 18h, 00h, 00h db 00h, 00h, 00h,0FFh,0FFh,0FFh db 0FFh,0FFh,0E7h,0C3h, 81h,0E7h db 0FFh,0FFh,0FFh,0FFh,0FFh, 00h db 00h, 00h, 00h, 3Ch, 66h, 42h db 42h, 66h, 3Ch, 00h, 00h, 00h db 00h,0FFh,0FFh,0FFh,0FFh,0C3h db 99h,0BDh,0BDh, 99h,0C3h,0FFh db 0FFh,0FFh,0FFh, 00h, 00h, 0Fh db 07h, 0Dh, 19h, 3Ch, 66h, 66h db 66h, 3Ch, 00h, 00h, 00h, 00h db 00h, 3Ch, 66h, 66h, 66h, 3Ch db 18h, 7Eh, 18h, 18h, 00h, 00h db 00h, 00h, 00h, 3Fh, 33h, 3Fh db 30h, 30h, 30h, 70h,0F0h,0E0h db 00h, 00h, 00h, 00h, 00h, 7Fh db 63h, 7Fh, 63h, 63h, 63h, 67h db 0E7h,0E6h, 60h, 00h, 00h, 00h db 00h, 18h, 18h,0DBh, 3Ch,0E7h db 3Ch,0DBh, 18h, 18h, 00h, 00h db 00h, 00h, 00h, 40h, 60h, 70h db 7Ch, 7Fh, 7Ch, 70h, 60h, 40h db 00h, 00h, 00h, 00h, 00h, 01h db 03h, 07h, 1Fh, 7Fh, 1Fh, 07h db 03h, 01h, 00h, 00h, 00h, 00h db 00h, 18h, 3Ch, 7Eh, 18h, 18h db 18h, 7Eh, 3Ch, 18h, 00h, 00h db 00h, 00h, 00h, 33h, 33h, 33h db 33h, 33h, 33h, 00h, 33h, 33h db 00h, 00h, 00h, 00h, 00h, 7Fh db 0DBh,0DBh,0DBh, 7Bh, 1Bh, 1Bh db 1Bh, 1Bh, 00h, 00h, 00h, 00h db 3Eh, 63h, 30h, 1Ch, 36h, 63h db 63h, 36h, 1Ch, 06h db 63h, 3Eh db 9 dup (0) db 7Fh, 7Fh, 7Fh, 00h, 00h, 00h db 00h, 00h, 18h, 3Ch, 7Eh, 18h db 18h, 18h, 7Eh, 3Ch, 18h, 00h db 00h, 00h, 00h, 18h, 3Ch, 7Eh db 18h, 18h, 18h, 18h, 18h, 18h db 00h, 00h, 00h, 00h, 00h, 00h db 18h, 18h, 18h, 18h, 18h, 18h db 7Eh, 3Ch, 18h, 00h, 00h, 00h db 00h, 00h, 00h, 00h, 0Ch, 06h db 0FFh, 06h, 0Ch, 00h db 8 dup (0) db 18h, 30h, 7Fh, 30h, 18h, 00h db 9 dup (0) db 60h, 60h, 60h, 7Fh, 00h db 8 dup (0) db 24h, 66h,0FFh, 66h, 24h db 8 dup (0) db 08h, 1Ch, 1Ch, 3Eh, 3Eh, 7Fh db 7Fh db 7 dup (0) db 7Fh, 7Fh, 3Eh, 3Eh, 1Ch, 1Ch db 08h, 00h db 19 dup (0) db 18h, 3Ch, 3Ch, 3Ch, 18h, 18h db 00h, 18h, 18h, 00h, 00h, 00h db 00h, 63h, 63h, 63h, 22h, 00h db 10 dup (0) db 36h, 36h, 7Fh, 36h, 36h, 36h db 7Fh, 36h, 36h, 00h, 00h, 00h db 0Ch, 0Ch, 3Eh, 63h, 61h, 60h db 3Eh, 03h, 43h, 63h, 3Eh, 0Ch db 0Ch, 00h, 00h, 00h, 00h, 00h db 61h, 63h, 06h, 0Ch, 18h, 33h db 63h, 00h, 00h, 00h, 00h, 00h db 1Ch, 36h, 36h, 1Ch, 3Bh, 6Eh db 66h, 66h, 3Bh, 00h, 00h, 00h db 00h db 30h, 30h, 30h, 60h db 11 dup (0) db 0Ch, 18h, 30h, 30h, 30h, 30h db 30h, 18h, 0Ch, 00h, 00h, 00h db 00h, 00h, 18h, 0Ch, 06h, 06h db 06h, 06h, 06h, 0Ch, 18h db 7 dup (0) db 66h, 3Ch,0FFh, 3Ch, 66h db 8 dup (0) db 18h, 18h, 18h,0FFh, 18h, 18h db 18h, 00h db 11 dup (0) db 18h, 18h, 18h, 30h db 9 dup (0) db 0FFh, 00h db 14 dup (0) db 18h, 18h, 00h, 00h, 00h, 00h db 00h, 01h, 03h, 06h, 0Ch, 18h db 30h, 60h,0C0h, 80h, 00h, 00h db 00h, 00h, 00h db '>cgo{scc>' db 00h, 00h, 00h, 00h, 00h, 0Ch db 1Ch, 3Ch, 0Ch, 0Ch, 0Ch, 0Ch db 0Ch, 3Fh, 00h, 00h, 00h, 00h db 00h, 3Eh, 63h, 03h, 06h, 0Ch db 18h, 30h, 63h, 7Fh, 00h, 00h db 00h, 00h, 00h, 3Eh, 63h, 03h db 03h, 1Eh, 03h, 03h, 63h, 3Eh db 00h, 00h, 00h, 00h, 00h, 06h db 0Eh, 1Eh, 36h, 66h, 7Fh, 06h db 06h, 0Fh, 00h, 00h, 00h, 00h db 00h, 7Fh, 60h, 60h, 60h, 7Eh db 03h, 03h, 63h, 3Eh, 00h, 00h db 00h, 00h, 00h, 1Ch db '0``~ccc>' db 00h, 00h, 00h, 00h, 00h, 7Fh db 63h, 03h, 06h, 0Ch, 18h, 18h db 18h, 18h, 00h, 00h, 00h, 00h db 00h db '>ccc>ccc>' db 00h, 00h, 00h, 00h, 00h, 3Eh db 63h, 63h, 63h, 3Fh, 03h, 03h db 06h, 3Ch, 00h, 00h, 00h, 00h db 00h, 00h, 18h, 18h, 00h, 00h db 18h, 18h, 00h db 7 dup (0) db 18h, 18h, 00h, 00h, 00h, 18h db 18h, 30h, 00h, 00h, 00h, 00h db 00h, 06h, 0Ch, 18h, 30h, 60h db 30h, 18h, 0Ch, 06h db 8 dup (0) db 7Eh, 00h, 00h, 7Eh, 00h, 00h db 00h, 00h, 00h, 00h, 00h, 60h db 30h, 18h, 0Ch, 06h, 0Ch, 18h db 30h, 60h, 00h, 00h, 00h, 00h db 00h, 3Eh, 63h, 63h, 06h, 0Ch db 0Ch, 00h, 0Ch, 0Ch, 00h, 00h db 00h, 00h, 00h db '>ccooon`>' db 00h, 00h, 00h, 00h, 00h, 08h db 1Ch, 36h, 63h, 63h, 7Fh, 63h db 63h, 63h, 00h, 00h, 00h, 00h db 00h db '~333>333~' db 00h, 00h, 00h, 00h, 00h, 1Eh db 33h, 61h, 60h, 60h, 60h, 61h db 33h, 1Eh, 00h, 00h, 00h, 00h db 00h db '|6333336|' db 00h, 00h, 00h, 00h, 00h, 7Fh db 33h, 31h, 34h, 3Ch, 34h, 31h db 33h, 7Fh, 00h, 00h, 00h, 00h db 00h, 7Fh db '314<400x' db 00h, 00h, 00h, 00h, 00h, 1Eh db 33h, 61h, 60h, 60h, 6Fh, 63h db 33h, 1Dh, 00h, 00h, 00h, 00h db 00h, 63h, 63h, 63h, 63h, 7Fh db 63h, 63h, 63h, 63h, 00h, 00h db 00h, 00h, 00h db 3Ch db 7 dup (18h) db 3Ch, 00h, 00h, 00h, 00h, 00h db 0Fh, 06h, 06h, 06h, 06h, 06h db 66h, 66h, 3Ch, 00h, 00h, 00h db 00h, 00h db 's366<663s' db 0, 0, 0, 0, 0 db 'x0000013' db 7Fh, 00h, 00h, 00h, 00h, 00h db 0C3h,0E7h,0FFh,0DBh,0C3h,0C3h db 0C3h,0C3h,0C3h, 00h, 00h, 00h db 00h, 00h, 63h, 73h, 7Bh, 7Fh db 6Fh, 67h, 63h, 63h, 63h, 00h db 00h, 00h, 00h, 00h, 1Ch, 36h db 63h, 63h, 63h, 63h, 63h, 36h db 1Ch, 00h, 00h, 00h, 00h, 00h db '~333>000x' db 0, 0, 0, 0, 0 db '>ccccko>' db 6, 7, 0, 0, 0, 0 db '~333>633{' db 00h, 00h, 00h, 00h, 00h, 3Eh db 63h, 63h, 30h, 1Ch, 06h, 63h db 63h, 3Eh, 00h, 00h, 00h, 00h db 00h,0FFh,0DBh, 99h, 18h, 18h db 18h, 18h, 18h, 3Ch, 00h, 00h db 00h, 00h, 00h db 'cccccccc>' db 00h, 00h, 00h, 00h, 00h,0C3h db 0C3h,0C3h,0C3h,0C3h,0C3h, 66h db 3Ch, 18h, 00h, 00h, 00h, 00h db 00h,0C3h,0C3h,0C3h,0C3h,0C3h db 0DBh,0FFh, 66h, 66h, 00h, 00h db 00h, 00h, 00h,0C3h,0C3h, 66h db 3Ch, 18h, 3Ch, 66h,0C3h,0C3h db 00h, 00h, 00h, 00h, 00h,0C3h db 0C3h,0C3h, 66h, 3Ch, 18h, 18h db 18h, 3Ch, 00h, 00h, 00h, 00h db 00h,0FFh,0C3h, 86h, 0Ch, 18h db 30h, 61h,0C3h,0FFh, 00h, 00h db 00h, 00h, 00h db 3Ch db 7 dup (30h) db 3Ch, 00h, 00h, 00h, 00h, 00h db 40h, 60h, 70h, 38h, 1Ch, 0Eh db 07h, 03h, 01h, 00h, 00h, 00h db 00h, 00h db 3Ch db 7 dup (0Ch) db 3Ch, 00h, 00h, 00h, 08h, 1Ch db 36h, 63h db 21 dup (0) db 0FFh, 00h, 00h, 18h, 18h, 0Ch db 16 dup (0) db 3Ch, 06h, 3Eh, 66h, 66h, 3Bh db 00h, 00h, 00h, 00h, 00h db 'p00<6333n' db 0 db 7 dup (0) db 3Eh, 63h, 60h, 60h, 63h, 3Eh db 00h, 00h, 00h, 00h, 00h, 0Eh db 06h, 06h, 1Eh, 36h, 66h, 66h db 66h, 3Bh, 00h db 7 dup (0) db 3Eh, 63h, 7Fh, 60h, 63h, 3Eh db 00h, 00h, 00h, 00h, 00h, 1Ch db '620|000x' db 0 db 7 dup (0) db 3Bh, 66h, 66h, 66h, 3Eh, 06h db 66h, 3Ch, 00h, 00h, 00h db 'p006;333s' db 00h, 00h, 00h, 00h, 00h, 0Ch db 0Ch, 00h, 1Ch, 0Ch, 0Ch, 0Ch db 0Ch, 1Eh, 00h, 00h, 00h, 00h db 00h, 06h, 06h, 00h, 0Eh, 06h db 06h, 06h, 66h, 66h, 3Ch, 00h db 00h, 00h, 00h db 'p0036<63s' db 00h, 00h, 00h, 00h, 00h, 1Ch db 7 dup (0Ch) db 1Eh db 8 dup (0) db 0E6h,0DBh,0DBh,0DBh,0DBh,0DBh db 8 dup (0) db 6Eh, 33h, 33h, 33h, 33h, 33h db 00h db 7 dup (0) db 3Eh, 63h, 63h, 63h, 63h, 3Eh db 8 dup (0) db 'n333>00x' db 00h, 00h, 00h, 00h, 00h, 00h db 3Bh, 66h, 66h, 66h, 3Eh, 06h db 06h, 0Fh, 00h, 00h, 00h, 00h db 00h, 00h, 6Eh, 33h, 33h, 30h db 30h, 78h, 00h db 7 dup (0) db 3Eh, 63h, 38h, 0Eh, 63h, 3Eh db 00h, 00h, 00h, 00h, 00h, 08h db 18h, 18h, 7Eh, 18h, 18h, 18h db 1Bh, 0Eh, 00h, 00h, 00h, 00h db 00h, 00h, 00h, 00h, 66h, 66h db 66h, 66h, 66h, 3Bh, 00h db 7 dup (0) db 0C3h,0C3h,0C3h, 66h, 3Ch, 18h db 8 dup (0) db 0C3h,0C3h,0DBh,0DBh, 7Eh, 66h db 8 dup (0) db 63h, 36h, 1Ch, 1Ch, 36h, 63h db 8 dup (0) db 63h, 63h, 63h, 63h, 3Fh, 03h db 06h, 3Ch, 00h, 00h, 00h, 00h db 00h, 00h, 7Fh, 66h, 0Ch, 18h db 33h, 7Fh, 00h, 00h, 00h, 00h db 00h, 0Eh, 18h, 18h, 18h, 70h db 18h, 18h, 18h, 0Eh, 00h, 00h db 00h, 00h, 00h, 18h, 18h, 18h db 18h, 00h, 18h, 18h, 18h, 18h db 00h, 00h, 00h, 00h, 00h, 70h db 18h, 18h, 18h, 1Ch, 18h, 18h db 18h, 70h, 00h, 00h, 00h, 00h db 00h db 3Bh, 6Eh db 15 dup (0) db 08h, 1Ch, 36h, 63h, 63h, 63h db 7Fh, 00h, 00h, 00h, 00h, 1Eh db 33h, 61h, 60h, 60h, 61h, 63h db 3Eh, 06h, 03h, 3Eh, 00h, 00h db 00h, 66h, 66h, 00h, 66h, 66h db 66h, 66h, 66h, 3Bh, 00h, 00h db 00h, 00h, 06h, 0Ch, 18h, 00h db 3Eh, 63h, 7Fh, 60h, 63h, 3Eh db 00h, 00h, 00h, 00h, 08h, 1Ch db 36h, 00h, 3Ch, 06h, 3Eh, 66h db 66h, 3Bh, 00h, 00h, 00h, 00h db 00h, 66h, 66h, 00h, 3Ch, 06h db 3Eh, 66h, 66h, 3Bh, 00h, 00h db 00h, 00h, 30h, 18h, 0Ch, 00h db 3Ch, 06h, 3Eh, 66h, 66h, 3Bh db 00h, 00h, 00h, 00h, 1Ch, 36h db 1Ch, 00h, 3Ch, 06h, 3Eh, 66h db 66h, 3Bh, 00h db 7 dup (0) db 3Ch, 66h, 60h, 66h, 3Ch, 06h db 3Ch, 00h, 00h, 00h, 08h, 1Ch db 36h, 00h, 3Eh, 63h, 7Fh, 60h db 63h, 3Eh, 00h, 00h, 00h, 00h db 00h, 66h, 66h, 00h, 3Eh, 63h db 7Fh, 60h, 63h, 3Eh, 00h, 00h db 00h, 00h, 30h, 18h, 0Ch, 00h db 3Eh, 63h, 7Fh, 60h, 63h, 3Eh db 00h, 00h, 00h, 00h, 00h, 36h db 36h, 00h, 1Ch, 0Ch, 0Ch, 0Ch db 0Ch, 1Eh, 00h, 00h, 00h, 00h db 18h, 3Ch, 66h, 00h, 38h, 18h db 18h, 18h, 18h, 3Ch, 00h, 00h db 00h, 00h, 60h, 30h, 18h, 00h db 38h, 18h, 18h, 18h, 18h, 3Ch db 00h, 00h, 00h, 00h, 63h, 63h db 08h, 1Ch, 36h, 63h, 63h, 7Fh db 63h, 63h, 00h, 00h, 00h, 1Ch db 36h, 1Ch, 00h, 1Ch, 36h, 63h db 63h, 7Fh, 63h, 63h, 00h, 00h db 00h, 0Ch, 18h, 30h, 00h, 7Fh db 33h, 30h, 3Eh, 30h, 33h, 7Fh db 00h db 7 dup (0) db 6Eh, 3Bh, 1Bh, 7Eh,0D8h,0DCh db 77h, 00h, 00h, 00h, 00h, 1Fh db 36h, 66h, 66h, 7Fh, 66h, 66h db 66h, 67h, 00h, 00h, 00h, 00h db 08h, 1Ch, 36h, 00h, 3Eh, 63h db 63h, 63h, 63h, 3Eh, 00h, 00h db 00h, 00h, 00h, 63h, 63h, 00h db 3Eh, 63h, 63h, 63h, 63h, 3Eh db 00h, 00h, 00h, 00h, 30h, 18h db 0Ch, 00h, 3Eh, 63h, 63h, 63h db 63h, 3Eh, 00h, 00h, 00h, 00h db 18h, 3Ch, 66h, 00h, 66h, 66h db 66h, 66h, 66h, 3Bh, 00h, 00h db 00h, 00h, 30h, 18h, 0Ch, 00h db 66h, 66h, 66h, 66h, 66h, 3Bh db 00h, 00h, 00h, 00h, 00h, 63h db 63h, 00h, 63h, 63h, 63h, 63h db 3Fh, 03h, 06h, 3Ch, 00h, 00h db 63h, 63h, 1Ch, 36h, 63h, 63h db 63h, 63h, 36h, 1Ch, 00h, 00h db 00h, 00h, 63h, 63h, 00h, 63h db 63h, 63h, 63h, 63h, 63h, 3Eh db 00h, 00h, 00h, 00h, 18h, 18h db 7Eh,0C3h,0C0h,0C0h,0C3h, 7Eh db 18h, 18h, 00h, 00h, 00h, 00h db 1Ch db '600x000s~' db 00h, 00h, 00h, 00h, 00h,0C3h db 66h, 3Ch, 18h,0FFh, 18h,0FFh db 18h, 18h, 00h, 00h, 00h, 00h db 0FCh db 'ff|bfoff' db 0F3h, 00h, 00h, 00h, 00h, 0Eh db 1Bh, 18h, 18h, 18h, 7Eh, 18h db 18h, 18h, 18h,0D8h, 70h, 00h db 00h, 0Ch, 18h, 30h, 00h, 3Ch db 06h, 3Eh, 66h, 66h, 3Bh, 00h db 00h, 00h, 00h, 0Ch, 18h, 30h db 00h, 38h, 18h, 18h, 18h, 18h db 3Ch, 00h, 00h, 00h, 00h, 0Ch db 18h, 30h, 00h, 3Eh, 63h, 63h db 63h, 63h, 3Eh, 00h, 00h, 00h db 00h, 0Ch, 18h, 30h, 00h, 66h db 66h, 66h, 66h, 66h, 3Bh, 00h db 00h, 00h, 00h, 00h, 3Bh, 6Eh db 00h, 6Eh, 33h, 33h, 3Bh, 33h db 33h, 33h, 00h, 00h, 3Bh, 6Eh db 00h, 63h, 73h, 7Bh, 7Fh, 6Fh db 67h, 63h, 63h, 00h, 00h, 00h db 00h, 3Ch, 6Ch, 6Ch, 3Eh, 00h db 7Eh, 00h db 7 dup (0) db 38h, 6Ch, 6Ch, 38h, 00h, 7Ch db 00h db 8 dup (0) db 18h, 18h, 00h, 18h, 18h, 33h db 33h, 1Eh, 00h, 00h db 8 dup (0) db 7Fh, 60h, 60h db 11 dup (0) db 7Fh, 03h, 03h, 00h, 00h, 00h db 00h, 00h, 00h, 60h,0E0h, 63h db 66h, 6Ch, 18h, 30h, 6Eh,0C3h db 06h, 0Ch, 1Fh, 00h, 00h, 60h db 0E0h, 63h, 66h, 6Ch, 18h, 30h db 67h,0CFh, 1Fh, 03h, 03h, 00h db 00h, 00h, 18h, 18h, 00h, 18h db 18h, 3Ch, 3Ch, 3Ch, 18h, 00h db 00h, 00h, 00h, 00h, 00h, 00h db 1Bh, 36h, 6Ch, 36h, 1Bh, 00h db 8 dup (0) db 6Ch, 36h, 1Bh, 36h, 6Ch, 00h db 00h, 00h, 00h, 00h, 11h, 44h db 11h, 44h, 11h, 44h, 11h, 44h db 11h, 44h, 11h, 44h, 11h, 44h db 55h,0AAh, 55h,0AAh, 55h,0AAh db 55h,0AAh, 55h,0AAh, 55h,0AAh db 55h,0AAh,0DDh, 77h,0DDh, 77h db 0DDh, 77h,0DDh, 77h,0DDh, 77h db 0DDh, 77h,0DDh, 77h, 18h db 20 dup (18h) db 0F8h db 11 dup (18h) db 0F8h, 18h,0F8h, 18h, 18h, 18h db 18h, 18h, 18h db 7 dup (36h) db 0F6h, 36h, 36h, 36h, 36h, 36h db 36h, 00h, 00h, 00h, 00h, 00h db 00h,0FEh db 7 dup (36h) db 00h, 00h, 00h, 00h, 00h,0F8h db 18h,0F8h, 18h, 18h, 18h, 18h db 18h, 18h, 36h, 36h, 36h, 36h db 36h,0F6h, 06h,0F6h db 36h, 36h db 18 dup (36h) db 00h, 00h, 00h, 00h, 00h,0FEh db 06h,0F6h db 36h, 36h, 36h db 8 dup (36h) db 0F6h, 06h,0FEh, 00h, 00h, 00h db 00h, 00h, 00h, 36h, 36h, 36h db 36h, 36h, 36h, 36h,0FEh, 00h db 00h, 00h, 00h, 00h, 00h, 18h db 18h, 18h, 18h, 18h,0F8h, 18h db 0F8h db 13 dup (0) db 0F8h db 13 dup (18h) db 1Fh, 00h, 00h, 00h, 00h, 00h db 00h, 18h, 18h, 18h, 18h, 18h db 18h, 18h,0FFh, 00h db 12 dup (0) db 0FFh, 18h db 12 dup (18h) db 1Fh, 18h, 18h, 18h, 18h, 18h db 18h db 7 dup (0) db 0FFh, 00h, 00h, 00h, 00h, 00h db 00h, 18h, 18h, 18h, 18h, 18h db 18h, 18h,0FFh, 18h db 10 dup (18h) db 1Fh, 18h, 1Fh, 18h, 18h, 18h db 18h, 18h, 18h db 7 dup (36h) db 37h db 11 dup (36h) db 37h, 30h, 3Fh db 11 dup (0) db 3Fh, 30h, 37h db 11 dup (36h) db 0F7h, 00h,0FFh, 00h db 10 dup (0) db 0FFh, 00h,0F7h, 36h, 36h, 36h db 8 dup (36h) db '707666666' db 00h, 00h, 00h, 00h, 00h,0FFh db 00h,0FFh, 00h, 00h, 00h, 00h db 00h, 00h, 36h, 36h, 36h, 36h db 36h,0F7h, 00h,0F7h, 36h, 36h db 36h, 36h, 36h, 36h, 18h, 18h db 18h, 18h, 18h,0FFh, 00h,0FFh db 00h, 00h, 00h, 00h, 00h, 00h db 36h, 36h, 36h, 36h, 36h, 36h db 36h,0FFh, 00h db 10 dup (0) db 0FFh, 00h,0FFh, 18h, 18h, 18h db 18h, 18h, 18h, 00h, 00h, 00h db 00h, 00h, 00h, 00h,0FFh db 13 dup (36h) db 3Fh, 00h, 00h, 00h, 00h, 00h db 00h, 18h, 18h, 18h, 18h, 18h db 1Fh, 18h, 1Fh db 11 dup (0) db 1Fh, 18h, 1Fh, 18h, 18h, 18h db 18h, 18h, 18h db 7 dup (0) db 3Fh db 13 dup (36h) db 0FFh, 36h, 36h, 36h, 36h, 36h db 36h, 18h, 18h, 18h, 18h, 18h db 0FFh, 18h,0FFh db 13 dup (18h) db 0F8h db 13 dup (0) db 1Fh, 18h, 18h, 18h, 18h, 18h db 18h db 14 dup (0FFh) db 7 dup (0) db 7 dup (0FFh) db 14 dup (0F0h) db 14 dup (0Fh) db 7 dup (0FFh) db 12 dup (0) db 3Bh, 6Eh, 6Ch, 6Ch, 6Eh, 3Bh db 00h, 00h, 00h, 00h, 00h, 00h db 00h db '>c~cc~`` ' db 00h, 00h, 00h, 7Fh db 'cc``````' db 7 dup (0) db 7Fh, 36h, 36h, 36h, 36h, 36h db 36h, 00h, 00h, 00h, 00h, 00h db 7Fh, 63h, 30h, 18h, 0Ch, 18h db 30h, 63h, 7Fh db 8 dup (0) db 3Eh, 6Ch, 6Ch, 6Ch, 6Ch, 38h db 00h, 00h, 00h, 00h, 00h, 00h db 00h db '3333>00`' db 00h, 00h, 00h, 00h, 00h, 00h db 3Bh, 6Eh, 0Ch, 0Ch, 0Ch, 0Ch db 0Ch, 00h, 00h, 00h, 00h, 00h db 7Eh, 18h, 3Ch, 66h, 66h, 66h db 3Ch, 18h, 7Eh, 00h, 00h, 00h db 00h, 00h, 1Ch, 36h, 63h, 63h db 7Fh, 63h, 63h, 36h, 1Ch, 00h db 00h, 00h, 00h, 00h, 1Ch, 36h db 63h, 63h, 63h, 36h, 1Ch, 36h db 36h, 77h, 00h, 00h, 00h, 00h db 1Eh, 30h, 18h, 0Ch, 3Eh, 66h db 66h, 66h, 3Ch, 00h db 7 dup (0) db 7Eh,0DBh,0DBh, 7Eh, 00h, 00h db 00h, 00h, 00h, 00h, 00h, 03h db 06h, 7Eh,0DBh,0DBh,0F3h, 7Eh db 60h,0C0h, 00h, 00h, 00h, 00h db 00h, 1Ch, 30h, 60h, 60h, 7Ch db 60h, 60h, 30h, 1Ch db 7 dup (0) db 3Eh db 7 dup (63h) db 00h, 00h, 00h, 00h, 00h, 00h db 7Fh, 00h, 7Fh, 7Fh, 00h, 7Fh db 00h, 00h, 00h, 00h, 00h, 00h db 18h, 18h, 18h,0FFh, 18h, 18h db 18h, 00h,0FFh, 00h, 00h, 00h db 00h, 00h, 30h, 18h, 0Ch, 06h db 0Ch, 18h, 30h, 00h,0FFh, 00h db 00h, 00h, 00h, 00h, 0Ch, 18h db 30h, 60h, 30h, 18h, 0Ch, 00h db 0FFh, 00h, 00h, 00h, 00h, 00h db 0Eh db 1Bh, 1Bh db 17 dup (18h) db 0D8h,0D8h, 70h, 00h, 00h, 00h db 00h, 00h, 18h, 18h, 00h, 00h db 0FFh, 00h, 00h, 18h, 18h db 7 dup (0) db 3Bh, 6Eh, 00h, 3Bh, 6Eh, 00h db 00h, 00h, 00h, 00h, 00h, 38h db 6Ch, 6Ch, 38h, 00h db 14 dup (0) db 18h, 18h db 13 dup (0) db 30h, 00h, 00h, 00h, 00h, 00h db 00h, 00h, 0Fh, 0Ch, 0Ch, 0Ch db 0Ch, 0Ch,0ECh, 6Ch, 3Ch, 1Ch db 00h, 00h, 00h, 00h,0D8h db 6Ch, 6Ch, 6Ch, 6Ch, 6Ch db 8 dup (0) db 70h,0D8h, 30h, 60h,0C8h,0F8h db 11 dup (0) db 3Ch, 3Ch, 3Ch, 3Ch, 3Ch, 3Ch db 18 dup (0) ; ; SUBROUTINE ; GetVideoMode proc near mov ah,es:video_columns_ mov al,8 mov [bp],ax mov al,es:video_page_ mov [bp+3],al retn GetVideoMode endp ; ; SUBROUTINE ; SetVideoMode proc near mov ah,es:equip_bits_ and ah,30h cmp ah,30h je loc_20 retn loc_20: mov data_26,2 push ax xor ax,ax mov byte ptr es:video_mode_,8 mov word ptr es:video_columns_,50h mov es:video_page_,al mov es:vid_curs_pos0_,ax cmp FlagH,3 jne loc_21 ; Jump if not equal mov es:vid_curs_pos1_,ax loc_21: mov es:video_segment_,ax mov word ptr es:video_buf_siz_,8000h mov Flag,al mov si,offset data_27 mov cx,0Eh mov ah,0 cli ; Disable interrupts mov dx,3B8h mov al,data_26 out dx,al ; port 3B8h, MDA video control call sub_6 mov dx,3BFh mov al,FlagH out dx,al ; port 3BFh, Hercules config mov cx,14h call sub_19 pop ax test al,80h jnz loc_23 ; Jump if not zero mov ax,0B000h push es mov es,ax xor di,di ; Zero register xor ax,ax ; Zero register mov cx,8000h cmp FlagH,3 je loc_22 ; Jump if equal shr cx,1 ; Shift w/zeros fill loc_22: rep stosw ; Rep when cx >0 Store ax to es:[di] pop es loc_23: mov dx,3B8h mov al,data_26 or al,8 mov data_26,al out dx,al ; port 3B8h, MDA video control retn SetVideoMode endp ; ; SUBROUTINE ; sub_4 proc near call TestHerc mov [bp+6],dx retn sub_4 endp ; ; SUBROUTINE ; TestHerc proc near ; ஢ઠ 稥 㫥 ; 室: dl = ff - 㫥 ; dl = 02 - Hercules in Color ; dl = 01 - Hercules+ ; dl = 00 - Hercules mov dx,3BAh in al,dx ; port 3BAh, MDA/EGA vid status, 6845 chip and al,70h ; 0111 0000 뤥 ⮢ ⨯ 㫥 ; (see [Interrupt List]) ; 000 = adapter is Hercules or compatible ; 001 = adapter is Hercules+ ; 101 = adapter is Hercules InColor ; else: adapter is unknown cmp al,50h ; 0101 0000 (Hercules InColor) jne @@24 mov dl,2 jmp short @@ret db 90h @@24: cmp al,10h jne @@25 mov dl,1 jmp short @@ret db 90h @@25: ; ஢ઠ 襣 3BA mov dx,3BAh mov cx,0FFFFh in al,dx ; port 3BAh, MDA/EGA vid status mov bl,al @@loop: in al,dx ; port 3BAh, MDA/EGA vid status xor al,bl test al,80h jnz @@27 ; loop @@loop ; த ; ergo - 㫥 mov dl,0FFh jmp short @@ret @@27: ; , 㫥 - ᮢ⨬ xor dl,dl @@ret: mov dh,FlagH shr dh,1 retn TestHerc endp public TestHerc ; ; SUBROUTINE ; sub_6 proc near cli ; Disable interrupts locloop_29: mov dx,3B4h mov al,ah out dx,al ; port 3B4h, MDA/EGA reg index ; al = 0, horiz char total inc dx lodsb ; String [si] to al out dx,al ; port 3B5h, MDA/EGA indxd data inc ah loop locloop_29 ; Loop if cx > 0 sti ; Enable interrupts retn sub_6 endp db 0 ; ; SUBROUTINE ; SetPage proc near mov ah,data_26 and ah,7Fh xor cx,cx ; Zero register and al,1 jz loc_30 ; Jump if zero dec al cmp FlagH,3 jne loc_30 ; Jump if not equal inc al mov cx,8000h or ah,80h loc_30: mov data_26,ah mov es:video_page_,al mov es:video_segment_,cx push ax mov dx,3B8h mov al,ah out dx,al ; port 3B8h, MDA video control pop ax xor ah,ah ; Zero register shl ax,1 ; Shift w/zeros fill mov di,ax mov bx,es:vid_curs_pos0_[di] retn SetPage endp ; ; SUBROUTINE ; SetCurPos proc near xor ax,ax ; Zero register mov al,bh and ax,1 shl ax,1 ; Shift w/zeros fill mov di,ax mov es:vid_curs_pos0_[di],dx retn SetCurPos endp ; ; SUBROUTINE ; GetCurPos proc near xor ax,ax ; Zero register mov al,bh shl ax,1 ; Shift w/zeros fill mov di,ax mov dx,es:vid_curs_pos0_[di] mov [bp+6],dx mov cx,es:vid_curs_mode_ mov [bp+4],cx retn GetCurPos endp ; ; SUBROUTINE ; SetCur proc near mov es:vid_curs_mode_,cx retn SetCur endp db 0 ; ; SUBROUTINE ; WriteSym proc near mov bh,1 jmp loc_44 ; External Entry into Subroutine GetSymAttr: mov bl,bh xor bh,bh ; Zero register mov cx,0B800h or bl,bl ; Zero ? jnz loc_31 ; Jump if not zero mov cx,0B000h push cx loc_31: shl bx,1 ; Shift w/zeros fill mov bx,es:vid_curs_pos0_[bx] mov al,bh xor ah,ah ; Zero register mul data_44 ; ax = data * al push ax xor bh,bh ; Zero register mov cx,bx shl bx,1 ; Shift w/zeros fill shl bx,1 ; Shift w/zeros fill shl bx,1 ; Shift w/zeros fill add cx,bx pop dx call sub_20 mov di,cx mov bl,dl neg bl add bl,7 pop es xor cx,cx ; Zero register mov cl,0Eh mov si,offset data_45 mov dx,1 locloop_32: mov ah,es:[di] mov al,es:[di+1] xchg cx,bx shl ax,cl ; Shift w/zeros fill xchg cx,bx mov [si],ah inc si rol al,1 ; Rotate or dh,al xor al,ah not al and dl,al add di,2000h jns loc_33 ; Jump if not sign sub di,7FA6h loc_33: loop locloop_32 ; Loop if cx > 0 push dx xor cx,cx ; Zero register mov cl,0Eh mov dx,cx push ds pop es mov di,offset data_47 add di,cx mov ax,1 loc_34: push di mov si,offset data_45 repe cmpsb ; Rep zf=1+cx >0 Cmp [si] to es:[di] pop di jz loc_35 ; Jump if zero inc ax mov cx,dx add di,cx cmp ax,0FFh jbe loc_34 ; Jump if below or = xor ax,ax ; Zero register loc_35: pop dx cmp al,0B3h jbe loc_37 ; Jump if below or = cmp al,0DFh ja loc_37 ; Jump if above or dl,dl ; Zero ? jnz loc_38 ; Jump if not zero loc_36: xor ax,ax ; Zero register jmp short loc_38 loc_37: and dh,1 jnz loc_36 ; Jump if not zero loc_38: mov [bp],ax mov es,data_25 retn db 14 dup (0) ; External Entry into Subroutine Dot: mov di,0B000h test bh,1 jz loc_39 ; Jump if zero mov di,0B800h loc_39: mov es,di call sub_20 mov di,cx mov bx,dx mov bl,data_33[bx] or al,al ; Zero ? jnz loc_40 ; Jump if not zero not bl and es:[di],bl jmp short loc_ret_42 db 90h loc_40: test al,80h jz loc_41 ; Jump if zero xor es:[di],bl jmp short loc_ret_42 db 90h loc_41: or es:[di],bl loc_ret_42: retn ; External Entry into Subroutine GetPoint: mov di,0B000h test bh,1 jz loc_43 ; Jump if zero mov di,0B800h loc_43: mov es,di call sub_20 mov di,cx mov bx,dx mov bl,data_33[bx] mov al,es:[di] and al,bl neg al sbb al,al neg al mov [bp],al retn db 7 dup (0) WriteSym endp ; ; SUBROUTINE ; WriteSymAttr proc near loc_44: or cx,cx ; Zero ? jnz loc_45 ; Jump if not zero jmp loc_ret_61 loc_45: mov ah,bl push ax mov dx,0B000h test bh,1 jz loc_46 ; Jump if zero mov dx,0B800h loc_46: mov bl,bh xor bh,bh ; Zero register shl bx,1 ; Shift w/zeros fill mov bx,es:vid_curs_pos0_[bx] mov al,bh xor ah,ah ; Zero register mul data_44 ; ax = data * al push ax mov es,dx xor bh,bh ; Zero register mov ax,bx shl bx,1 ; Shift w/zeros fill shl bx,1 ; Shift w/zeros fill shl bx,1 ; Shift w/zeros fill add bx,ax mov dx,cx shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill add dx,cx mov cx,dx add cx,bx dec cx mov ax,bx shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill mov dx,cx shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill sub dx,ax inc dx mov data_29,dx xchg bx,cx ;* and bx,7 db 83h,0E3h, 07h ; Fixup - byte match neg bx ;* add bx,7 db 83h,0C3h, 07h ; Fixup - byte match mov al,data_35[bx] mov byte ptr data_41+1,al pop dx call sub_20 mov di,cx mov bx,dx mov data_43,bl mov al,data_34[bx] mov byte ptr data_41,al mov bx,data_41 or bl,bl ; Zero ? jz loc_47 ; Jump if zero dec data_29 loc_47: or bh,bh ; Zero ? jz loc_48 ; Jump if zero dec data_29 loc_48: pop ax push ax xor ch,ch ; Zero register mov cl,0Eh push cx push di test ah,80h jnz loc_53 ; Jump if not zero xor al,al ; Zero register locloop_49: push cx mov cx,data_29 mov dx,di or bl,bl ; Zero ? jz loc_50 ; Jump if zero and es:[di],bl inc di loc_50: rep stosb ; Rep when cx >0 Store al to es:[di] or bh,bh ; Zero ? jz loc_51 ; Jump if zero and es:[di],bh loc_51: mov di,dx add di,data_149e jns loc_52 ; Jump if not sign sub di,7FA6h loc_52: pop cx loop locloop_49 ; Loop if cx > 0 loc_53: mov dx,data_41 or dl,dl ; Zero ? jz loc_54 ; Jump if zero inc data_29 loc_54: or dh,dh ; Zero ? jz loc_55 ; Jump if zero not dh loc_55: pop di pop cx mov bl,data_43 inc bl pop ax xor dl,dl ; Zero register cmp al,0B3h jbe loc_56 ; Jump if below or = cmp al,0DFh ja loc_56 ; Jump if above inc dl loc_56: mul cl ; ax = reg * al mov si,offset data_47 add si,ax locloop_57: push cx lodsb ; String [si] to al or al,al ; Zero ? jz loc_59 ; Jump if zero mov ah,dl and ah,al ror ah,1 ; Rotate mov cl,bl rol ax,cl ; Rotate push di mov cx,data_29 locloop_58: xor es:[di],ah mov bh,al shr ax,1 ; Shift w/zeros fill or ah,bh inc di loop locloop_58 ; Loop if cx > 0 and ah,dh xor es:[di],ah pop di loc_59: add di,2000h jns loc_60 ; Jump if not sign sub di,7FA6h loc_60: pop cx loop locloop_57 ; Loop if cx > 0 push cs pop ds mov es,data_25 loc_ret_61: retn WriteSymAttr endp db 12 dup (0) ; ; SUBROUTINE ; ScrollUp proc near mov bl,bh push bx sub dh,ch inc dh sub dh,al mov byte ptr data_30,dh xor ah,ah ; Zero register mul data_44 ; ax = data * al mov data_32,ax sub dl,cl inc dl xor dh,dh ; Zero register mov byte ptr data_30+1,dh mov ax,0Eh mov bx,ax mul byte ptr data_30 ; ax = data * al mov data_30,ax mov ax,bx mul ch ; ax = reg * al push ax mov ax,dx shl dx,1 ; Shift w/zeros fill shl dx,1 ; Shift w/zeros fill shl dx,1 ; Shift w/zeros fill add dx,ax mov data_29,dx xor ch,ch ; Zero register mov ax,cx shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill add cx,ax mov ax,cx pop dx mov bx,dx call sub_20 mov di,cx mov dx,bx add dx,data_32 mov cx,ax call sub_20 mov si,cx push ax xor bh,bh ; Zero register mov bl,dl mov cl,data_34[bx] add ax,data_29 dec ax mov dx,ax and ax,7 neg ax add ax,7 mov bx,ax mov ch,data_35[bx] mov data_41,cx shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill pop ax shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill sub dx,ax inc dx or cl,cl ; Zero ? jz loc_62 ; Jump if zero dec dx loc_62: or ch,ch ; Zero ? jz loc_63 ; Jump if zero dec dx loc_63: mov data_29,dx mov bx,data_41 mov cx,0B800h test byte ptr es:video_page_,1 jnz loc_64 ; Jump if not zero mov cx,0B000h loc_64: mov es,cx mov ds,cx xor cx,cx ; Zero register add cx,cs:data_32 jnz loc_65 ; Jump if not zero mov cx,cs:data_30 jmp short loc_71 db 90h loc_65: mov cx,cs:data_30 locloop_66: push cx push si push di or bl,bl ; Zero ? jz loc_67 ; Jump if zero mov ah,es:[di] and ah,bl lodsb ; String [si] to al not bl and al,bl not bl or al,ah stosb ; Store al to es:[di] loc_67: mov cx,cs:data_29 rep movsb ; Rep when cx >0 Mov [si] to es:[di] or bh,bh ; Zero ? jz loc_68 ; Jump if zero mov ah,es:[di] and ah,bh lodsb ; String [si] to al not bh and al,bh not bh or al,ah stosb ; Store al to es:[di] loc_68: pop di pop si add si,2000h jns loc_69 ; Jump if not sign sub si,7FA6h loc_69: add di,data_147e jns loc_70 ; Jump if not sign sub di,7FA6h loc_70: pop cx loop locloop_66 ; Loop if cx > 0 mov cx,cs:data_32 loc_71: pop si locloop_72: push cx push di or bl,bl ; Zero ? jz loc_73 ; Jump if zero mov ah,es:[di] and ah,bl mov dx,si not bl and dl,bl not bl or ah,dl xchg ah,al stosb ; Store al to es:[di] loc_73: mov cx,cs:data_29 mov ax,si rep stosb ; Rep when cx >0 Store al to es:[di] or bh,bh ; Zero ? jz loc_74 ; Jump if zero mov ah,es:[di] and ah,bh mov dx,si not bh and dl,bh not bh or ah,dl xchg ah,al stosb ; Store al to es:[di] loc_74: pop di add di,2000h jns loc_75 ; Jump if not sign sub di,7FA6h loc_75: pop cx loop locloop_72 ; Loop if cx > 0 push cs pop ds mov es,data_25 retn ScrollUp endp ; ; SUBROUTINE ; ScrollDn proc near mov bl,bh push bx sub dh,ch inc dh add ch,dh dec ch sub dh,al mov byte ptr data_30,dh xor ah,ah ; Zero register mul data_44 ; ax = data * al mov data_32,ax sub dl,cl inc dl xor dh,dh ; Zero register mov byte ptr data_30+1,dh mov ax,0Eh mov bx,ax mul byte ptr data_30 ; ax = data * al mov data_30,ax mov ax,bx mul ch ; ax = reg * al add ax,0Dh push ax mov ax,dx shl dx,1 ; Shift w/zeros fill shl dx,1 ; Shift w/zeros fill shl dx,1 ; Shift w/zeros fill add dx,ax mov data_29,dx xor ch,ch ; Zero register mov ax,cx shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill shl cx,1 ; Shift w/zeros fill add cx,ax mov ax,cx pop dx mov bx,dx call sub_20 mov di,cx mov dx,bx sub dx,data_32 mov cx,ax call sub_20 mov si,cx push ax xor bh,bh ; Zero register mov bl,dl mov cl,data_34[bx] add ax,data_29 dec ax mov dx,ax and ax,7 neg ax add ax,7 mov bx,ax mov ch,data_35[bx] mov data_41,cx shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill shr dx,1 ; Shift w/zeros fill pop ax shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill shr ax,1 ; Shift w/zeros fill sub dx,ax inc dx or cl,cl ; Zero ? jz loc_76 ; Jump if zero dec dx loc_76: or ch,ch ; Zero ? jz loc_77 ; Jump if zero dec dx loc_77: mov data_29,dx mov bx,data_41 mov cx,0B800h test byte ptr es:video_page_,1 jnz loc_78 ; Jump if not zero mov cx,0B000h loc_78: mov es,cx mov ds,cx xor cx,cx ; Zero register add cx,cs:data_32 jnz loc_79 ; Jump if not zero mov cx,cs:data_30 jmp short loc_85 db 90h loc_79: mov cx,cs:data_30 locloop_80: push cx push si push di or bl,bl ; Zero ? jz loc_81 ; Jump if zero mov ah,es:[di] and ah,bl lodsb ; String [si] to al not bl and al,bl not bl or al,ah stosb ; Store al to es:[di] loc_81: mov cx,cs:data_29 rep movsb ; Rep when cx >0 Mov [si] to es:[di] or bh,bh ; Zero ? jz loc_82 ; Jump if zero mov ah,es:[di] and ah,bh lodsb ; String [si] to al not bh and al,bh not bh or al,ah stosb ; Store al to es:[di] loc_82: pop di sub di,2000h jns loc_83 ; Jump if not sign add di,data_148e loc_83: pop si sub si,2000h jns loc_84 ; Jump if not sign add si,7FA6h loc_84: pop cx loop locloop_80 ; Loop if cx > 0 mov cx,cs:data_32 loc_85: pop si locloop_86: push cx push di or bl,bl ; Zero ? jz loc_87 ; Jump if zero mov ah,es:[di] and ah,bl mov dx,si not bl and dl,bl not bl or ah,dl xchg ah,al stosb ; Store al to es:[di] loc_87: mov cx,cs:data_29 mov ax,si rep stosb ; Rep when cx >0 Store al to es:[di] or bh,bh ; Zero ? jz loc_88 ; Jump if zero mov ah,es:[di] and ah,bh mov dx,si not bh and dl,bh not bh or ah,dl xchg ah,al stosb ; Store al to es:[di] loc_88: pop di sub di,2000h jns loc_89 ; Jump if not sign add di,7FA6h loc_89: pop cx loop locloop_86 ; Loop if cx > 0 push cs pop ds mov es,data_25 retn ScrollDn endp db 7 dup (0) ; ; SUBROUTINE ; tty proc near mov cl,bl xor bx,bx ; Zero register mov bl,es:video_page_ shl bx,1 ; Shift w/zeros fill mov dx,es:vid_curs_pos0_[bx] cmp al,7 je loc_91 ; Jump if equal cmp al,8 je loc_92 ; Jump if equal cmp al,0Ah je loc_94 ; Jump if equal cmp al,0Dh je loc_93 ; Jump if equal mov bl,cl mov cx,1 mov bh,es:video_page_ call WriteSymAttr xor bx,bx ; Zero register mov bl,es:video_page_ shl bx,1 ; Shift w/zeros fill mov dx,es:vid_curs_pos0_[bx] inc dl cmp dl,50h ; 'P' jge loc_95 ; Jump if > or = loc_90: mov bh,es:data_40 call SetCurPos jmp short loc_ret_97 db 90h loc_91: mov ah,0Eh pushf ; Push flags call OldVec10h jmp short loc_ret_97 db 90h loc_92: cmp dl,0 je loc_ret_97 ; Jump if equal dec dl jmp short loc_90 loc_93: xor dl,dl ; Zero register jmp short loc_90 loc_94: mov cx,19h dec cl cmp dh,cl je loc_96 ; Jump if equal inc dh jmp short loc_90 loc_95: xor dl,dl ; Zero register mov cx,19h dec cl cmp dh,cl jge loc_96 ; Jump if > or = inc dh jmp short loc_90 loc_96: mov bh,es:data_40 call SetCurPos mov ax,1 xor cx,cx ; Zero register xor bh,bh ; Zero register mov dx,184Fh call ScrollUp loc_ret_97: retn tty endp db 10 dup (0) ; ; SUBROUTINE ; sub_19 proc near mov dx,3BAh locloop_98: in al,dx ; port 3BAh, MDA/EGA vid status or al,al ; Zero ? js loc_99 ; Jump if sign=1 jmp short locloop_98 loc_99: in al,dx ; port 3BAh, MDA/EGA vid status or al,al ; Zero ? jns loc_100 ; Jump if not sign jmp short loc_99 loc_100: loop locloop_98 ; Loop if cx > 0 retn sub_19 endp ; ; SUBROUTINE ; sub_20 proc near push si mov si,dx shl si,1 ; Shift w/zeros fill mov dx,data_36[si] push cx shr cx,1 ; Shift w/zeros fill shr cx,1 ; Shift w/zeros fill shr cx,1 ; Shift w/zeros fill add cx,dx pop dx ;* and dx,7 db 83h,0E2h, 07h ; Fixup - byte match neg dx ;* add dx,7 db 83h,0C2h, 07h ; Fixup - byte match pop si retn sub_20 endp db 15 dup (0) ; ; MAIN ; StayResident: ; ஢ઠ, 㦥 १? mov dl,0FFh mov ah,0EFh int 10h cmp dl,0FFh mov dx,offset s_already jne AlreadyStayResident call TestHerc ; ஢ઠ 稥 㫥 cmp dl,0FFh jne HercPresent mov dx,offset s_not_herc AlreadyStayResident: mov ah,9 int 21h ; DOS Services display char string at ds:dx xor ax,ax int 20h ; DOS program terminate HercPresent: ; 㥬 ப 䫠 cld xor cx,cx mov cl,80h jcxz loc_105 mov di,data_3e ; = 81H - ப PSP loc_104: mov al,2Fh ; '/' repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al jcxz loc_105 mov al,[di] ; 䫠 and al,0DFh ; uppercase cmp al,48h ; 'H' jne loc_104 mov FlagH,1 ; H 䫠 /H loc_105: ; save old vector of int 10h push es xor ax,ax mov es,ax ; ES:=0 mov bx,es:Vec10h ; bx := 0:40 mov word ptr OldVec10h,bx mov bx,es:Vec10h+2 mov word ptr OldVec10h+2,bx ; set new vector of unt 10h cli mov word ptr es:Vec10h,offset Trap10h mov es:Vec10h+2,cs sti pop es mov ah,9 mov dx,offset s_OK int 21h ; ; calculate resident memory mov dx,offset StayResident ; 1A20h mov cl,4 shr dx,cl ; Shift w/zeros fill inc dx mov ax,3100h int 21h ; TSR al=return code,dx=paragraphs s_OK db 'Hercules Resident Video Support Routines. Version 1.10',0Dh,0Ah db '$' s_already db 'Hercules Video Support Routines are already installed.',0Dh,0Ah db '$' s_not_herc db 'Hercules Video Card not present.',0Dh,0Ah db 'Hercules Video Support Routines not installed.', 0Dh, 0Ah, '$' seg_a ends end start src/kernel/debug.mac0100664000076500007650000000062405717143710014135 0ustar prool2prool2 extrn debugl:near extrn debuge:near debug macro P1,P2 ifidn , push ax mov ax,P2 call debugl pop ax else ifidn , mov al,'E' else mov al,'B' endif call debuge endif endm src/kernel/app.com0100664000076500007650000002234206761267572013663 0ustar prool2prool2.0!.,ڣ   .! > Njع&=87u&U=u Yu aC&8uր̀ى  +>#s>#8&r(>#r"G;r>#t>#u;wډ  +؎JW!_ҋ3.%8&+%5  %6 6 6 P.[%LF! 5!  5!  5!  5!  %ʎں6!% !% !% !% ! ô@!ù .PJUVW;r9& rM!PDD~ts"PDD3PDD"P^w u^w"PPDD"P^w u^w"PtPDD3"PP=uƆPP u t=t/#PP u뼸#PP u3륍P#PP u7=Eu|=Bur=Cuj =Su`Ɔ 'P$#PP u PP1Wi=t^w"P\S DDJ DD=u^w*#P5PLDD3PDDD_^]UVv |XvW6F#H# ރ#wF#ƣ ^]U #%## u###vY].).+ 2&@Ň֓6 > r 2v%+r`،ЎQI2ً݇ËCwr@w< t< t< u2 tB uC2I,"t"<\u<"uI Y.+ Cۋ+r. v6 t3F.&) QGY t$ 36 ) up3?&8uU># uF#㉇%#3]UVW~E$&;u$&u$&w$&D_^]UVW~F)5F@|"&;u6"&~u_^]UVF3%RPYYu3"&DF@6"&"&^]UVF3%RPYYu36&&6"&F@^]UVW~ tv3Z %>&&uWYB6$& t1׃(;r WVYY$;rVYt;6$&uWY_^]UFԁ;s 3  ]UFV ȁ u ;s  ]UvY]UFRP]UVWv3FFFFtv3PQ }VRY vv2 }pFWvYY |Y3PV]YYFt! tF% PPV7 tV~ttPPv  |t3ׁ ‹㉇$_^]UVNu uV"N =!rF% ㉇$P^]UVW^7ƉF^G@t^ G? uFN uF_^]UVvV Y tL~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t3F_^]UVW~WcYWVv* t ފG_^]UVWNv~؎D2M2+3_^]Stack overflow! $Ȏغ* !UP3PPv]Turbo-C - Copyright (c) 1988 Borland Intl.Divide error Abnormal program termination 8&8&8&APP - Assembler PreProcessor Version 0.0.0.0 9-Feb-95 Copyright (C) by Serge Pustovoitoff, 1995. prool@infocom.kharkov.ua, 2:461/35 Syntax: app input_file output_file rCan't open input file %s wCan't open output file %s include debug.mac Can't write output file %s ifndef ??version endif ?debug shortCan't close output file %s ### # ##C#B##$$.$>$N$^$n$~$$$$$$$   @TMP.$$$print scanf : floating point formats not linked (null)0123456789ABCDEF       src/kernel/dev_con.c0100664000076500007650000000027606423501204014140 0ustar prool2prool2#include #include #include "kernel.h" int console_read (int minor) { return getch(); } int console_write (int minor, int byte) { return putch (byte); } src/kernel/int0.c0100664000076500007650000000027706330460500013376 0ustar prool2prool2#include #include #include "kernel.h" void interrupt Int0(void) { puts("\nInterrupt 0 - IMHO, divide by zero\n"); #if 0 loop(); #else getch(); #endif } src/kernel/d2p.c0100664000076500007650000000176505745245044013231 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ char *DirToPath(struct dirent far *Dir, char *path) {char c, far *cc, *ret; int i; unsigned len; #ifdef DEBUG printf("D2P: dir=%s ",(*Dir).d_name); #endif if (Dir==NULL) return NULL; if (path==NULL) return NULL; ret=path; if ((*Dir).Attr.B.Attr1) { cc=memchr((*Dir).d_name,' ',11); if (cc==NULL) len=11; else len=(int)(cc-(*Dir).d_name); memcpy(path,(*Dir).d_name,(len>11)?11:len); path[len]=0; } else { for(i=0;i<8;i++) if ((c=(*Dir).d_name[i])!=' ') *path++=c; else break; if ((*Dir).d_name[8]!=' ') { *path++='.'; for (i=8;i<11;i++) if ((c=(*Dir).d_name[i])!=' ') *path++=c; else break; } *path=0; strlwr(ret); } #ifdef DEBUG printf(" path=%s ",ret); #endif return ret; } src/kernel/int8.c0100664000076500007650000004473006704463010013414 0ustar prool2prool2/*************************BEGIN**********************************************/ /* #define DEBUG */ #include #include #include "kernel.h" void start(char *cmd); unsigned char c=0; unsigned int unique_pid=1; jmp_buf int8_point; int current_pid=0; int sema_ps=0; /****************************************************************************/ int sema_lock (int far *sema) { __cli__(); if (*sema==0) { *sema=1; __sti__(); return 0; /* locked OK */ } __sti__(); return 1; /* no locked */ } /****************************************************************************/ void sema_unlock (int far *sema) { __cli__(); if (*sema==1) *sema=0; __sti__(); } /****************************************************************************/ int generate_pid (void) { return unique_pid++; } /****************************************************************************/ int load_file(char far *name, char huge *adr) {int h, i; #ifdef DEBUG printf("load_file: `%Fs'\n",name); #endif if ((h=open(name,O_RDONLY))==-1) { printf("load_file: Can't open `%Fs'\n",name); return 1; } while (1) { i=(int)read(h, (void far *)adr, SECTOR_SIZE); if (i!=SECTOR_SIZE) break; adr+=SECTOR_SIZE; } close(h); return 0; } /****************************************************************************/ void ps_ (void) {int i; printf("current_pid=%i\n",current_pid); printf( "# PID status mem0 cs ip ds es ax ss sp flag cmd stacktop\n" ); for (i=0;i or s \n"); return; } chdir("/bin"); printf("command=%s\n",cmd); create_process(cmd); /* create_process("sh"); */ /* create_process("p1"); */ /* create_process("p2"); */ /* create_process("p3"); */ for (i=0;i #include #include #include #include /* #define DEBUG */ extern int CluSize; int CluRead (int drive, unsigned int CluNo, void far * buffer) {int i; #ifdef DEBUG printf("\nCluRead=%u ",CluNo); #endif i=absread (TR(drive), CluSize,SecForClu(CluNo), buffer); return i; }src/kernel/ohw.asm0100664000076500007650000000074205706254176013674 0ustar prool2prool2; ohw locals _TEXT segment byte public 'CODE' assume cs:_TEXT extrn ohb:near ohw proc ; 뢮 ᫮ HEX-. 室: ᫮ ax. ; ॣ ࠭. ; 뢠 ணࠬ ohb push ax ; . ࠤ al. mov al,ah call ohb pop ax ; . al. call ohb ret ohw endp public ohw _TEXT ends end src/kernel/out_iv.c0100664000076500007650000000025306076535416014043 0ustar prool2prool2#include #include #include "kernel.h" int OutIntVector (int i) { return printf("%2x %4x:%4x\n",i,FP_SEG(getvect(i)),FP_OFF(getvect(i))); } src/kernel/c0.asm0100664000076500007650000001363707007576360013406 0ustar prool2prool2; Startup module for Proolix kernel (similar to Turbo C 2.0's c0t.obj and ; similar to UNIX's crt.o) ; History ; 0.0.2.15 2-Nov-99 add BeforeSS, BeforeSP ; 0.0.2.14 17-May-97 ; 0.0.2.13 28-Apr-97 ⫮ 让 裡 ⥬, ; ⪮஢ Turbo C 2.0 small, ; DS=SS, 뫮 DS!=SS ; 0.0.2.12 28-Apr-97 ; 0.0.2.11 21-Apr-97 ; 0.0.2.10 20-Apr-97 ⫮ 让 mov SP, ... ; 0.0.2.9 22-Mar-97 ; 0.0.2.8 8-Mar-97 ; 0.0.2.7 3-Mar-97 ; 0.0.2.6 2-Mar-96 ; 0.0.2.5 2-Feb-96 ; 0.0.2.4 14-Oct-96 ; 0.0.2.3 29-Sep-96 ; 0.0.2.2 16-May-96 ; 0.0.2.1 11-May-96 砫 control-break ; 0.0.2.0 21-Apr-96 _execexe ; 0.0.1.5 3-Apr-96 ; 0.0.1.4 31-Mar-96 ; 0.0.1.3 24-Mar-96 ; 0.0.1.2 18-Mar-96 ; 0.0.1.1 17-Mar-96 ; 0.0.1.0 14-Mar-96 for EXE kernel ; 0.0.0.15 5-Nov-95 for com kernel ; 0.0.0.15 4-Nov-95 ; 0.0.0.14 15-Jan-95 ; . 뢮 ᨬ १ ROM BIOS. chr1 macro sym ; Not worked in graph mode (registr bl - background color!) ; NO SAVE REGS !!! mov ax,0e00h+sym int 10h endm chr1 sayr macro str ; NO SAVE REGS !!! ; ப, 筠 ப say. 쪮 say ᯮ 㭪 9h ; , sayr - 㭪 ROM BIOS (㭪 0eh 뢠 10h) ; ᪨ ० ࠡ⠥ mov si,offset str call sayr_proc endm sayr extrn _errno:word extrn _More:word extrn _NLine:word extrn _HeadCnt:word extrn _TrkSecs:word extrn _CurrentDevice:word StackTopPar equ 0fffh _TEXT segment byte public 'CODE' DGROUP group _DATA,_BSS assume cs:_TEXT,ds:DGROUP ; ,ss:DGROUP .8086 _Begin: ; mov DX,DGROUP mov dx,_DATA mov DGROUP@,dx mov DS,dx cli mov SS,dx mov SP,StackTopPar shl 4 sti mov ax,ES:[4] mov _CurrentDevice,ax extrn _saycsip:near call _saycsip extrn _main:near jmp _main DGROUP@ dw 0 public DGROUP@ KernelSS dw 0 KernelSP dw 0 _UserSS dw 0 _UserDS dw 0 UserSP dw 0 SaveAX dw 0 _Trace dw 0 _Succ dw 0 public _UserSS public _UserDS public _Trace public _Succ _stackend proc near mov ax,DGROUP@ add ax,StackTopPar ret _stackend endp public _stackend _kernel_begin proc near mov ax,seg _Begin ret _kernel_begin endp public _kernel_begin extrn _Mode:word extrn _User:word _execpix proc near push bp mov bp,sp push ax push bx push cx push dx push si push di push DS push ES mov ax,word ptr [bp+6] ; segm ; exec(), 뤠 ० (_Mode=0, SS=70h) ந 室 ; ० 짮⥫ (_Mode=1, SS=User's SS) ; exec(), 뤠 ० 짮⥫, ந ० ; ( 㦭 த㬠 , exec ந室 ⮫쪮 ; ० ᫮ 室 ० 짮⥫) ; SAVE SS SP CLI mov CS:KernelSS,SS mov CS:KernelSP,SP mov CS:_Mode,1 STI mov DS,ax mov ES,ax mov word ptr CS:@@seg,ax mov bx,0fffeh sub bx,word ptr [bp+8] ; 0fffeh - len ; save Return address in PSP mov cx,offset Return mov ES:[12],cx mov cx,CS mov ES:[14],cx CLI mov SS,ax mov SP,bx STI ; EXEC! JMP dword ptr StartAddr ; 뫮 CALL Return: public Return ; RESTORE SS SP CLI mov SS,CS:KernelSS mov SP,CS:KernelSP mov CS:_Mode,0 STI pop ES pop DS pop di pop si pop dx pop cx pop bx pop ax pop bp ret StartAddr dw 102h @@seg dw 0 ; seg _execpix endp public _execpix _WritePhysSec proc ; int WritePhysSec (unsigned char drive, unsigned char sec, unsigned char head, ; unsigned char trk, char *Buffer); ; ALL REGS SAVED push bp mov bp,sp push bx push cx push dx push ES push DS pop ES mov dl,byte ptr [bp+ 4] ; drive mov cl,byte ptr [bp+ 6] ; sec mov dh,byte ptr [bp+ 8] ; head mov ch,byte ptr [bp+10] ; trk mov bx,word ptr [bp+12] ; Buffer mov ax,0301h; Fn=03, Write 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: ; mov ax,-1 @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _WritePhysSec endp public _WritePhysSec _TEXT ends _DATA segment word public 'DATA' ; System call table _SysTable label word public _SysTable include syskern.asm _DATA ends _BSS segment word public 'BSS' _NearBuffer db 512 dup ('.') ; for absread.c. public _NearBuffer ; 㦭 ᥪ ࠭ 64k _BSS ends public _Begin end _Beginsrc/kernel/msdos.asm0100664000076500007650000000143606100463636014215 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _msdos proc extrn _RestoreVec:near ; 뢠 cli call _RestoreVec sti xor ax,ax mov ES,ax ; Read MBR mov dl,80h ; drive mov dh,0 ; head mov cl,1 ; sec mov ch,0 ; trk mov al,1 ; sec count mov ah,2 ; Fn read mov bx,7c00h int 13h nop jc @@reboot ;jmp 0:7c00 db 0eah dw 7c00h dw 0 @@reboot:; jmp ffff:0 db 0eah dw 0 dw 0ffffh _msdos endp public _msdos _TEXT ends end src/kernel/msh.c0100664000076500007650000001232606272502000013306 0ustar prool2prool2/* Mouse shell for Proolix (aka Desktop for Proolix) */ #include #include "kernel.h" #include #include #include "msh.h" void help(void); void ladder(void); /*---------------------------------------------------------------------------*/ void msh_pause(long int L) {long int k; for ( k=0 ; k < L ; k++); } /*---------------------------------------------------------------------------*/ void drebezg(void) { /* while (kbhit())getch();*/ } /*---------------------------------------------------------------------------*/ void msh_ident(void) { gotoxy(20,0); printf("\007XProolix for BK-0010 ;) Ver. 0.0.0.6 4-Mar-94"); /* History 0.0.0.6 4-Mar-94 - ᤥ ࠢ ࠡ com-⠬ 0.0.0.5 2-Mar-94 - ࠢ ࠡ com-⠬ ஫ (. bios.c) 0.0.0.4 1-Mar-94 0.0.0.3 27-Feb-94 - . ਩ kernel.c 0.0.0.2 25-Feb-94 0.0.0.1 25-Feb-94 - ᥡ ᨨ, 뫠 㦥 ஢ kharkov.friends */ } /*---------------------------------------------------------------------------*/ void atsay(int x, int y, char * str) { gotoxy(x,y); printf(str); } /*---------------------------------------------------------------------------*/ void attr(void) {unsigned int i,j; for (i=0;i<16;i++) for (j=0;j<16;j++) { gotoxy(i,j); textattr(j+(i<<4)); putch('*'); } } /*---------------------------------------------------------------------------*/ void icon(struct DeskTop Desk [], int i) { gotoxy(Desk[i].x,Desk[i].y); printf(Desk[i].Name); } /*---------------------------------------------------------------------------*/ int execm(void) { int i; int k, b, MaxFolder; long ii; unsigned int j; char far *rec; int Chars; int Files; struct dirent far *D; if (CurrentDevice==-1) {puts("No mount"); return -1;} for(i=0;i"); } else goto br; */ } else if (Files #include #include "kernel.h" void nulldev (void) { } /****************************************************************************/ void FDDstrategy (void) { } /****************************************************************************/ void HDDstrategy (void) { } src/kernel/cold.asm0100664000076500007650000000050706402353232014002 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _cold proc near mov ax,40h mov ds,ax mov bx,72h mov [bx],4321h db 0eah ; JMP F000:FFF0 dw 0fff0h,0f000h _cold endp public _cold _TEXT ends end src/kernel/conv.c0100664000076500007650000001406006134544354013500 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ char HexDigit [] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int Divisor8 [] = {0100000, 010000, 01000, 0100, 010, 1}; int Divisor10 [] = {10000, 1000, 100, 10, 1}; long Divisor10L [] = {1000000000L, 100000000L, 10000000L, 1000000L, 100000L, 10000L, 1000L, 100L, 10L, 1L}; long Divisor8L [] = {010000000000L, 01000000000L, 0100000000L, 010000000L, 01000000L, 0100000L, 010000L, 01000L, 0100L, 010L, 01L}; int htoi(const char far *s) { int i; char c; i=0; while (*s) { i<<=4; c=toupper(*s++); if ((c>='0')&&(c<='9')) i+=c-'0'; else if ((c>='A')&&(c<='F')) i+=c+10-'A'; else return 0; } return i; } /****************************************************************************/ long htol(const char far *s) { long i; char c; i=0; while (*s) { i<<=4; c=toupper(*s++); if ((c>='0')&&(c<='9')) i+=c-'0'; else if ((c>='A')&&(c<='F')) i+=c+10-'A'; else return 0; } return i; } /****************************************************************************/ int atoi(const char far *s) { int i; char c; i=0; if (*s=='+') s++; else if(*s=='-')return-atoi(++s); while (*s) { c=*s++; if (isdigit(c)) {i=i*10; i+=c-'0';} else break; } return i; } /****************************************************************************/ long atol(const char far *s) { long i; char c; i=0; if (*s=='+') s++; else if(*s=='-')return-atol(++s); while (*s) { c=*s++; if (isdigit(c)) {i=i*10; i+=c-'0';} else break; } return i; } /****************************************************************************/ #if 0 void fuck1(void) { int Divisor [] = {10000, 1000, 100, 10, 1}; printf("fuck1 = %04X\n",Divisor[0]); } #endif /****************************************************************************/ char far *itoa (int w, char far *str, int radix) { char far *ret; int i, r, pow, n; /* printf("itoa = %04X\n",Divisor10[0]); */ if (radix>34) radix=34; ret=str; if (w<0) if (radix==10) {*str++='-'; itoa(-w,str,-10); return ret;} switch(radix) { case 2: for (i=0;i<16;i++) {*str++='0'+ w & 0x8000; w<<=1;} break; case 8: for (i=0;i<6;i++) {r=w/Divisor8[i]; w%=Divisor8[i]; *str++='0'+r;} break; case 16: for (i=0;i<4;i++) {*str++=HexDigit[(w&0xF000)>>12];w<<=4;} break; case 10: *str++='0'; for (i=0;i<5;i++) {r=w/Divisor10[i]; w%=Divisor10[i]; *str++='0'+r; #ifdef DEBUG printf("itoa: Divisor10[i]=%04X r=%04X w=%04X\n", Divisor10[i],r,w); #endif } break; case -10: for (i=0;i<5;i++) {r=w/Divisor10[i]; w%=Divisor10[i]; *str++='0'+r; } break; default: pow=UINT_MAX; for (i=1;i<16;i++) {pow/=radix; if (pow>0) break;} n=i; pow=1; for (i=1;i34) radix=34; ret=str; if (w<0) if (radix==10) {*str++='-'; ltoa(-w,str,-10); return ret;} switch(radix) { case 2: for (i=0;i<32;i++) {*str++='0'+ w & 0x8000; w<<=1;} break; case 8: for (i=0;i<11;i++) {r=w/Divisor8L[i]; w%=Divisor8L[i]; *str++='0'+r;} break; case 16: for (i=0;i<8;i++) {*str++=HexDigit[(int)((w&0xF0000000L)>>28)];w<<=4;} break; case 10: *str++='0'; for (i=0;i<10;i++) {r=w/Divisor10L[i]; w%=Divisor10L[i]; *str++='0'+r; } break; case -10: for (i=0;i<10;i++) {r=w/Divisor10L[i]; w%=Divisor10L[i]; *str++='0'+r; } break; default: pow=ULONG_MAX; for (i=1;i<32;i++) {pow/=radix; if (pow>0) break;} n=i; pow=1; for (i=1;i34) radix=34; ret=str; switch(radix) { case 2: for (i=0;i<32;i++) {*str++='0'+ w & 0x8000; w<<=1;} break; case 8: for (i=0;i<11;i++) {r=w/Divisor8L[i]; w%=Divisor8L[i]; *str++='0'+r;} break; case 16: for (i=0;i<8;i++) {*str++=HexDigit[(int)((w&0xF0000000L)>>28)];w<<=4;} break; case 10: *str++='0'; for (i=0;i<10;i++) {r=w/Divisor10L[i]; w%=Divisor10L[i]; *str++='0'+r; } break; case -10: for (i=0;i<10;i++) {r=w/Divisor10L[i]; w%=Divisor10L[i]; *str++='0'+r; } break; default: pow=ULONG_MAX; for (i=1;i<32;i++) {pow/=radix; if (pow>0) break;} n=i; pow=1; for (i=1;i #include #include "../include/conf.c" #define BUFSIZE 160 int main(int argc, char *argv[]) { int i, j ,k, FlagN; FILE *table, *kernel, *util, *make; char Table [] = "syscall.tbl"; char KLib [] = "syskern.asm"; char buf [BUFSIZE]; char s1 [BUFSIZE]; char s2 [BUFSIZE]; char s3 [BUFSIZE]; char Module [BUFSIZE]; char Proc [] = "\ ; Do not edit this file.\n\ ; This file is automatically generated\n\n\ \tmodel tiny\n\ \t.code\n\ %s:\tmov\tax,%i\n\ \tint\t0%02Xh\n\ \tret\n\ \tpublic\t%s\n\ \tend\n"; char do_not_edit [] = "\ %s Do not edit this file.\n\ %s This file is automatically generated\n\n"; if (argc<2) { puts("usage: gentbl CommandSourcePath [-n]\n\ -n - no overwrite existing modules *.asm"); return 1; } if (argc==3) if (!strcmp(argv[2],"-n")) FlagN=1; else FlagN=0; puts("\n\tGenTbl v. 0.0.0.3 24-Mar-96 Generate System Calls\n"); /* History 0.0.0.3 24-Mar-96 0.0.0.2 13-Dec-95 */ buf[0]=0; if((table=fopen(Table,"rt"))==NULL) {printf("Can't open %s\n",Table);return 2;} if((kernel=fopen(KLib,"wt"))==NULL) {printf("Can't open %s\n",KLib);return 2;} sprintf(Module,"%s\\syscall.h",argv[1]); if((make=fopen(Module,"wt"))==NULL) {printf("Can't open %s\n",Module);return 2;} if(fprintf(make,do_not_edit,";",";")==EOF) {printf("Can't write %s\n",Module);return 2;} if(fprintf(make,"INT_NO\tequ\t0%02Xh\n",INT_NO)==EOF) {printf("Can't write %s\n",Module);return 2;} if(fprintf(kernel,do_not_edit,";",";")==EOF) {printf("Can't write %s\n",KLib);return 2;} for(i=0;;) { if(fgets(buf,BUFSIZE,table)==NULL) break; switch (buf[0]) { case '\n': case ' ' : case ';' : case 0 : continue; } s3[0]=0; sscanf(buf,"%s %s %s",s1,s2,s3); if (!s3[0]) strcpy(s3,s1); if(fprintf(kernel,"extrn\t%s:near\ndw\t%s,_TEXT:%s\n",s3,s2,s3)==EOF) {printf("Can't write %s\n",KLib);return 2;} if(fprintf(make,"%s\tequ\t%03i\n",s1+1,i)==EOF) {printf("Can't write %s\n",Module);return 2;} sprintf(Module,"%s\\%03i.ASM",argv[1],i); if (FlagN) if((util=fopen(Module,"rt"))!=NULL) { fclose(util); printf("System Call %03i %013s existing. Not rewrited.\n",i,s1); goto LL; } if((util=fopen(Module,"wt"))==NULL) {printf("Can't open %s\n",Module);return 2;} if(fprintf(util,Proc,s1,i,INT_NO,s1)==EOF) {printf("Can't write %s\n",Module);return 2;} if(fclose(util)) {printf("Can't close %s\n",Module);} if (strcmp(s1,s3)) printf("System Call %03i %s %s\n",i,s1,s3); else printf("System Call %03i %s\n",i,s1); LL: i++; } if(fclose(table)) {printf("Can't close %s\n",Table); } if(fclose(kernel)) {printf("Can't close %s\n",KLib); } if(fclose(make)) {printf("Can't close %s\n",Module); } puts(""); sprintf(Module,"%s\\tlib.cmd",argv[1]); printf("Generate %s\n",Module); if((make=fopen(Module,"wt"))==NULL) {printf("Can't open %s\n",Module);return 2;} for (j=0;j #include #include "kernel.h" void interrupt Int5(void) { /* puts("\nInterrupt 5 - U pressed PrintScreen key\n"); */ } src/kernel/ppt.c0100664000076500007650000000311506501347644013336 0ustar prool2prool2void process_partition_table (char far *MBRBuf) { struct MBRstru far *MBR; char ExtBuf [SECTOR_SIZE]; int i; MBR=(void far *)MBRBuf; for (i=0; i<4; i++) { if (MBR->Partition[i].system_indicator) { if (NextDrivePartition[i].begin_head; Devices[NextDrive].sec=MBR->Partition[i].begin_sec; Devices[NextDrive].trk=MBR->Partition[i].begin_cyl; Devices[NextDrive].system_indicator=MBR->Partition[i].system_indicator; switch(MBR->Partition[i].system_indicator) { case 1 : Devices[NextDrive].FileSystem=FAT12; break; case 4 : case 6 : Devices[NextDrive].FileSystem=FAT16; break; default: Devices[NextDrive].FileSystem=NO_FAT; } switch(MBR->Partition[i].system_indicator) { case EXTEND: case EXTEND2: Devices[NextDrive].dos_disk=' '; break; default: Devices[NextDrive].dos_disk=NextDOSDrive++; } Devices[NextDrive].ResSecs=MBR->Partition[i].preceding_sec + 1; Devices[NextDrive].MaxSectors=MBR->Partition[i].total_sec +Devices[NextDrive].ResSecs; NextDrive++; if((MBR->Partition[i].system_indicator==EXTEND)||(MBR->Partition[i].system_indicator==EXTEND2)) { /* extended partition */ if (ReadPhysSec2 (_HDD_,MBR->Partition[i].begin_sec, MBR->Partition[i].begin_head,MBR->Partition[i].begin_cyl,ExtBuf)) printf ("boot: extend boot sector read error\n"); process_partition_table(ExtBuf); } } } } } src/kernel/regdump.asm0100664000076500007650000000430006611216522014521 0ustar prool2prool2; Register dump _TEXT segment byte public 'CODE' assume cs:_TEXT sayr macro str ; ᪨ ० ࠡ⠥ push si lea si,str ; 뫮 mov si,offset str call sayr_proc pop si endm sayr chr1 macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) ; NO SAVE REG mov al,sym mov ah,0eh int 10h endm chr1 extrn sayr_proc:near extrn ohw:near _saycsip proc near ; REG SAVED push ax push DS chr1 'i' chr1 'p' chr1 '=' push CS pop ax call ohw chr1 ':' call ll ll: pop ax call ohw chr1 ' ' chr1 'd' chr1 's' chr1 '=' push DS pop ax call ohw push CS pop DS sayr s_ax pop ax push ax call ohw sayr s_bx mov ax,bx call ohw sayr s_cx mov ax,cx call ohw sayr s_dx mov ax,dx call ohw sayr s_si mov ax,si call ohw sayr s_di mov ax,di call ohw sayr s_ss mov ax,SS call ohw sayr s_sp mov ax,SP add ax,6 ; ࠢ SP ( ⮬ call saycsip push) call ohw sayr s_es mov ax,ES call ohw sayr s_bp mov ax,BP call ohw pop DS pop ax ret ;s0 db 13,10,"CS:IP=",0 s_ax db ' ax=',0 s_bx db ' bx=',0 s_cx db ' cx=',0 s_dx db ' dx=',0 s_si db ' si=',0 s_di db ' di=',0 s_ss db ' SS=',0 s_sp db ' SP=',0 s_ds db ' DS=',0 s_es db ' ES=',0 s_bp db ' BP=',0 _saycsip endp public _saycsip _TEXT ends end src/kernel/videopag.c0100664000076500007650000000031506375636646014344 0ustar prool2prool2#include #include #include "kernel.h" void new_video_page (char page) { union REGS regs; regs.h.ah=5; regs.h.al=page; regs.x.flags=0; int86(0x10,®s,®s); } src/kernel/kernel0100664000076500007650000007204307010271762013571 0ustar prool2prool2MZ#;CR!PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reservedq{@%" rj;;r ! Not enough memory$- -%P#3WDːS9ڌ͋€ƋNN++؎Ŏu38ABHMSghirJts33JtJtӀs(JtӅtJtӀr JtӀ w}. 3ۃt*Jtr#JtJtJuӀs./V+^uJuӀrJuӀrJuӁ뻀JuӀrJuӀ wE.tZȀSO3SU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Fpi= l# PIADtus%b0qcE ipd eaxsE sflag(m[d48s'= UnCont&l AèldDel> I_1TrAZaQ2n-ps k1 (NMI)^$4$OH `ap6(iopco5(186,23K7-bYaPS50+A@A IMHO,v`idz~o&ne| RXENIX /u>6E^DLARGE0HPFS/NTOS5A*'h'%h832XLBV AHL(PUS0/2"7{aqinSwapPhotthn95l}0vHECpTheodR0QMagicRh n?uxRhnk8ODB"LpP/,|Z8 GiBKxiampSpeedStysVёeDH(C/ɝhQNM։pExNAmoebaq _"~LBSDX/ IT ODR GNxnx#-rvv/oHN+0p0unknCS:IP =:L FL=S DS S&S)P :abs: l(\ >=Ss.z)lu 8hg%}1՞ eIgn9 (i),pt9g(r)lc:i(a ?'! has'υp|!H|L/ !DasJa8ä99:;%V<G_p.KTjOBclB: zrkF \@hb7fD%<Rt{MVa)DMA(aulbRD j(p 64K;D:i e. A2t'OCCRC(.EC! ixX!t̍{k@ek\),P!Timeri9U>hHned<+eIZgal_p%2xx:?=ƧQmoUsE4[-l]LQUHFETM] Swit0 θ.)loڗL(yU#ist$8urd!icj~sHK c)|'Fspl M +2iGb*i- QNamet Attr )hAk@s1 DaWLend7 Vs U - g=ovvr u.N.f]$>MAX_LENs_STRptfv*#'%c' i z& w :( ~-+N00I'c+FNhlL+Modifz_Q7ҔouxXfeEgGcspn%^3,%ty7()!su!ppo8thcsai"xH . PESICgCt,!k'nyke./{er$t|FyBux7Jonʹ< LЍCFj)(//.T8"ar<Õ"٧B@cwd:EINVAL RANGE"  Ix<CclszWƕwU : URu˶Vo`xx(90'Gebs barcC Rf`? L4 Z BegPl8#'AxCl RASco1x2Hn153r6li 4\6i5Lp2[makPHOMEch敗 4y]|n C]Lqzon|00;N⺰ =T/Ic%:7Sh( Bnl6! Qm?sç ;; - @ٍ's68in sh A=T` pi,' >sϺ/\W"!qŔzx1W^}->w$ ny ID\s.DcgȤ=f[tʞ st urnVUo 'Bl ^5hh XY(gh[E<mso4\rtynclmv^m0MjABiJ`zs4/maIac*TUaUG~z.-kx[q(@x CurDi<(jXT)4ubtV&KIo)cE{CM-!^w~i_ D% aBFOhhyd_z0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&@'nʚ; @Bn "e6/RTVkY;! ;@KR }t g ;Zx0Nm22 PFATES#TDTX9+*q# I 0 U i G\ F #,#((@(&N&***- 0246B6]68::::m:J:'::9;BAA.CCCjEVEU\`E` `_but`ކ̊z% nPޭdzvWlMڱb,۰1贱uVsrc/kernel/proolix.doc0100664000076500007650000001061006312103204014526 0ustar prool2prool2 樮 ⥬ Proolix - 㬥 1. 㫨 㫨 稭 ਪ 楫 ਪ 㭨娭 (igor@ktts.kharkov.ua). ⥬ ᪠ , 楢 UNIX- 樮 ⥬? ࠧ, ᠭ , 訫 . Hᠫ T&K UNIX ᪮쪮 楢! ⥯, ᠭ, । ⠢ 㤭, , ࠡ (⥬ , 㫨ᮬ ᢮ ६ 祭 ॣ୮), 㢫 ᮡ. 2. 㫨 㢨 室 㫨 . ਯ뢠 .設 । ᠭ 㫨 ਭ ⥣᪨ ᪨ 訡... 襭. ᫥饬: POSIX. 㫨 㤥 POSIX-ᮢ⨬. ⢥ ᠭ ⠭ POSIX ᯮ짮  ७ .஢ 类 .., .., ਤ .. 쭠 樮 ⥬: ࠢ筨 - .: , 19916 208 . ( 쭥襬 뫠 ⠪ - []) 쭮. ᠭ 㫨 ᯮ짮 設-ᨬ 権 ᥬ (⮫쪮 ⠬, ⮣ ). 饬, , ७ 㫨 設 㯭 (ਬ, ). 易 ⥬, ⮡ ᤥ ᥡ । ணࠬ஢ ࠡ - ࠡ ᨤ ᮫ 486 IP-ନ, , 㬮, ᪮ AT. ⮬ 386 ᯮ ( ;) 㫨 㤥 ⮫쪮 ணࠬ ॠ 筮, 㠫쭮 (᫥⢨ 㤥 ஢ ᥬ) Turbo C 2.0. ⢥ 㬥⠫쭮 ( ࠢ筮 ।⢠ ;) ᯮ TC 2.0. ࠡ 㦥 ਢ , Borland C++ 稢 , ⥬ , 쥪⭮ ਥ஢ ணࠬ஢. ૠ᪨ த⮢ , , ⠬ ᥣ 訡 ᠬ UNIX- ANSI-ᮢ⨬ । . ᯮ짮 - ⮥ (Watcom ਬ), 㪨 室. 뫠, ࢤ, - UNIX gcc gcc for DOS... 뫠 ++ 쥪⭮-ਥ஢ ... -. ⢥ cc gcc 㫨 㤥 祭 ᪮, ⮬ ணࠬ 㫨 ஢ MSDOS' 2.0. ( 㫨 㤥 ᢮ ᥬ pas (Proolix ASsembler)). ⨬ MS DOS. ⫠ 㫨 ᮧ ᮡ⢥ ࠧ imho 楫ᮮࠧ, ⮬ 砫 ᯮ짮 䠩 MS DOS, ਢ ⨥ 裡 ln (chkdsk ndd 뫪 䠩 㣠, ᫨ 䠩 ᪮쪨 ﬨ MSDOS' ⮫쪮 , ᮧ 㤠 㫨ᮬ, imho  㤥, chkdsk (fchk) 㫨 ᢮) ᯮ ᯮ㥬 ⠫ ࠭ UNIX ࠬ஢ 䠩 ( , ࠢ 㯠, த - ਬ୮ ⠪ 䠩 ⥬ OS/2 䠩 ⥬ ). BIOS. ᮧ 㤭 ஬ ᠭ , 訫 ᨬ쭮 ᯮ짮 ⮢묨 ࠧࠡ⪠. , ࠩ ன -뢮 (, ᯫ, 䫮, ) , ᯮ짮 맮 ROM BIOS. ஡ ॥ࠡ쭮 "筮" BIOS, imho , ࣠ ⨢ ⠪ BIOS ⠪, ⮡ ਬ, 뫮 ७ ⮣ int 13h. src/kernel/loop.asm0100664000076500007650000000027206330460434014034 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _loop proc ; hlt ; cli @@l: jmp @@l _loop endp public _loop _TEXT ends end src/kernel/char_out.c0100664000076500007650000000420006664342742014337 0ustar prool2prool2#include #include #include #include "kernel.h" #define NormalColor 14 #define Inverse 0x70 /*==========================================================================*/ /* #define DEBUG */ /*==========================================================================*/ int sema_putch=0; /*==========================================================================*/ #if 1 int mputch(int c) { while (sema_lock(&sema_putch)==1); PutchBIOS(c); sema_unlock(&sema_putch); return c; } #endif /****************************************************************************/ int Puts1 (const char far *str) {int i; char c; while((c=*str++)!=0) if ((i=mputch(c))==EOF) return EOF; return i; } /****************************************************************************/ int putch(int c) { switch (c) { case '\n': mputch('\r'); mputch('\n'); #if 1 if (More) if (++NLine>MAX_LINE) { NLine=1; Puts1("more"); if (More==2) Puts1(". Press ESC for quit, or anykey for continue"); if ((c=getch())==ESC) {errno=EFAULT; return EOF; } else { errno=0; mputch('\r'); mputch('\n'); return '\n'; } } else ; else ; #endif break; case 9: /* TAB */ mputch(' '); break; default: return mputch(c); } return c; } /****************************************************************************/ int putchar (int c) { return putch(c); } /****************************************************************************/ int Puts0 (const char far *str) {int i; char c; while((c=*str++)!=0) if ((i=putch(c))==EOF) return EOF; return i; } /****************************************************************************/ int puts (const char far *str) { if (str==NULL) return puts("(null)"); if(Puts0(str)==EOF)return EOF; return Puts0("\n"); } src/kernel/clrscr.asm0100664000076500007650000000143206125260764014360 0ustar prool2prool2 include macros.asm _TEXT segment byte public 'CODE' assume cs:_TEXT _clrscr proc near push ax push bx push cx push dx push BP ; ࠭ BP, ; 맮 int 10h sub bh,bh mov ah,08h int 10h mov bl,bh mov bh,ah sub cx,cx mov dx,184Fh mov ax,0600h int 10h mov bh,bl sub dx,dx mov ah,02h int 10h pop BP pop dx pop cx pop bx pop ax ret _clrscr endp public _clrscr _TEXT ends end src/kernel/stream.c0100664000076500007650000001107306335413206014021 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ int mflag(const char far *mode) {int flag; if (mode==NULL) return O_RDONLY; if (*(mode+1)!='+') { switch (*mode) { case 'w': flag=O_WRONLY|O_CREAT|O_TRUNC; break; case 'a': flag=O_WRONLY|O_CREAT|O_TRUNC|O_APPEND; break; case 'r': default : flag=O_RDONLY; } } else { switch (*mode) { case 'w': flag=O_RDWR|O_CREAT|O_TRUNC; break; case 'a': flag=O_RDWR|O_CREAT|O_TRUNC|O_APPEND; break; case 'r': flag=O_RDWR; break; default : flag=O_RDONLY; } } return flag; } /****************************************************************************/ FILE far *fopen (const char far *path, const char far *mode) {int h; FILE far *fp; if((h=open(path, mflag(mode)))==-1)return NULL; fp=FCBS; fp+=h; return fp; } /****************************************************************************/ FILE far *freopen (const char far *path, const char far *mode, FILE far *stream) { fclose(stream); if(open2 (fileno(stream), path, mflag(mode))==-1)return NULL; return stream; } /****************************************************************************/ FILE far* fdopen (int h, char far *type) {FILE far *fp; fp=FCBS; fp+=h; FCBS[h].flag=mflag(type); return fp; } /****************************************************************************/ int fileno (const FILE far *stream) {FILE far *fp; fp=FCBS; if (stream==NULL) return -1; return (int)(stream-fp); } /****************************************************************************/ int fgetc (FILE far *stream) {int h; char c; h=fileno(stream); if (h==-1) return EOF; if (read(h,&c,1)==1) return c; return EOF; } /****************************************************************************/ char far *_gets (char far *s) { #include "gets.inc" } /****************************************************************************/ char *fgets (char *s, int n, FILE far *stream) { #include "fgets.inc" } /****************************************************************************/ char far *_fgets (char far *s, int n, FILE far *stream) { #include "fgets.inc" } /****************************************************************************/ int fputc (int c, FILE far *stream) { switch((int)write(fileno(stream),&c,1)) { case 1: return c; case 0: /* eof */ case -1: default: return EOF; } } /****************************************************************************/ int fputs (const char far *s, FILE far *stream) { return (int)fwrite(s,1,strlen(s),stream); } /****************************************************************************/ size_t fread (void far *ptr, size_t size, size_t n, FILE far *stream) { long int i; if ((size==0)||(n==0))return 0; i=read(fileno(stream),ptr,size*n); if (i>=0) return i/size; return -1; } /****************************************************************************/ size_t fwrite (const void far *ptr, size_t size, size_t n, FILE far *stream) { long int i; if ((size==0)||(n==0))return 0; i=write(fileno(stream),ptr,size*n); if (i>=0) return i/size; return -1; } /****************************************************************************/ long ftell (FILE far *stream) { return tell(fileno(stream)); } /****************************************************************************/ int fseek (FILE far *stream, long offset, int wh) { if (lseek(fileno(stream),offset,wh)==-1) return -1; return 0; } /****************************************************************************/ int fsetpos (FILE far *stream, const fpos_t far *pos) { return fseek(stream, *pos, SEEK_SET); } /****************************************************************************/ int fgetpos (FILE far *stream, fpos_t far *pos) { if((*pos=ftell(stream))==-1)return -1; return 0; } /****************************************************************************/ void rewind (FILE far *stream) { (void)fseek(stream,0L,SEEK_SET); } /****************************************************************************/ int fclose (FILE far *stream) { if (close(fileno(stream))==-1) return EOF; else return 0; } /****************************************************************************/ #pragma warn -par int fflush (FILE far *stream) { return FlushAll(); } #pragma warn +par /****************************************************************************/ src/kernel/strdup.c0100664000076500007650000000060006075154006014042 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ char far *strdup(const char far *s) {char far *new; /* if (s==NULL) return NULL; */ if ( (new=malloc(strlen(s))) != NULL ) strcpy(new,s); return new; } /****************************************************************************/ src/kernel/dir.c0100664000076500007650000002111106657325064013311 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ char far *GetUpDir(unsigned int dir_inode, char far *tail) { char b1 [PATH_MAX+1]; char b2 [NAME_MAX+1]; if (dir_inode==0) { strcpy(b1,"/"); strcat(b1,tail); return b1; } else {struct dirent far *D; DIR far *dir; if (chdir("..")==-1) return NULL; if ((dir=opendir("."))==NULL) return NULL; for(;;) { if ((D=readdir(dir))==NULL) break; if ((*D).d_fileno==dir_inode) { strcpy(b1,DirToPath(D,b2)); if (strlen(tail)!=0) { strcat(b1,"/"); strcat(b1,tail); } return (closedir(dir)==EOF)?NULL:GetUpDir(CurDirClu,b1); } } closedir(dir); return NULL; } } /****************************************************************************/ char Buf2 [PATH_MAX+1]; /****************************************************************************/ char far *getcwd (char far *buf, int buflen) { char far *cc; int SaveDir; if (buf==NULL) goto L_INVAL; else if (buflen<=0) {L_INVAL: printf("getcwd:EINVAL\n"); errno=EINVAL; return NULL;} else if (buflen<(PATH_MAX+1)) {printf("getcwd:ERANGE\n"); errno=ERANGE; return NULL;} #ifdef DEBUG printf("getcwd: CurDirClu=%i\n", CurDirClu); #endif if (CurDirClu!=0) { SaveDir=CurDirClu; if ((cc=GetUpDir(CurDirClu,""))==NULL) return NULL; strcpy(Buf2,cc); #ifdef DEBUG printf("getcwd: Buf2=%s\n",Buf2); printf("getcwd: cc=%Fs\n",cc); #endif CurDirClu=SaveDir; } else { strcpy(Buf2,"/"); } #ifdef DEBUG printf("pwd=%s\n",Buf2); #endif strncpy(buf,Buf2,buflen); #ifdef DEBUG printf("pwd=%Fs\n",buf); #endif return buf; } /****************************************************************************/ int chdir (const char far *path) {int i, h, SaveDir; char far *cc; char LocalDir0 [PATH_MAX+1]; char LocalDir [PATH_MAX+1]; #ifdef DEBUG printf("chdir to `%Fs'\n",path); #endif if (path==NULL) {errno=ENOENT; return -1;} if (*path==0) return 0; strncpy(LocalDir0, path, PATH_MAX+1); #ifdef DEBUG printf("LocalDir0="); printf(LocalDir0); printf("\n"); #endif /* Transform: "/usr/bin/" -> "/usr/bin" "/" -> "/" "/usr/bin" -> "/usr/bin" */ i=(int)strlen(LocalDir0)-1; if (i!=0) if (LocalDir0[i]=='/') LocalDir0[i]=0; #ifdef DEBUG printf("LocalDir0=`%s'\n",LocalDir0); #endif SaveDir=CurDirClu; if ((cc=strchr(LocalDir0,'/'))!=NULL) { /* full pathname (with '/' separator[s] ) */ if (cc==LocalDir0) { CurDirClu=0; /* cd 1 */ } else { for (i=0; i<=PATH_MAX; i++) LocalDir[i]=0; memcpy(LocalDir,LocalDir0, ((i=(int)(cc-(char far *)LocalDir0))>PATH_MAX)?PATH_MAX:i); if (chdir(LocalDir)==-1) {CurDirClu=SaveDir; return -1; } } return chdir(cc+1); } else { /* short pathname (dirname only, without '/' separators) */ h=open(LocalDir0,O_RDONLY); if (h==-1) return -1; if (!FCBS[h].Attr.B.Dir) {close(h); errno=ENOTDIR; return -1;} CurDirClu=FCBS[h].BegClu; } close(h); return 0; } /****************************************************************************/ DIR far *opendir (const char far *dirname) {int h; DIR far *fp; if ((h=open(dirname,O_RDONLY))==-1) return NULL; if (!FCBS[h].Attr.B.Dir) {close(h); errno=ENOTDIR; return NULL;} fp=FCBS; fp+=h; return fp; } /****************************************************************************/ DIR far *openwdir (const char far *dirname) {int h; DIR far *fp; if ((h=open(dirname,O_RDWR))==-1) return NULL; if (!FCBS[h].Attr.B.Dir) {close(h); errno=ENOTDIR; return NULL;} fp=FCBS; fp+=h; return fp; } /****************************************************************************/ DIR far *openidir (int inode) {int OldCurDir; DIR far *fp; OldCurDir=CurDirClu; CurDirClu=inode; fp=openwdir("."); CurDirClu=OldCurDir; return fp; } /****************************************************************************/ struct dirent far *readdir (const DIR far *dirp) { long int i; int h; if (dirp==NULL) {errno=EBADF; return NULL;} if((h=fileno(dirp))==-1) return NULL; i=read(h,FCBS[h].Buf,32); if (i!=32) return NULL; return (struct dirent far *)(FCBS[h].Buf); } /****************************************************************************/ int writedir (const DIR far *dirp, struct dirent far *D) { long int i; int h; if (dirp==NULL) {errno=EBADF; return -1;} if((h=fileno(dirp))==-1) return -1; i=write(h,D,32); if (i!=32) return -1; return 0; } /****************************************************************************/ void rewinddir (const DIR far *dirp) { lseek(fileno(dirp),0,SEEK_SET); } /****************************************************************************/ int closedir (const DIR far *dirp) { if (close(fileno(dirp))==-1) return EOF; else return 0; } /****************************************************************************/ long telldir (const DIR far *dirp) { return tell(fileno(dirp)); } /****************************************************************************/ long seekdir (const DIR far *dirp, long offset, int wh) { return lseek(fileno(dirp),offset,wh); } /****************************************************************************/ int dircmp (struct dirent d1, struct dirent d2) { #ifdef DEBUG {int i; printf("dircmp: d1=<"); for (i=0;i<11;i++) printf("%c",d1.d_name[i]); printf(">_d2=<"); for (i=0;i<11;i++) printf("%c",d2.d_name[i]); printf("> "); } #endif if (d1.Attr.B.Attr1) { if (d2.Attr.B.Attr1) { return memcmp(d1.d_name,d2.d_name,11); } else { return -1; } } else { if (d2.Attr.B.Attr1) { return -1; } else { return memcmp(d1.d_name,d2.d_name,11); } } } /****************************************************************************/ #pragma warn -par int mkdir (const char far *path, mode_t mode) {int i, j, h, err; struct dirent Pattern [2]; if ((h=open(path,O_CREAT|O_EXCL|O_WRONLY))==-1) return -1 ; FCBS[h].Attr.U=FA_DIREC; FCBS[h].File=2; for (i=0; i<11; i++) {Pattern[0].d_name[i]=' '; Pattern[1].d_name[i]=' '; } Pattern[0].d_name[0]='.'; Pattern[1].d_name[0]='.'; Pattern[1].d_name[1]='.'; Pattern[0].Attr.U=FA_DIREC; Pattern[1].Attr.U=FA_DIREC; Pattern[0].Size=0L; Pattern[1].Size=0L; Pattern[1].d_fileno=CurDirClu; Pattern[0].FileDateTime.ft_hour = FCBS[h].FileDateTime.ft_hour ; Pattern[0].FileDateTime.ft_min = FCBS[h].FileDateTime.ft_min ; Pattern[0].FileDateTime.ft_tsec = FCBS[h].FileDateTime.ft_tsec ; Pattern[0].FileDateTime.ft_day = FCBS[h].FileDateTime.ft_day ; Pattern[0].FileDateTime.ft_month = FCBS[h].FileDateTime.ft_month ; Pattern[0].FileDateTime.ft_year = FCBS[h].FileDateTime.ft_year ; Pattern[1].FileDateTime.ft_hour = FCBS[h].FileDateTime.ft_hour ; Pattern[1].FileDateTime.ft_min = FCBS[h].FileDateTime.ft_min ; Pattern[1].FileDateTime.ft_tsec = FCBS[h].FileDateTime.ft_tsec ; Pattern[1].FileDateTime.ft_day = FCBS[h].FileDateTime.ft_day ; Pattern[1].FileDateTime.ft_month = FCBS[h].FileDateTime.ft_month ; Pattern[1].FileDateTime.ft_year = FCBS[h].FileDateTime.ft_year ; for (j=0; j<2; j++) for (i=0;i<10;i++) Pattern[j].Reserv[i]=0; if (write(h, Pattern, 2*32)==2*32) err=0; else {err=1; goto l_cl; } Pattern[0].d_fileno=FCBS[h].BegClu; if (lseek(h,0,SEEK_SET)==-1L) return -1; if (write(h, Pattern, 2*32)==2*32) err=0; else {err=1; goto l_cl; } /* Pattern[0].d_name[0]=0xE5; for(i=2;i<(CluSize*SECTOR_SIZE/32);i++) { if (write(h, Pattern, 32)==32) err=0; else {err=1; goto l_cl; } } */ l_cl: if (close(h)==-1) err++; return err?-1:0; } #pragma warn +par /****************************************************************************/ int rmdir (const char far *path) {int i; DIR far *dir; struct dirent far *D; /* ஢ઠ, ⮩ ⠫ */ if ((dir=opendir(path))==NULL) {errno=ENOENT; return -1;} else { for(i=0;i<2;i++) { if ((D=readdir(dir))==NULL) {i=errno; closedir(dir); errno=i; return -1; } } for(;;) { if ((D=readdir(dir))==NULL) break; if ((*D).d_name[0]== 0) continue; if ((*D).d_name[0]==0xE5) continue; /* H 㫥 室 - ᫥⥫쭮, ⠫ , ᫥⥫쭮 㤠 */ closedir(dir); errno=EEXIST; return -1; } if (closedir(dir)==-1) return -1; } /* ⠫ */ return delete(path); } src/kernel/cp.c0100664000076500007650000000315506617052416013137 0ustar prool2prool2/*-------------------------------------------------------------------------*/ /* internal cp */ /*-------------------------------------------------------------------------*/ #include #include #include "kernel.h" void cp_help(void) { puts("usage: cp [file1] [file2]"); } int copy(char *path1, char *path2) {int h1, h2, i1, i2; long n, m; char buf [SECTOR_SIZE]; if((h1=open(path1,O_RDONLY))==-1) return -1; if (access(path2,2)==0) if (unlink(path2)) {printf("Cp: can't unlink target\n"); return -1; } if((h2=open(path2,O_WRONLY|O_CREAT|O_EXCL))==-1) {close(h1); return -1;} while(1) { if((n=read(h1,buf,SECTOR_SIZE))==-1) break; if(n==0) {m=0; break;} if((m=write(h2,buf,n))==-1) break; if (m!=n) break; } i1=close(h1); i2=close(h2); if (n==-1) return -1; if (m==-1) return -1; if (m!=n) return -1; if (i1==-1) return -1; return (i2); } void cp(int argc, char far *argv[] ) { int ii, j, n, Files=0; char path[2][PATH_MAX]; argc--; ii=1; do { if (argc) { if (argv[ii][0]=='-') { n=(int)strlen(argv[ii]); for (j=1;j2) {cp_help(); return; } } } } while (ii++ #include #include "kernel.h" /* strtol,strtoul,strtoll,strtoull convert string to long, unsigned long, long long or unsigned long long. strtoxx(char *src,char **ptr,int base) converts the string pointed to by src to an long of appropriate long and returnes it. It skips leading spaces and tabs (but not newlines, formfeeds, backspaces), then it accepts an optional sign and a sequence of digits in the specified radix. If the value of ptr is not (char **)NULL, a pointer to the character terminating the scan is returned in the location pointed to by ptr. Trailing spaces will NOT be skipped. If an error is detected, the result will be LONG_MIN, 0 or LONG_MAX, (or LONGLONG..) and errno will be set to EDOM if there are no digits ERANGE if the result would overflow. the ptr will be set to src. This file is based on the strtol from the the GNU C Library. it can be compiled with the UNSIGNED and/or LONGLONG flag set */ #include #define UNSIGNED #ifdef LONGLONG #define UTYPE_MAX (~(ulonglong) 0) #define TYPE_MIN LONGLONG_MIN #define TYPE_MAX LONGLONG_MAX #define longtype long #define ulongtype unsigned long #ifdef UNSIGNED #define function ulongtype strtoull #else #define function longtype strtoll #endif #else #define UTYPE_MAX (unsigned long) ~0L #define TYPE_MIN LONG_MIN #define TYPE_MAX LONG_MAX #define longtype long int #define ulongtype unsigned long int #ifdef UNSIGNED #define function ulongtype strtoul #else #define function longtype strtol #endif #endif #include int my_errno; /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ function (const char *nptr,char **endptr,int base) { int negative; register ulongtype cutoff; register unsigned int cutlim; register ulongtype i; register const char *s; register unsigned char c; const char *save; int overflow; if (base < 0 || base == 1 || base > 36) base = 10; s = nptr; /* Skip white space. */ while (isspace (*s)) ++s; if (*s == '\0') { goto noconv; } /* Check for a sign. */ if (*s == '-') { negative = 1; ++s; } else if (*s == '+') { negative = 0; ++s; } else negative = 0; if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X') s += 2; /* If BASE is zero, figure it out ourselves. */ if (base == 0) if (*s == '0') { if (toupper (s[1]) == 'X') { s += 2; base = 16; } else base = 8; } else base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; cutoff = UTYPE_MAX / (unsigned long int) base; cutlim = (unsigned int) (UTYPE_MAX % (unsigned long int) base); overflow = 0; i = 0; for (c = *s; c != '\0'; c = *++s) { if (isdigit (c)) c -= '0'; else if (isalpha (c)) c = toupper (c) - 'A' + 10; else break; if (c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (ulongtype) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (char *) s; #ifndef UNSIGNED /* Check for a value that is within the range of `unsigned long int', but outside the range of `long int'. */ if (negative) { if (i > (ulongtype) TYPE_MIN) overflow = 1; } else if (i > (ulongtype) TYPE_MAX) overflow = 1; #endif if (overflow) { my_errno=ERANGE; #ifdef UNSIGNED return UTYPE_MAX; #else return negative ? TYPE_MIN : TYPE_MAX; #endif } /* Return the result of the appropriate sign. */ return (negative ? -((longtype) i) : i); noconv: /* There was no number to convert. */ my_errno=EDOM; if (endptr != NULL) *endptr = (char *) nptr; return 0L; } src/kernel/txtattr.asm0100664000076500007650000000116106123033334014566 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT extrn _TextAttr:byte _textattr proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 mov al,byte ptr [bp+4] mov _TextAttr,al ; mov sp,bp pop bp ret _textattr endp public _textattr _getcolor proc near push bp mov bp,sp mov al,_TextAttr xor ah,ah ; mov sp,bp pop bp ret _getcolor endp public _getcolor _TEXT ends end src/kernel/genint.asm0100664000076500007650000000070005670566550014357 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _geninterrupt proc near push bp mov bp,sp push bx mov bl,byte ptr [bp+4] ; interrupt no mov byte ptr CS:@@cmd+1,bl jmp @@cmd @@cmd: int 0 pop bx ; mov sp,bp pop bp ret _geninterrupt endp public _geninterrupt _TEXT ends end src/kernel/mouse.asm0100664000076500007650000000034705700642002014207 0ustar prool2prool2Titlo equ ' Mouse Package for XProolix' ; _TEXT segment byte public 'CODE' assume cs:_TEXT db ' Mouse port=' _PORT dw 1 ; 1 == COM2 public _PORT _TEXT ends end src/kernel/int1b.c0100664000076500007650000000265406667570232013563 0ustar prool2prool2#include #include #include "kernel.h" void interrupt int1b (void) /* Interrupt 1B - ctrl-break pressed */ {int i; /* pushf */ /* old fl = [BP+22] */ /* push cs */ /* old cs = [BP+20] */ /* push ip */ /* old ip = [BP+18] */ /* push ax */ /* old ax = [BP+16] */ /* push bx */ /* old bx = [BP+14] */ /* push cx */ /* old cx = [BP+12] */ /* push dx */ /* old dx = [BP+10] */ /* push es */ /* old es = [BP+ 8] */ /* push ds */ /* old ds = [BP+ 6] */ /* push si */ /* old si = [BP+ 4] */ /* push di */ /* old di = [BP+ 2] */ /* push bp */ /* old BP = [BP] */ /* mov bp,DGROUP */ /* mov ds,bp */ /* mov bp,sp */ /* sub sp,2 */ asm mov ax,[BP+20]; asm mov i,ax; printf("CS:IP = %04X",i); asm mov ax,[BP+18]; asm mov i,ax; printf(":%04X",i); asm mov ax,[BP+22]; asm mov i,ax; printf(" FL=%04X",i); asm mov ax,[BP+6]; asm mov i,ax; printf(" DS=%04X",i); asm mov ax,SS; asm mov i,ax; printf(" SS:SP=%04X:",i); asm mov ax,SP; asm mov i,ax; printf("%04X",i); } src/kernel/alloc.c0100664000076500007650000001762206605261250013626 0ustar prool2prool2/* #define DEBUG_ALLOC */ /*****************************************************************************/ static unsigned int parleft(void) {int CurPar, ret; struct MemBlk far * MB; ret=0; CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); while (1) { if (!((*MB).OwnerPar)) if ((*MB).SizePar>ret)ret+=(*MB).SizePar-1; if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } return ret; } /*****************************************************************************/ static unsigned int parxtent(void) {int CurPar, ret; struct MemBlk far * MB; ret=0; CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); while (1) { if (!((*MB).OwnerPar)) if ((*MB).SizePar>ret)ret=(*MB).SizePar-1; if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } return ret; } /*****************************************************************************/ static unsigned long coreleft(void) {unsigned long l; l=parleft(); return l<<4; } /*****************************************************************************/ static unsigned long int corextent(void) {unsigned long l; l=parxtent(); return l<<4; } /*****************************************************************************/ void mem(void) {int CurPar; char c; struct MemBlk far * MB; CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); puts("\nRAM OwnPar Size"); while (1) { printf("%4X:0000 %c %4X %4X",CurPar,(c=(*MB).Type)<' '?' ':c, (*MB).OwnerPar,(*MB).SizePar); if ((*MB).Type != 'M') {puts(""); break;} CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); puts(""); } printf("Free memory %li\nMaximum free block %li\n",coreleft(), corextent()); } /****************************************************************************/ void far *malloc (size_t size) { unsigned int CurPar, NeedPar, RestosPar; struct MemBlk far * MB; struct MemBlk far * Rest; struct MemBlk MB2; if (size==0) return NULL; if (size==-1L) { size=corextent(); } NeedPar=(int)(size>>4)+1; if (size & 0xF) NeedPar++; #ifdef DEBUG_ALLOC printf("A1\n"); #endif CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); #ifdef DEBUG_ALLOC printf("A2\n"); #endif while (1) { #ifdef DEBUG_ALLOC printf("A3\n"); #endif if(!(*MB).OwnerPar) /* block is free */ if ((*MB).SizePar>=NeedPar) { /* memory yes */ #ifdef DEBUG_ALLOC printf("A11\n"); #endif MB2.Type=(*MB).Type; MB2.SizePar=(*MB).SizePar; (*MB).SizePar=NeedPar; (*MB).OwnerPar=ProcessPar; #ifdef DEBUG_ALLOC printf("malloc: ProcessPar=%04X\n",ProcessPar); #endif if (MB2.SizePar>NeedPar) {/* restos of blk */ #ifdef DEBUG_ALLOC printf("A10\n"); #endif (*MB).Type='M'; RestosPar=CurPar+NeedPar; Rest=MK_FP(RestosPar,0); (*Rest).OwnerPar=0; (*Rest).SizePar=MB2.SizePar-NeedPar; (*Rest).Type=MB2.Type; } #ifdef DEBUG_ALLOC printf("A13\n"); #endif return MK_FP(CurPar+1,0); } else ; /* no memory in this blk */ else ; /* blk is busy */ if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } #ifdef DEBUG_ALLOC printf("alloc\n"); #endif return NULL; } /*****************************************************************************/ void free ( void far * block) { size_t CurPar; struct MemBlk far * MB; if (block==0) return; block=MK_FP(FP_SEG(block) + (FP_OFF(block)>>4) -1,0); /* normalization */ CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); while (1) { if (MB==block) {(*MB).OwnerPar=0;return;} if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } } /*****************************************************************************/ unsigned int par_size_of_block ( void far * block) { size_t CurPar; struct MemBlk far * MB; if (block==0) return 0; block=MK_FP(FP_SEG(block) + (FP_OFF(block)>>4) -1,0); /* normalization */ CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); while (1) { if (MB==block) {return (*MB).SizePar;} if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } return 0xFFFF; } /*****************************************************************************/ int garbage (void) {int ret=1; size_t CurPar; int opt=1; struct MemBlk far * MB; struct MemBlk far * MB0; while(opt) { opt=0; CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); if (((*MB).Type) != 'M') return 1; MB0=MB; while (1) { CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); if ( (((*MB0).OwnerPar)==0) && (((*MB).OwnerPar)==0) ) { (*MB0).Type=(*MB).Type; (*MB0).SizePar+=(*MB).SizePar; ret=0; opt=1; } else MB0=MB; if ((*MB).Type != 'M') break; } } return ret; } /*****************************************************************************/ void far *calloc (size_t nitems, size_t size) {size_t m, i; void far *Pointer; char huge *Setter; /* . huge ? */ if ((Pointer=malloc(m=nitems*size))!=NULL) { Setter=Pointer; for(i=0;i>4) -1,0); /* normalization */ CurPar = FP_SEG(Fin) + (FP_OFF(Fin) >> 4); MB = MK_FP(CurPar,0); while (1) { if (MB==block) {/* 諨 */ goto l_found; } if ((*MB).Type != 'M') break; CurPar+=(*MB).SizePar; MB = MK_FP (CurPar,0); } /* ⠪ */ return NULL; } l_found: /* ᫨ ⪠ ࠧ ᢮ - 䨣 */ if (!MB->OwnerPar) return NULL; /* 饬 ᫥騩 */ if ((*MB).Type != 'M') MB_next=NULL; CurPar+=(*MB).SizePar; MB_next = MK_FP (CurPar,0); /* ।塞 ࠧ ࠣ */ NeedPar=(int)(size>>4)+1; if (size & 0xF) NeedPar++; if (MB->SizePar==NeedPar) return block; /* */ if (MB->SizePar>NeedPar) {/* 㬥蠥 ࠧ */ Delta=MB->SizePar-NeedPar; MB->SizePar=NeedPar; /* ᮧ -祪 */ CurPar = FP_SEG(MB) + (FP_OFF(MB) >> 4); CurPar+=MB->SizePar; MB_kusochek= MK_FP(CurPar,0); MB_kusochek->Type='M'; MB_kusochek->OwnerPar=0; MB_kusochek->SizePar=MB->SizePar-NeedPar-1; /* ᫨ ᫥騩 ⮦ ⮩, -祪 頥 */ if (!MB_next->OwnerPar) { MB_kusochek->SizePar+=(MB_next->SizePar+1); } } else {/* 㢥稢 ࠧ */ /* ᫨ ᫥騩 ᢮ - 室 */ if (MB_next->OwnerPar) return NULL; /* ᫨ ᫥ - 室 */ if (MB->Type=='Z') return NULL; /* 塞 饭 ࠧ 襣 */ Delta=NeedPar-MB->SizePar; /* ᫨ ᫥騩 室 饭 - 室 */ if (MB_next->SizeParSizePar==Delta) { MB->SizePar=NeedPar; return block; } /* 祪 ᫥饣 */ MB->SizePar=NeedPar; /* */ CurPar = FP_SEG(MB) + (FP_OFF(MB) >> 4); CurPar+=MB->SizePar; MB_kusochek= MK_FP(CurPar,0); MB_kusochek->Type=MB_next->Type; MB_kusochek->OwnerPar=0; MB_kusochek->SizePar=MB_next->SizePar-Delta; } return NULL; }src/kernel/bootred0.asm0100664000076500007650000000162306127462410014602 0ustar prool2prool2; read boot sector _TEXT segment byte public 'CODE' assume cs:_TEXT ; bootread0 (int dev, void far * buf) return 0 or ErrorCode _bootread0 proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 ; word ptr [bp+6] - argument 2 ... push bx push cx push dx push ES mov dx,word ptr [bp+4] mov bx,word ptr [bp+6] mov ES,word ptr [bp+8] mov cx,1 mov dh,0 mov ax,0201h ; Fn=02, Read 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _bootread0 endp public _bootread0 _TEXT ends end src/kernel/reboot.asm0100664000076500007650000000051506402353240014351 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _reboot proc near mov ax,40h mov ds,ax mov bx,72h mov [bx],1234h db 0eah ; JMP F000:FFF0 dw 0fff0h,0f000h _reboot endp public _reboot _TEXT ends end src/kernel/char_in.c0100664000076500007650000000475506664343110014143 0ustar prool2prool2#include #include #include #include #include #include "kernel.h" #define Norm 2 #define Inverse 0x70 /*==========================================================================*/ /* #define DEBUG */ /*==========================================================================*/ #ifdef MOUSE /*--------------------------------------------------------------------------*/ int getch(void) {int j; while ((j=getcom(PORT))==-2); /* Wait a click or move mouse (wait a byte from com port */ while (getcom(PORT)!=2); /* ⨢ ॡ */ return j; } /*--------------------------------------------------------------------------*/ int kbhit(void) {int j; j=getcomstat(PORT); if (j==-1) return 0; else return (j & 1); } /*--------------------------------------------------------------------------*/ #else /* no MOUSE */ /*--------------------------------------------------------------------------*/ char extended_kbd_code=0; /*--------------------------------------------------------------------------*/ int getch(void) {int c; if (extended_kbd_code) {c=extended_kbd_code; extended_kbd_code=0; } else { c=getch0(); if ((char)c==0) { extended_kbd_code=c>>8; c=0; if ((extended_kbd_code>='h')&&(extended_kbd_code<='o')) {/* Alt-F1 .. Alt-F8 */ new_video_page(extended_kbd_code-'h'); extended_kbd_code=0; return getch(); } } else c=(char)c; } #if CODETABLE==_RUSSIAN_ if (*KbdStatus & SCROLL_LOCK) c=Russian[c]; #endif return c; } /*--------------------------------------------------------------------------*/ int kbhit(void) { if (extended_kbd_code) return 1; else return kbhit0(); } #endif /*--------------------------------------------------------------------------*/ /****************************************************************************/ int getchar(void) {int c; /* 室 GNU file ⨫ (㭪 yesno()) ⨨ Enter '\n', '\r' MSDOS. ⠪ getchar 宬. */ c=getch(); #ifdef DEBUG putch('['); putch(c); putch(']'); #endif if (c!='\b') c=putchar (c=='\r'?'\n':c); /* '\b' - BREAK */ return c; } /****************************************************************************/ int getche (void) {int c; c=getch(); if (c<' ') if (c=='\b') return putch(c); else return c; else return putch(c); } src/kernel/ints.c0100664000076500007650000000145706501601640013504 0ustar prool2prool2#include #include #include "kernel.h" void interrupt done(void) { puts("\n INTERRUPT "); } void interrupt CtrlAltDel(void) { puts("\nU pressed Control Alt Del\n"); } void interrupt Int1(void) { puts("\nInterrupt 1 - Trace\n"); } void interrupt Int2(void) { puts("\nInterrupt 2 - Non-maskable (NMI)\n"); } void interrupt Int3(void) { /* puts("\nInterrupt 3 - Breakpoint\n"); */ } void interrupt Int4(void) { puts("\nInterrupt 4 - Overflow trap\n"); } void interrupt Int6(void) { puts("\nInterrupt 6 - Invalid opcode (186,286,386)\n"); } void interrupt Int7(void) { puts("\nInterrupt 7 - Coprocessor not available (286,386)\n"); } void interrupt Int75(void) { puts("\nInterrupt 75 - numeric coprocessor NMI error (AT,XT286,PS50+)\n"); } src/kernel/files.bbs0100664000076500007650000000334207007552516014161 0ustar prool2prool2ALLOC.C Allocate memory subprograms APP.C Assembler preprocessor APP.COM Assembler preprocessor BIOS.C bios programs C0.ASM Kernel startup code CAT.C cat - int. command CMOS.ASM CMOS timer support CONV.C see stdlib.h CS0.LIB obj modules from Turbo C 2.0 library cs.lib (long int support etc) CTYPE.C see stdlib.h DE.C Disk edit for Proolix E.C e - debug int command GENTBL.C Generate system call table - syskern.asm INT5DUMP.ASM Register dump IO.C I/O procedures KEY.ASM gets() by Igor Sazonov (for "%"-shell like c-shell ;) LS.C ls - internal command MAKEFILE Makefile ;) MEM.C See mem.h MEMD.C memd - memory dump, internal command MSH.C msh (mouse shell ;) - XProolix for mouse without keyboard NOCMOS.ASM Real clock timer without CMOS (on XT only) support OHB.ASM Output Hex Byte OHW.ASM Output Hex Word PROCESS.C Process' procedures REGDUMP.ASM Register dump SAYR.ASM Output ASCIIZ string via BIOS SH.C sh - shell (prompt "$") STDIO.C see stdio.h STDLIB.C see stdlib.h STRCHR.C string support procedures STRDUP.C string support procedures STRING.C string support procedures STRLEN.C string support procedures SYSCALL.C system call SYSCALL.TBL Source General Main Table of System Calls TIME.C Dostime package. For compatible with MSDOS VEC.C vec - int.command (show interrupt vectors) absread.c absread() abswrite.c abswrite() bootread.c bootread() bootred0.asm bootread0() char_in.c character input routines char_out.c character output routines clrscr.asm clrscr() - clear screen cluread.c CluRead() - cluster read cold.asm cold() - cold reboot reboot.asm reboot() - hot reboot comport.asm serial port routines exitw.asm Assembler utility for Proolix src/kernel/cs0.lib0100664000076500007650000001300006136524252013532 0ustar prool2prool2 LDIVGh _TEXTCODE( LUMOD@ LDIV@ LMOD@ LUDIV@3 UVWF V ^N u ti teu y ؃ y ۃ W33;r w;r+@[tƋt؃_^]t3DtLXMULh _TEXTCODE( LXMUL@Vt㑅tȖ^̊tSCOPYh _TEXTCODE( SCOPY@ UVWv~ _^]OtLLSHCh _TEXTCODE( LXLSH@#sـ ˀ3˗tLURSHh _TEXTCODE(LXURSH@4#sـ ˀ3˓tSPUSHh _TEXTCODE(' SPUSH@+[+UVWڋ~Ў_^]RS݊tCTYPE/_TEXTCODE_DATADATA_BSSBSSDGROUPDGROUP(3H H U__ctypeu !!!!! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &t TIMECVTT/_TEXTCODE_DATADATA_BSSBSSDGROUPDGROUP(6H H U> _daylight _timezone_tzset__ISDSTLXMUL@LDIV@LMOD@ _dostounix _unixtodos!UVWVF^7DFV%3FVt FQV3^GNN ^GH^~ ^uGǺ^W‰F>t ^GPW3P^NP tNF3ɻFV^3ɻ<^_RPÙ[Y^NVF_^]UVW~ v)FVE3Ҹ<RPvvE3Ҹ<RPvvVF3Ҹ<RPvv3Ҹ<RPvvVF3ҸRPvv3ҸRPvvVF~|>~P"v5nP"^3Ҹ8"RPvv3Ҹ8"RPvvVF>t<3ҸRPvvP3ҸRPvvP3PNP tFV3ҸRPvvE3ҸRPvvVFFVu.~|~ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /******************************** External variables ***********************/ #ifdef MOUSE extern unsigned int PORT; #endif /* Mode: 0 - ᫨ ࠡ⠥ , ⥬ 맮 ᪮ , 1 - ᫨ ࠡ⠥ ᪮ . User: 0 - ᫨ ࠡ⠥ , 1 - ᫨ ࠡ⠥ ᪨ ⥬ 맮 ᪮ */ int Mode, User; int HeadCnt, TrkSecs; int SectorsOnCyl, FatSize, FatCnt; unsigned int MaxClusters; unsigned long MaxSectors; /* extern unsigned int _Begin; */ extern struct {unsigned int ParNo; void (*Entry)(void);} SysTable []; extern int Trace; unsigned int MemTop; void far * Fin; int emulation_mode; /* 0 - boot from disk/diskette; */ /* 1 - boot from file under MSDOS-session Windows 95 */ /******************************** Public variables *************************/ /* char NearBuffer [512]; */ #if defined (_HERCULES_) && defined (_MON_MONO_) int TextAttr=7; #else int TextAttr=0x70; #endif int _argc; char far *_argv [MAX_ARG]; char far * far *pEnv; char far *hEnv; unsigned int Global; unsigned int Counter; char far *KbdStatus; int curX=1, curY=1, maxX=80, maxY=25; char far *curAddr; char VideoAttrib=7; /* long int Secund=0; */ #ifdef CMOS unsigned char hour, min, secund; #else unsigned long Tick; #endif unsigned char century, year, month, day, flag; #if CODETABLE==_RUSSIAN_ char Russian [256]; #endif void interrupt (*OldTimerVec) (void); unsigned long RootBeg, RootEnd, ResSecs; unsigned int CluSizeBytes; struct BufPool far *Cache; int CurrentDevice=-1; int ReadOnly; int NextDOSDrive='C'; /* ६, 㯭 ᪨ ᮢ */ int errno=0; int More=0; int NLine=1; /* */ unsigned int ProcessPar; unsigned int CluSize; unsigned long DataStart; int x, y; struct MemBlk *MB; int FATMode; FILE FCBS [OPEN_MAX]; char MasterBootRecord [SECTOR_SIZE]; char far *OldInt; FILE far *stdin ; FILE far *stdout; FILE far *stderr; /* ⠡ ᯥ樠 䠩 (䠩 ⨯ Device) */ struct DevRecord Dev [] = { /* name, major, minor, byte (1 - byte-oriented device, 0 - block-oriented) */ /* major ன⢠ ਥ஢ ਥ஢ 砥 H ன⢠. ᤥ ⠡ */ {"null", 0,0,1}, {"console", 1,0,1}, {"fd0", 0,0,0}, {"fd1", 0,1,0}, {"hd0", 1,0,0}, {"hd1", 1,1,0}, {"ttyS00", 2,0,1}, /* COM */ {"ttyS01", 2,1,1}, {"lp00", 3,0,1}, /* LPT */ {"lp01", 3,1,1}, {"mem", 4,0,1}, {"kmem", 5,0,1}, {"",-1,-1,-1} }; /* ⠡ ᯥ樠 䠩 ਥ஢ */ struct DevByte TableByte [5] = { {nulldev,nulldev,nulldev,nulldev,nulldev}, {nulldev,nulldev,nulldev,nulldev,nulldev}, {nulldev,nulldev,nulldev,nulldev,nulldev}, {nulldev,nulldev,nulldev,nulldev,nulldev}, {nulldev,nulldev,nulldev,nulldev,nulldev}, }; /* ⠡ ᯥ樠 䠩 ਥ஢ */ struct DevBlock TableBlock [2] = { /* open, close, strategy */ {nulldev,nulldev,FDDstrategy}, /* FDD */ {nulldev,nulldev,HDDstrategy}, /* HDD */ }; unsigned int CurDirClu; struct DeviceStruct Devices [LASTDRIVE]; /* Devices [0] - disk A: sec=0 if not present Devices [1] - disk B: sec=0 if not present Devices [2] - disk C: sec=0 if not present Devices [3] - disk D: sec=0 if not present ... */ /* ᮢ */ struct processes process_table [PROC_MAX]; /************************** include functions ******************************/ #include "alloc.c" #include "process.c" #include "syscall.c" void test_devices(void); void interrupt int1b(void); /**************************** Functions ************************************/ #if 0 void fuck(void) { int Divisor [] = {10000, 1000, 100, 10, 1}; printf("fuck = %04X\n",Divisor[0]); } #endif void ident(void) { printf("Proolix "); printf("%s\nCompile by Turbo C 2.01 at %s %s\n",VER,__DATE__,__TIME__); } /*---------------------------------------------------------------------------- ͻ ͻ Main function ͼ ͼ ----------------------------------------------------------------------------*/ void main (void) {int i; /* int OldSegment, OldOffset; */ Mode=0; /* kernel mode */ User=0; ProcessPar=kernel_begin(); puts("\nKernel started"); test_devices(); init(); ident(); print_mount(); #ifndef NODISK #if 1 _argv[0]="kernel.ovl"; _argv[1]="\r"; _argv[2]=NULL; if ((i=execve(_argv[0],_argv,pEnv))!=0) printf("kernel: no overlay. rc=%i ",i); #endif #ifdef _RC_ _argv[0]=_RC_; _argv[1]=NULL; execve(_argv[0],_argv,pEnv); #endif /* _RC_ */ #endif /* NODISK */ #ifdef CHANGE_INT_1B #if 0 setvect(0x1B,(void interrupt(*)(void)) sh ); #else setvect(0x1B,(void interrupt(*)(void)) int1b ); #endif #endif sh(); }src/kernel/comport.asm0100664000076500007650000000274105670566770014571 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _inicom_ proc near push bp mov bp,sp PUSH dx mov dx,word ptr [bp+4] mov al,byte ptr [bp+6] mov ah,0 int 14h POP dx ; mov sp,bp pop bp ret _inicom_ endp public _inicom_ _getcom_ proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 PUSH dx mov dx,word ptr [bp+4] mov ah,2 int 14h POP dx ; mov sp,bp pop bp ret _getcom_ endp public _getcom_ _putcom_ proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 ; 6 2 PUSH dx mov dx,word ptr [bp+4] mov al,byte ptr [bp+6] mov ah,2 int 14h POP dx ; mov sp,bp pop bp ret _putcom_ endp public _putcom_ _getcomstat_ proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 PUSH dx mov dx,word ptr [bp+4] mov ah,3 int 14h POP dx ; mov sp,bp pop bp ret _getcomstat_ endp public _getcomstat_ _TEXT ends end src/kernel/nocmos.asm0100664000076500007650000000175305670567242014401 0ustar prool2prool2Titlo equ ' NoCMOS Kernel Package ' Ver equ ' V 0.0.0.2 2-Nov-1994 ' ; CMOS & Real Time Clock asm functions for Proolix's Kernel _TEXT segment byte public 'CODE' assume cs:_TEXT _ReadTick proc near push bp mov bp,sp push bx push cx push dx ; word ptr [bp+4] - argument 1 ; 6 2 ; ... ; int ReadTick (unsigned long *Tick, char *Flag) mov ah,0 int 1ah jc @@ret ; error mov bx,word ptr [bp+4] mov word ptr [bx],dx mov word ptr [bx+2],cx mov bx,word ptr [bp+6] mov byte ptr [bx],al xor ax,ax jmp @@ret @@err: mov ax,1 @@ret: pop dx pop cx pop bx ; mov sp,bp pop bp ret _ReadTick endp public _ReadTick _TEXT ends end src/kernel/setjmp.asm0100664000076500007650000000716706502066120014372 0ustar prool2prool2 .8086 _TEXT segment byte public 'CODE' assume cs:_TEXT ; include macros.asm ; int setjmp(jmp_buf jmpb) _setjmp proc far ; SP = old SP - 6 (2 bytes - jmpb addr, 4 bytes - ; retf addr) push bp ; SP = old SP - 8 mov bp,sp ; BP = old SP - 8 ; old BP = [BP] ; old IP = [BP+2] ; old CS = [BP+4] ; jmpb addr = [BP+6] pushf ; SP = old SP - 12 ; flag = [BP- 2] push ax ; SP = old SP - 14 ; ax = [BP- 4] push bx ; SP = old SP - 16 ; bx = [BP- 6] push cx ; SP = old SP - 18 ; cx = [BP- 8] push dx ; SP = old SP - 20 ; dx = [BP-10] push si ; SP = old SP - 22 ; si = [BP-12] push di ; SP = old SP - 24 ; di = [BP-14] push ds ; SP = old SP - 26 ; ds = [BP-16] push es ; SP = old SP - 28 ; es = [BP-18] ; mov ax,SETJMP_DATA ; mov ds,ax mov bx,word ptr [bp+6] ; bx - adress of jmpb mov ax,BP add ax,8 mov word ptr [bx+ 0],ax ;j_sp mov word ptr [bx+ 2],ss ;j_ss mov ax,[BP-2] mov word ptr [bx+ 4],ax ;j_flag mov ax,[BP+4] mov word ptr [bx+ 6],ax ;j_cs mov ax,[BP+2] mov word ptr [bx+ 8],ax ;j_ip mov ax,[BP] mov word ptr [bx+10],ax ;j_bp mov word ptr [bx+12],di ;j_di mov ax,[BP-18] mov word ptr [bx+14],ax ;j_es mov word ptr [bx+16],si ;j_si mov word ptr [bx+18],DS ;j_ds mov ax,[BP-4] mov word ptr [bx+20],ax ;j_ax mov ax,[BP-6] mov word ptr [bx+22],ax ;j_bx mov word ptr [bx+24],cx ;j_cx mov word ptr [bx+26],dx ;j_dx pop es pop ds pop di pop si pop dx pop cx pop bx pop ax popf xor ax,ax pop bp ret _setjmp endp ; void _Cdecl longjmp(jmp_buf jmpb, int retval); _longjmp proc far mov bp,sp ; chr1 'Q' mov bx,word ptr [bp+4] ; bx - adress of jmpb cli mov ax,[bx] ; j_sp mov SP,ax mov ax,[bx+2] ; j_ss mov SS,ax sti push word ptr [bx+ 4] ;j_flag push word ptr [bx+ 6] ;j_cs push word ptr [bx+ 8] ;j_ip push word ptr [bx+10] ;j_bp push word ptr [bx+12] ;j_di push word ptr [bx+14] ;j_es push word ptr [bx+16] ;j_si push word ptr [bx+18] ;j_ds push word ptr [bx+20] ;j_ax push word ptr [bx+22] ;j_bx push word ptr [bx+24] ;j_cx push word ptr [bx+26] ;j_dx ; chr1 'q' pop dx pop cx pop bx pop ax pop ds pop si pop es pop di pop bp IRET ; == {pop ip; pop cs; popf} _longjmp endp _TEXT ends public _longjmp public _setjmp end src/kernel/nextclu.c0100664000076500007650000000434606761542150014221 0ustar prool2prool2#include #include #include #include "kernel.h" /* NextClu(), NextClu2() - next cluster number compute and load to Cache) */ /* NextClu() - kernel's internal module */ /* NextClu2() - boot manager internal module */ /* ᮢ뢠 NextClu() NextClu2() ! */ unsigned int NextClu (unsigned int CluNo) /* -1 for eof or error */ { unsigned long j; unsigned int nsect, offset, b; unsigned int i; if ((CluNo>MaxClusters)||(CluNo==0)) { printf("NextClu: Invalid cluster number. CluNo=%u, MaxClusters=%u", CluNo, MaxClusters); return -1; } if (FATMode==FAT12) { /* FAT 12 */ /* ।塞 ⠡ FAT-12 */ j=(CluNo*3)/2; /* ।塞 ᥪ FAT */ nsect=(unsigned int)(j/SECTOR_SIZE); printf("nsect=%i ",nsect); /* nsect-⭮⥫ ᥪ FAT. 0 - ᥪ FAT */ if (nsect>=FatSize) {puts("NextClu: Invalid FAT's computing"); return -1;} if ( (b=LoadCache(ResSecs+nsect)) == -1U ) {puts("\nNextClu: FAT read error"); return -1;} offset=(unsigned int)(j%SECTOR_SIZE); printf("offset=%i ",offset); if (offset==(SECTOR_SIZE-1)) {unsigned char c; c=*(unsigned char far *)((*(Cache+b)).M+(SECTOR_SIZE-1)); if ( (b=LoadCache(ResSecs+nsect+1)) == -1U ) {puts("\nNextClu: FAT read error"); return -1;} printf("c=%04X ",c); i=((unsigned int)c)| (((unsigned int)(*(unsigned char far *)((*(Cache+b)).M)))<<8); } else i=*(int far *)((*(Cache+b)).M+offset); printf("word=%04X ",i); if (CluNo & 1) {putch('n');i>>=4;} else {putch('c');i&=0xfff;} if (i>0xff0) return -1; } else { /* FAT 16 */ /* ।塞 ⠡ FAT-16 */ j=((long)CluNo)*2; /* ।塞 ᥪ FAT */ nsect=(unsigned int)(j/SECTOR_SIZE); /* nsect-⭮⥫ ᥪ FAT. 0 - ᥪ FAT */ if (nsect>=FatSize) {puts("NextClu: Invalid FAT's computing"); return -1;} if ( (b=LoadCache(ResSecs+nsect)) == -1U ) {puts("\nNextClu: FAT read error"); return -1;} offset=(unsigned int)(j%SECTOR_SIZE); i=*(int far *)((*(Cache+b)).M+offset); if (i>0xfff0) return -1; } #if 1 printf("%i->%i ",CluNo,i); #endif return i; }src/kernel/viewexe.c0100664000076500007650000001061306123350144014175 0ustar prool2prool2#include #include "..\include\limits.h" #include "..\include\struct.h" void ViewEXE (struct exe_header far *Buf) {long i, j; printf("Bytes on last page %04X\n",Buf->PartPag ); printf("Pages in file %04X\n",Buf->PageCnt ); printf("Relocations %04X\n",Buf->ReloCnt ); printf("Paragraphe in header %04X\n",Buf->HdrSize ); printf("MinMem %04X par\n",Buf->MinMem ); printf("MaxMem %04X par\n",Buf->MaxMem ); printf("SS:SP %04X:%04X\n",Buf->ReloSS,Buf->ExeSP); printf("CheckSum %04X\n",Buf->ChkSum ); printf("CS:IP %04X:%04X\n",Buf->ReloCS,Buf->ExeIP); printf("Relocation table addr %04X\n",Buf->TablOff ); /* printf("Overlay No. %1X\n",Buf->Overlay); */ } /* [TECH Help!] ͻ 䠩 EXE ͼ . ন Ŀ +0 2 4Dh 5aH "" 䠩 .EXE ('MZ') Ĵ +2 2 PartPag ᫥ ࠭ (筮 ) Ĵ +4 2 PageCnt ࠧ 512-⮢ ࠭, Ĵ +6 2 ReloCnt ᫮ ⮢ ⠡ ६饭 Ĵ +8 2 HdrSize 16-⮢ ࠣ Ĵ +0aH 2 MinMem ॡ㥬 殬 ணࠬ (ࠣ) Ĵ +0cH 2 MaxMem ᨬ ॡ㥬 殬 ணࠬ (ࠣ) Ĵ +0eH 2 ReloSS ᥣ⭮ ᬥ饭 ᥣ ⥪ ( ⠭ SS) Ĵ +10H 2 ExeSP 祭 ॣ SP (㪠⥫ ⥪) ᪥ Ĵ +12H 2 ChkSum ஫쭠 㬬 (⥫쭠 㬬 ᫮ 䠩) Ĵ +14H 2 ExeIP 祭 ॣ IP (㪠⥫ ) ᪥ Ĵ +16H 2 ReloCS ᥣ⭮ ᬥ饭 ᥣ ( ⠭ CS) Ĵ +18H 2 TablOff ᬥ饭 䠩 1- ६饭 ( 001cH) Ĵ +1aH 2 Overlay ૥ (0 ) 1cH ࠧ ଠ஢ 樨 EXE Ŀ ६饭. 砫 + ? 4*? ᬥ. ᥣ  ᬥ. ᥣ ᬥ饭 [EXE+18H]. [EXE+6] 4-⮢ . + ? ? ய ࠭ ࠣ + ? ? 砫 ࠧ ணࠬ ᪮ EXE-䠩 㦥  ᥣ, ᮫ ᥣ- 뫪 (FAR CALL, 㪠⥫, 뫪 ⨯ MOV AX,data_seg) ਢ ᠬ , ᮮ⢥騬 㧪. ਢ 蠣, ᯮ㥬 ணࠬ 㧪 DOS (㭪 4bH ) 㧪 䠩 EXE: 1. ᮧ PSP ।⢮ 㭪樨 DOS 26H 2. 1cH 䠩 EXE (ଠ஢ EXE) 3. । ࠧ = ( (PageCnt*512)-(HdrSize*16) ) - PartPag 4. । 䠩 ᬥ饭 㦠 = (HdrSize * 16) 5. ᥣ , START_SEG, 㧪 (筮 PSP + 10H) 6. , 稭 START_SEG:0000 7. LSEEK (. 㪠⥫ 䠩) 砫 ⠡ ६饭 (TablOff) 8. ६饭 (ReloCnt): a. 16-⮢ ᫮ (I_OFF,I_SEG) b. ᫨ RELO_SEG=(START_SEG+I_SEG) ( ६頥 뫪) c. ᫮ RELO_SEG:I_OFF ( ⥪饥 祭) d. ਡ START_SEG ⮬ ᫮ (믮 ਢ離 ᥣ) e. १ ⭮ (RELO_SEG:I_OFF) 9. । ணࠬ ᮣ᭮ MaxMem MinMem 10. 樠஢ ॣ ணࠬ: a. ES = DS = PSP b. AX = ࠦ ४⭮ 䨪஢ ᪮ ப c. SS = START_SEG+ReloSS, SP = ExeSP d. CS = START_SEG+ReloCS, IP = ExeIP (: PUSH seg; PUSH offset; RETF) */ src/kernel/port.asm0100664000076500007650000000233305670566110014053 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _inport proc near push bp mov bp,sp push dx mov dx,word ptr [bp+4] in ax,dx pop dx ; mov sp,bp pop bp ret _inport endp public _inport _inportb proc near push bp mov bp,sp push dx mov dx,word ptr [bp+4] in al,dx pop dx ; mov sp,bp pop bp ret _inportb endp public _inportb _outport proc near push bp mov bp,sp push dx mov dx,word ptr [bp+4] mov ax,word ptr [bp+6] out dx,ax pop dx ; mov sp,bp pop bp ret _outport endp public _outport _outportb proc near push bp mov bp,sp push dx mov dx,word ptr [bp+4] mov al,byte ptr [bp+6] out dx,al pop dx ; mov sp,bp pop bp ret _outportb endp public _outportb _TEXT ends end src/kernel/key.asm0100664000076500007650000002320605561422204013653 0ustar prool2prool2comment | 뫠 室 । ப ਥ 㫨. ন - ,ࠢ,Home,End,(Backspace),BK(Enter): 筮; , : ६饭 ਨ; ESC : ⪠ ப ⠭ 砫 㪠⥫ ਨ; Ctrl-Left,Ctrl-Right,Ctrl-Backspace. ਨ 楢. - ਪ த ,- ࠡ 祬 㣮, ஬ ⮣ ஢ 稥 ப ਨ ⠢ ࢮ,ᤢ, ᮮ⢥⢥, (। 砫 - ⮫ XTREE PRO). ஢ 㤠, 祣 , Borland C, ; ⮨ Symantec C 6.0, ᠫ 쪨 ⨪ - ࠡ⠥, ஡ ⢥ - ஢ ப 室: ES ⠢ ࠢ쭮. ࠭᫨஢ TASM 3.2 c 砬 "-Z -q -t -m -ml". FidoNet 2:461/61.99 C | ; Version 0.0.0.2 3-May-94 .model tiny,pascal .8086 jumps locals @@ HISDEPTH equ 10 MaxLen equ 81 .code db 0 strbuf db MaxLen dup (?) hisbuf db MaxLen * HISDEPTH dup (0) curr dw ? cursor dw ? depth dw 0 ; ⥪ 㡨 current dw offset hisbuf ; ⥪ HisHead dw offset hisbuf HisCur dw offset hisbuf global _doskey:proc _doskey PROC C USES di,si ARG string push ds es mov ax,40h mov es,ax mov bx,63h mov bx,es:[bx] cmp bx,03b4h jnz @@more mov vseg,0b000h @@more: mov ax,cs mov es,ax mov ds,ax mov ax,HisHead mov HisCur,ax mov curr,offset strbuf mov strbuf,0 xor bh,bh mov ah,3 int 10h mov cursor,dx ; newkey: xor ax,ax int 16h cmp ax,0e7fh ; Ctrl+BackSpace jz @@cbs cmp al,' ' jb @@ctrl ; ᨬ push ax cmp curr,offset strbuf+80 ; ९ 室 ப jae newkey push curr call StrLen inc cx mov si,curr add si,cx mov di,si inc di std inc cx rep movsb pop ax mov di,curr mov [di],al inc curr call FlushBuf jmp newkey @@ctrl: cmp al,8 ; backspace jz @@bs cmp al,01bh ; ESC jz @@esc cmp ah,04bh ; left jz @@left cmp ah,04dh ; right jz @@right cmp ah,053h ; Del jz @@del cmp ah,047h ; Home jz @@home cmp ah,04fh ; End jz @@end cmp al,0dh ; Enter jz @@enter cmp ah,048h ; Up jz @@up cmp ah,050h ; Down jz @@down cmp ah,073h ; Ctrl+left jz @@cleft cmp ah,074h ; Ctrl+right jz @@cright jmp newkey @@bs: cmp curr,offset strbuf jz newkey mov cx,curr push cx CALL StrLen inc cx mov si,curr mov di,si dec di cld rep movsb dec curr call FlushBuf jmp newkey @@del: mov ax,curr mov cx,offset strbuf sub ax,cx push cx CALL StrLen cmp ax,cx jae newkey mov cx,curr push cx CALL StrLen inc cx mov di,curr mov si,di inc si cld rep movsb call FlushBuf jmp newkey @@esc: mov strbuf,0 mov curr,offset strbuf mov ax,HisHead mov HisCur,ax CALL FlushBuf jmp newkey @@left: cmp curr,offset strbuf jz newkey dec curr CALL SetCur jmp newkey @@right:mov ax,curr mov cx,offset strbuf sub ax,cx push cx CALL StrLen cmp ax,cx jae newkey inc curr CALL SetCur jmp newkey @@home: mov curr,offset strbuf CALL SetCur jmp newkey @@end: mov bx,offset strbuf push bx CALL StrLen add bx,cx mov curr,bx CALL SetCur jmp newkey @@cleft: mov bx,1 std jmp @@word @@cright: xor bx,bx cld @@word: mov si,curr @@cl3: lodsb or al,bl jz newkey cmp byte ptr [si],0 jz @@cl1 cmp byte ptr [si],'1' jb @@cl3 @@cl2: lodsb cmp al,'1' jb @@cl4 cmp byte ptr [si],'1' jae @@cl2 @@cl1: add si,bx @@cl4: mov curr,si CALL SetCur jmp newkey @@up: CALL GetPrev jmp @@his @@down: CALL GetNext @@his: cmp byte ptr [bx],0 jz newkey mov HisCur,bx push bx push offset strbuf CALL StrCpy mov bx,offset strbuf push bx CALL StrLen add bx,cx mov curr,bx CALL SetCur CALL FlushBuf jmp newkey @@cbs: cmp curr,offset strbuf jz newkey std mov si,curr @@bs3: lodsb cmp byte ptr [si],0 jz @@bs1 cmp byte ptr [si],'1' jb @@bs3 @@bs2: lodsb cmp al,'1' jb @@bs4 cmp byte ptr [si],'1' jae @@bs2 @@bs1: inc si @@bs4: mov di,si mov si,curr mov curr,di mov cx,si sub cx,di inc cx cld rep movsb CALL SetCur CALL FlushBuf jmp newkey @@enter:CALL AddHistory mov ax,0e0dh xor bh,bh int 10h mov ax,0e0ah xor bh,bh int 10h mov ax,string push offset strbuf push ax CALL StrCpy ; !!! ⮡ ES ᬮ५ ࠢ쭮 ; Borland C , ஢ ; Symantec C 6.0 - OK pop es ds ret _doskey ENDP FlushBuf PROC USES ax,si xor bh,bh mov dx,cursor mov ah,2 int 10h mov si,offset strbuf push si CALL StrLen push es db 0B8h ;mov ax,VideoSeg vseg dw 0b800h mov es,ax mov ax,cursor mov bx,ax mov al,ah mov ah,160 mul ah xor bh,bh shl bx,1 add bx,ax mov di,bx or cx,cx jz @@empty cld push cx @@out: lodsb stosb inc di loop @@out pop cx @@empty:neg cx add cx,79 cld @@blank:mov al,020h stosb inc di loop @@blank pop es CALL SetCur ret FlushBuf ENDP StrLen PROC USES ax,di ARG instring:word mov di,instring xor al,al cld mov cx,0ffffh repne scasb neg cx dec cx dec cx ret StrLen ENDP StrCpy PROC USES di,si,cx ARG str1,str2 mov si,str1 mov di,str2 push si CALL StrLen inc cx cld rep movsb ret StrCpy ENDP SetCur PROC USES ax,bx,dx mov ax,curr sub ax,offset strbuf mov dx,cursor add dl,al xor bh,bh mov ah,2 int 10h ret SetCur ENDP AddHistory PROC push offset strbuf push HisHead CALL StrCpy add HisHead,MaxLen cmp HisHead,offset curr jb @@ret mov HisHead,offset hisbuf @@ret: mov ax,HisHead mov HisCur,ax ret AddHistory ENDP GetPrev PROC ; bx - addr mov bx,HisCur cmp bx,offset hisbuf jnz @@nojmp mov bx, offset hisbuf + (HISDEPTH - 1) * MaxLen jmp @@ret @@nojmp:sub bx,MaxLen @@ret: ret GetPrev ENDP GetNext PROC ; bx - addr mov bx,HisCur cmp bx, offset hisbuf + (HISDEPTH - 1) * MaxLen jnz @@nojmp mov bx,offset hisbuf jmp @@ret @@nojmp:add bx,MaxLen @@ret: ret GetNext ENDP end src/kernel/ohb.asm0100664000076500007650000000165205706254306013643 0ustar prool2prool2; ohb locals _TEXT segment byte public 'CODE' assume cs:_TEXT ohb proc ; Procedure output hex byte Ver 0.1.1 6 Dec 93 via BIOS ; Input: AL - byte ; All regs. reserved ;) ; Not worked in graph mode. bl - bg color !!! push ax push cx push dx mov dl,al mov cl,4 shr al,cl call ohb1 mov al,dl and al,0fh call ohb1 pop dx pop cx pop ax ret ohb endp ohb1 proc ; Regs not saved !!! push ax cmp al,9 ja @@_1 ; al > 9 ; al <= 9 add al,'0' jmp @@_out @@_1: add al,'A'-10 @@_out: mov ah,0eh int 10h pop ax ret ohb1 endp public ohb _TEXT ends end src/kernel/out_os.c0100664000076500007650000002510706465711536014054 0ustar prool2prool2#include void out_os (int c) { switch(c) { /* Values for operating system indicator: */ case 0x00: printf("none "); break; /* 00h empty */ case 0x01: printf("FAT-12 "); break; /* 01h DOS 12-bit FAT */ case 0x02: printf("XENIX /"); break; /* 02h XENIX root file system */ case 0x03: printf("XENIX u"); break; /* 03h XENIX /usr file system (obsolete) */ case 0x04: printf("FAT-16 "); break; /* 04h DOS 16-bit FAT < 32M */ case 0x05: printf("EXTEND "); break; /* 05h DOS 3.3+ extended partition */ case 0x06: printf("LARGE "); break; /* 06h DOS 3.31+ Large File System (16-bit FAT >= 32M) */ case 0x07: printf("HPFS/NT"); break; /* 07h QNX */ /* 07h OS/2 HPFS */ /* 07h Windows NT NTFS */ /* 07h Advanced Unix */ case 0x08: printf("OS2 AIX"); break; /* 08h OS/2 (v1.0-1.3 only) */ /* 08h AIX bootable partition, SplitDrive */ /* 08h Commodore DOS */ /* 08h DELL partition spanning multiple drives */ case 0x09: printf("AIX "); break; /* 09h AIX data partition */ /* 09h Coherent filesystem */ case 0x0A: printf("OS2 Coh"); break; /* 0Ah OS/2 Boot Manager */ /* 0Ah OPUS */ /* 0Ah Coherent swap partition */ case 0x0B: printf("FAT-32 "); break; /* 0Bh Windows95 with 32-bit FAT */ case 0x0C: printf("FAT32LB"); break; /* 0Ch Windows95 with 32-bit FAT (using LBA-mode INT 13 extensions) */ case 0x0E: printf("VFATLBA"); break; /* 0Eh logical-block-addressable VFAT (same as 06h but using LBA-mode INT 13) */ case 0x0F: printf("EXTENDL"); break; /* 0Fh logical-block-addressable VFAT (same as 05h but using LBA-mode INT 13) */ case 0x10: printf("OPUS "); break; /* 10h OPUS */ case 0x11: printf("OS/2 "); break; /* 11h OS/2 Boot Manager, hidden DOS 12-bit FAT */ case 0x12: printf("Compaq "); break; /* 12h Compaq Diagnostics (config) partition */ case 0x14: printf("OS/2 "); break; /* 14h (resulted from using Novell DOS 7.0 FDISK to delete Linux Native part) */ /* 14h OS/2 Boot Manager hidden sub-32M 16-bit FAT partition */ case 0x16: printf("OS/2 "); break; /* 16h OS/2 Boot Manager hidden over-32M 16-bit FAT partition */ case 0x17: printf("OS/2 "); break; /* 17h OS/2 Boot Manager hidden HPFS partition */ case 0x18: printf("WinSwap"); break; /* 18h AST special Windows swap file ("Zero-Volt Suspend" partition) */ case 0x19: printf("Photon "); break; /* 19h Willowtech Photon coS */ case 0x1E: printf("Hiden95"); break; /* 1Eh Hidden FAT95 */ case 0x20: printf("Willow "); break; /* 20h Willowsoft Overture File System (OFS1) */ case 0x21: printf("reserv "); break; /* 21h officially listed as reserved */ case 0x23: printf("reserv "); break; /* 23h officially listed as reserved */ case 0x24: printf("NEC "); break; /* 24h NEC MS-DOS 3.x */ case 0x26: printf("reserv "); break; /* 26h officially listed as reserved */ case 0x31: printf("reserv "); break; /* 31h officially listed as reserved */ case 0x33: printf("reserv "); break; /* 33h officially listed as reserved */ case 0x34: printf("reserv "); break; /* 34h officially listed as reserved */ case 0x36: printf("reserv "); break; /* 36h officially listed as reserved */ case 0x38: printf("Theos "); break; /* 38h Theos */ case 0x3C: printf("PQMagic"); break; /* 3Ch PowerQuest PartitionMagic recovery partition */ case 0x40: printf("VENIX "); break; /* 40h VENIX 80286 */ case 0x41: printf("Linux "); break; /* 41h Linux, Personal RISC Boot */ case 0x42: printf("LinuxSw"); break; /* 42h SFS (Secure File System) by Peter Gutmann */ /* Linux swap (sharing disk with DRDOS) */ case 0x43: printf("Linux "); break; /* 43h Linux native (sharing disk with DRDOS) */ case 0x50: printf("OnTrack"); break; /* 50h OnTrack Disk Manager, read-only partition */ case 0x51: printf("NOVEL "); break; /* 51h OnTrack Disk Manager, read/write partition */ /* 51h NOVEL */ case 0x52: printf("CP/M "); break; /* 52h CP/M */ /* 52h Microport System V/386 */ case 0x53: printf("OnTrack"); break; /* 53h OnTrack Disk Manager */ case 0x54: printf("OnTrack"); break; /* 54h OnTrack Disk Manager (Dynamic Drive Overlay) */ case 0x55: printf("EZ "); break; /* 55h EZ-Drive */ case 0x56: printf("GoldenB"); break; /* 56h GoldenBow VFeature */ case 0x5C: printf("Priam "); break; /* 5Ch Priam EDisk */ case 0x61: printf("SpeedSt"); break; /* 61h SpeedStor */ case 0x63: printf("SysV386"); break; /* 63h Unix SysV/386, 386/ix (SCO, ISC UNIX, UnixWare, ...) */ /* 63h Mach, MtXinu BSD 4.3 on Mach */ /* 63h GNU HURD */ case 0x64: printf("Novell "); break; /* 64h Novell NetWare 286 */ case 0x65: printf("Novell "); break; /* 65h Novell NetWare (3.11) */ case 0x67: printf("Novell "); break; /* 67h Novell */ case 0x68: printf("Novell "); break; /* 68h Novell */ case 0x69: printf("Novell "); break; /* 69h Novell */ case 0x70: printf("DiskSec"); break; /* 70h DiskSecure Multi-Boot */ case 0x71: printf("reserv "); break; /* 71h officially listed as reserved */ case 0x73: printf("reserv "); break; /* 73h officially listed as reserved */ case 0x74: printf("reserv "); break; /* 74h officially listed as reserved */ case 0x75: printf("PC/IX "); break; /* 75h PC/IX */ case 0x76: printf("reserv "); break; /* 76h officially listed as reserved */ case 0x77: printf("QNX "); break; /* 77h QNX4.x */ case 0x78: printf("QNX "); break; /* 78h QNX4.x 2nd part */ case 0x79: printf("QNX "); break; /* 79h QNX4.x 3rd part */ case 0x80: printf("Minix "); break; /* 80h Minix v1.1 - 1.4a */ case 0x81: printf("Linux "); break; /* 81h Minix v1.4b+ */ /* 81h Linux */ /* 81h Mitac Advanced Disk Manager */ case 0x82: printf("Linux "); break; /* 82h Linux Swap partition */ /* 82h Prime */ case 0x83: printf("Linux "); break; /* 83h Linux native file system (ext2fs/xiafs) */ case 0x84: printf("OS/2 "); break; /* 84h OS/2-renumbered type 04h partition (related to hiding DOS C: drive) */ case 0x85: printf("LinuxEx"); break; /* 85h Linux extended partition */ case 0x86: printf("WinNT "); break; /* 86h NTFS, FAT16 volume/stripe set (Windows NT) */ case 0x87: printf("HPFS/NT"); break; /* 87h HPFS Fault-Tolerant mirrored partition */ /* 87h NTFS volume/stripe set */ case 0x93: printf("Amoeba "); break; /* 93h Amoeba file system */ case 0x94: printf("Amoeba "); break; /* 94h Amoeba bad block table */ case 0xA0: printf("Phoenix"); break; /* A0h Phoenix NoteBIOS Power Management "Save-to-Disk" partition */ /* IBM Thinkpad hibernation partition */ case 0xA1: printf("reserv "); break; /* A1h officially listed as reserved */ case 0xA3: printf("reserv "); break; /* A3h officially listed as reserved */ case 0xA4: printf("reserv "); break; /* A4h officially listed as reserved */ case 0xA5: printf("386BSD "); break; /* A5h Net,Free,Open,386BSD and BSD/OS */ case 0xA6: printf("reserv "); break; /* A6h officially listed as reserved */ case 0xA7: printf("NEXT "); break; /* A7h NEXTSTEP */ case 0xB1: printf("reserv "); break; /* B1h officially listed as reserved */ case 0xB3: printf("reserv "); break; /* B3h officially listed as reserved */ case 0xB4: printf("reserv "); break; /* B4h officially listed as reserved */ case 0xB6: printf("reserv "); break; /* B6h officially listed as reserved */ case 0xB7: printf("BSDI "); break; /* B7h BSDI file system (secondarily swap) */ case 0xB8: printf("BSDI "); break; /* B8h BSDI swap partition (secondarily file system) */ case 0xC0: printf("CTOS "); break; /* C0h CTOS */ case 0xC1: printf("DR DOS "); break; /* C1h DR DOS 6.0 LOGIN.EXE-secured 12-bit FAT partition */ case 0xC4: printf("DR DOS "); break; /* C4h DR DOS 6.0 LOGIN.EXE-secured 16-bit FAT partition < 32M */ case 0xC6: printf("DR DOS "); break; /* C6h DR DOS 6.0 LOGIN.EXE-secured Huge partition >= 32M */ /* C6h corrupted FAT16 volume/stripe set (Windows NT) */ case 0xC7: printf("Syrinx "); break; /* C7h Syrinx Boot */ /* C7h corrupted NTFS volume/stripe set */ case 0xD8: printf("CP/M-86"); break; /* D8h CP/M-86 */ case 0xDB: printf("CP/M "); break; /* DBh CP/M, Concurrent CP/M, Concurrent DOS */ /* DBh CTOS (Convergent Technologies OS -Unisys) */ case 0xE1: printf("SpeedSt"); break; /* E1h DOS access or SpeedStor 12-bit FAT extended partition */ case 0xE3: printf("DOS r/o"); break; /* E3h DOS read-only */ /* E3h SpeedStor, Storage Dimensions */ case 0xE4: printf("SpeedSt"); break; /* E4h SpeedStor 16-bit FAT extended partition < 1024 cyl */ case 0xE5: printf("reserv "); break; /* E5h officially listed as reserved */ case 0xE6: printf("reserv "); break; /* E6h officially listed as reserved */ case 0xF1: printf("Storage"); break; /* F1h SpeedStor, Storage Dimensions */ case 0xF2: printf("DOS sec"); break; /* F2h DOS 3.3+ secondary partition */ case 0xF3: printf("reserv "); break; /* F3h officially listed as reserved */ case 0xF4: printf("SpeedSt"); break; /* F4h SpeedStor large partition, Storage Dimensions */ case 0xF6: printf("reserv "); break; /* F6h officially listed as reserved */ case 0xFE: printf("LANstep"); break; /* FEh LANstep */ /* FEh IBM PS/2 IML */ /* SpeedStor > 1024 cyl. */ case 0xFF: printf("XENIX "); break; /* FFh Xenix bad block table */ default : printf("unkn %02X",c); } } src/kernel/readsec.asm0100664000076500007650000000253706144634160014501 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _ReadPhysSec proc ; int ReadPhysSec (unsigned char drive, unsigned char sec, unsigned char head, ; unsigned char trk /* or cyl */, char *Buffer); ; /* ; 2 bytes are combined to a word similar to INT 13: ; ; 76543210 1st byte (sector) ; Sector offset within cylinder ; High order bits of cylinder # ; ; 76543210 2nd byte (cylinder) ; Low order bits of cylinder # ; */ ; ALL REGS SAVED push bp mov bp,sp push bx push cx push dx push ES push DS pop ES mov dl,byte ptr [bp+ 4] ; drive mov cl,byte ptr [bp+ 6] ; sec mov dh,byte ptr [bp+ 8] ; head mov ch,byte ptr [bp+10] ; trk mov bx,word ptr [bp+12] ; Buffer mov ax,0201h; Fn=02, Read 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: ; mov ax,-1 @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _ReadPhysSec endp public _ReadPhysSec _TEXT ends end src/kernel/p2d.c0100664000076500007650000000361706400076232013215 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ char DirName [11]; /****************************************************************************/ int PathToDir(const char far *path, struct dirent far *Dir) { const char far *cc; const char far *point; int Counter, MsDos, i, len=2, NameLen, ExtLen, Up; #ifdef DEBUG printf(" P2D: path=`%s' ",path); #endif if (path==NULL) return -1; /* ஢ઠ path MSDOS ᮢ⨬ */ /* ᮢ⨬ ᮤঠ 窨, 窨 8 ᨬ, ᫥ 窨 - 3, ᪠ . 㪢 */ cc=path; Up=0; Counter=0; MsDos=1; if (strcmp(path,"..")==0) MsDos=2; /* 2 == ".." */ else { while(*cc) { if (*cc=='.') { point=cc; Counter++; } else { if (isupper(*cc)) Up=1; } cc++; } if (Up) MsDos=0; len=(int)(cc-path); if (MsDos) { if (Counter) {NameLen=(int)(point-path); ExtLen=(int)(len-NameLen-1);} else {NameLen=len; ExtLen=0;} if (Counter>1) {MsDos=0;} else if (NameLen>8) {MsDos=0;} else if (ExtLen>3) {MsDos=0;} } } /* ८ࠧ 䠩 ⠫ */ if (Dir!=NULL) { for (i=0;i<11;i++) DirName[i]=' '; if (MsDos==1) { memcpy(DirName,path,NameLen); memcpy(DirName+8,point+1,ExtLen); for (i=0;i<11;i++) DirName[i]=toupper(DirName[i]); } else { memcpy(DirName,path,(len>11)?11:len); } #ifdef DEBUG printf(" DirName=`%s' ", DirName); #endif memcpy((*Dir).d_name,DirName,11); (*Dir).Attr.B.Attr1=!MsDos; } #ifdef DEBUG printf(" dir=`%Fs' ",(*Dir).d_name); #endif return MsDos; } src/kernel/printf.c0100664000076500007650000002467506217356004014045 0ustar prool2prool2#include #include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ int printf (const char far *format, ...) { va_list v; int counter; char new_printf_buf[MAX_LEN_STR]; /* Called functions: vsprintf(), Puts0() */ /* ᯮ짮 ⢥ ᨢ printf_buf, 뤥塞 malloc (. kernel.c) 뢠  (ᠭ). ᯮ짮 ⢥ 쭮 ᨢ new_printf_buf  뢠. ࠡ⠥. */ va_start(v,0); counter=vsprintf(new_printf_buf,format,v); if(Puts0(new_printf_buf)==EOF) return EOF; return counter; } /****************************************************************************/ int vsprintf (char far *str, const char far *format, va_list v) { int i, counter=0, width, prec, Modifier, Type, FlagMinus, FlagPlus, FlagBlank, FlagDiez, FlagZero; char c, *cc, far *fcc; unsigned int segment; int len; char far *ss; long L; /* char Clipboard [MAX_LEN_STR]; */ char new_printf_buf[MAX_LEN_STR]; /* . ਬ砭 砫 -樨 printf */ while(*format) { if (*format!='%') { *str++=*format; counter++; } else {char s [] = "printf: Flag '%c' is not realized now :( "; /* 祭 ᨬ '%' */ /* % [FLAG] [WIDTH] [.PREC] [MODIFIER] TYPE */ /* TYPE: d signed dec int i " o unsigned oct int u unsigned dec int x unsigned hex int lowercase X " uppercase f float e float with Exponent g f or e E e G g c 1 char s string % % p pointer n char counter (?) FLAG: none right, 0 or blank - left + sign + or - blank sign - only # oct - 0 hex - 0x 0X WIDTH: n 0n 0 fill * next arg - width PREC: none .0 .n * - next arg MODIFIER: F far N near h short int l long int L long double */ /* ࠡ뢠 䫠 */ /* % [FLAG] [WIDTH] [.PREC] [MODIFIER] TYPE */ FlagMinus=0; FlagPlus=0; FlagBlank=0; FlagDiez=0; FlagZero=0; while(strchr("-+ #0",c=*++format)!=NULL) switch (c) { /* ᪠ "var=1; if (var)" ᯮ ⮣, ⮡ 뫮 ᮮ饭 "variable not used". ᫥ ⮣, ࠡ⪠ 䫠 㤥 ॠ, ᪨ , ⢥, 㤠 */ case '-': FlagMinus=1; break; case '+': FlagPlus =1; if (FlagPlus ) printf(s,c); break; case ' ': FlagBlank=1; if (FlagBlank) printf(s,c); break; case '#': FlagDiez =1; if (FlagDiez ) printf(s,c); break; case '0': FlagZero =1; } if (c==0) break; /* ࠡ뢠 ਭ */ /* % [FLAG] [WIDTH] [.PREC] [MODIFIER] TYPE */ if (isdigit(*format)) {width=atoi(format);while(isdigit(c=*++format)); } else width=0; if (c==0) break; if (c=='.') { prec=atoi(format+1); while(isdigit(c=*++format)); if (c==0) break; } else prec=0; if (prec) printf("printf: prec is not realized now :( "); /* ࠡ뢠 modifier */ /* % [FLAG] [WIDTH] [.PREC] [MODIFIER] TYPE */ if (strchr("FNhlL",c=*format)!=NULL) {Modifier=c; format++; switch(Modifier) { case 'F': case 'N': case 'h': case 'l': break; case 'L': printf("printf: Modifier '%c' is invalid\n",Modifier); } } else Modifier=0; if (c==0) break; if (strchr("diouxXfeEgGcspn%",c=*format)==NULL) {Type=0; printf("printf: invalid type '%c'",c);} else { Type=c; /* 뢮 㬥 */ switch(Type) { case '%': *str++='%'; counter++; break; case 'u': /* unsigned int */ case 'i': /* signed int */ case 'd': /* signed int */ if (Type=='u') if (Modifier=='l') L=va_arg(v,unsigned long); else L=va_arg(v,unsigned int); else if (Modifier=='l') L=va_arg(v,long); else L=va_arg(v,int); #ifdef DEBUG printf("printf: L=%08lX\n",L); #endif if (Type!='u') if (L<0) {*str++='-'; width--; L=-L;} if (Type=='u') if (Modifier=='l') ultoa(L,new_printf_buf,10); else ultoa(L,new_printf_buf,10); else if (Modifier=='l') ltoa(L,new_printf_buf,10); else itoa((int)L,new_printf_buf,10); #ifdef DEBUG printf("printf: new_printf_buf=%s\n",new_printf_buf); #endif len=(int)strlen(new_printf_buf); /* 塞 騥 㫨 */ if (L) { ss=new_printf_buf; if (*ss=='-')ss++; while(*ss=='0')*ss++=' '; fcc=ss; } else fcc="0"; goto l_s; case 'x': case 'X': if (Modifier=='l') { if (width==0) width=8; ltoa(va_arg(v,long),new_printf_buf,16); } else { if (width==0) width=4; itoa(va_arg(v,int),new_printf_buf,16); } if ((len=(int)strlen(new_printf_buf))>width) { fcc=new_printf_buf; fcc+=len-width; } else fcc=new_printf_buf; goto l_s; case 'p': if (width<5) {itoa(va_arg(v,int),new_printf_buf,10); strcpy(str,new_printf_buf); counter+=(i=(int)strlen(new_printf_buf)); str+=i;} else { itoa(va_arg(v,int),new_printf_buf,10); strcpy(str,new_printf_buf); counter+=(i=(int)strlen(new_printf_buf)); str+=i; *str++=':'; counter++; itoa(va_arg(v,int),new_printf_buf,10); strcpy(str,new_printf_buf); counter+=(i=(int)strlen(new_printf_buf)); str+=i; } break; case 'c': *str++=(char)va_arg(v,int); counter++; break; case 'o': if (Modifier=='l') {ltoa(va_arg(v,long),new_printf_buf,8);} else {itoa(va_arg(v,int),new_printf_buf,8);} fcc=new_printf_buf; goto l_s; case 's': #if 1 if (Modifier=='F') {fcc=va_arg(v, char far *); if (fcc==(char far *)NULL) fcc="(null)"; } else {cc=va_arg(v,char *); if (cc==(char *)NULL) fcc="(null)"; else { #ifdef BOOT /* compile printf for Boot Manager */ asm mov ax,DS; /* SS ? */ asm mov segment,ax; fcc = MK_FP (segment, cc); #else /* Compile printf for Proolix Kernel */ if (User) { asm mov ax,ProcessPar; asm mov segment,ax; fcc = MK_FP (segment, cc); } else { asm mov ax,DS; /* SS ? */ asm mov segment,ax; fcc = MK_FP (segment, cc); } #endif } } #else fcc=va_arg(v, char far *); if (fcc==(char far *)NULL) fcc="(null)"; #endif #ifdef DEBUG puts("printf: fcc="); puts(fcc); #endif l_s: i=(int)strlen(fcc); if (width>i) { if (FlagMinus) { strcpy(str,fcc); memset(str+i,' ',width-i); } else {int j;char c; if (Type=='s') c=' '; else if (FlagZero) c='0'; else c=' '; memset(str,c,j=width-i); strcpy(str+j,fcc); } str+=width; counter+=width; } else { strcpy(str,fcc); counter+=i; str+=i; } break; case 'f': case 'e': case 'E': case 'g': case 'G': case 'n': default: printf("printf: type '%c' not supported in this realisation", Type); } } } format++; } *str=0; return counter; } /****************************************************************************/ int sprintf(char far *str, const char far *format, ...) {va_list v; va_start(v,0); return vsprintf(str, format, v); } /****************************************************************************/ int vprintf(const char far *format, va_list v) { int counter; /* char str[MAX_LEN_STR]; */ char new_printf_buf[MAX_LEN_STR]; /* . ਬ砭 砫 -樨 printf */ va_start(v,0); counter=vsprintf(new_printf_buf,format,v); if(Puts0(new_printf_buf)==EOF)return EOF; return counter; } /****************************************************************************/ src/kernel/kbhit.asm0100664000076500007650000000052406302171064014161 0ustar prool2prool2; locals _TEXT segment byte public 'CODE' assume cs:_TEXT _kbhit0 proc near mov ah,1 int 16h jz @@no mov ax,1 jmp @@ret @@no: xor ax,ax @@ret: ret _kbhit0 endp public _kbhit0 _TEXT ends end src/kernel/macros.asm0100664000076500007650000000764606046773356014401 0ustar prool2prool2@GetChAtr MACRO page ; ਡ⮢ ᨬ -> AH ; ।⥫쭮 ⥭ ⥪饩 ࠭. ; ࠬ page. ; 㬮砭 ࠭ - 0. ; . @GetAtr IFNB mov bh,page ELSE sub bh,bh ENDIF mov ah,08h int 10h ENDM @GetChAtr @cls MACRO ; ॣ ࠭ push ax push bx push cx push dx push BP ; ࠭ BP, ; 맮 int 10h @GetChAtr mov bl,bh mov bh,ah sub cx,cx mov dx,184Fh mov ax,0600h int 10h mov bh,bl sub dx,dx mov ah,02h int 10h pop BP pop dx pop cx pop bx pop ax ENDM @cls ; ; (C) Copyright Serge Pustovoitoff, 1995 ; FidoNet 2:461/35 ; E-mail prool@infocom.kharkov.ua ; BBS in Kharkov - phone 007 24h 5 lines ; ⮢ : 310168, 쪮, / 2996. ; ப ࠭ ॣ (ࠧ㬥, ஬ , ; 頥 室 १), ; . GetPage MACRO ; ⥪. ࠭ -> BH ; : AX, BH mov ah,0fh int 10h ENDM GetPage say macro str ; ᪨ ० ࠡ⠥ push si lea si,str ; 뫮 mov si,offset str call sayr_proc pop si endm say sayr macro str ; ᪨ ० ࠡ⠥ push si lea si,str ; 뫮 mov si,offset str call sayr_proc pop si endm sayr chr macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) push ax mov al,sym mov ah,0eh int 10h pop ax endm chr chr1 macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) push ax mov al,sym mov ah,0eh int 10h pop ax endm chr1 inkey macro ; ᨬ ॣ AL ; ᫨ AL=0 AH 뫠 ७ - AH 뫠 ; ᪥-. ; ⫨稥 inkey inkey1 ॡ 맮 ; ॠ樨 ASCII . ; ६ ॠ CTRL-BREAK , ॠ樨 CTRL-C . ; ६ popup ணࠬ TECH HELP 뢠. ; ॣ AX mov ah,00h int 16h endm inkey inkey2 macro ; ᨬ ॣ AL ; ᫨ AL=0 AH 뫠 ७ - AH 뫠 ; ᪥-. ; ⫨稥 inkey inkey1 ॡ 맮 ; ॠ樨 ASCII . ; ६ ॠ CTRL-BREAK , ॠ樨 CTRL-C . ; ६ popup ணࠬ TECH HELP 뢠. ; ॣ AX mov ah,00h int 16h endm inkey2 src/kernel/memmove.c0100664000076500007650000000101306114174550014165 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ void far *memmove (void far *dest, const void far *src, size_t n) {char far *IBuf; /* if (dest==NULL) return NULL; */ /* if (src==NULL) return NULL; */ if((IBuf=malloc(n))==NULL) {puts("memmove: No mem"); return NULL;} memcpy(IBuf,src,n); memcpy(dest,IBuf,n); free(IBuf); return dest; } /****************************************************************************/ src/kernel/out_boot.c0100664000076500007650000000450206501350434014355 0ustar prool2prool2#include #include #include "kernel.h" #define DEBUG putch__(char c) { switch (c) { case 0: c=' '; break; default: if (c<' ') c='.'; } return putch(c); } void out_boot(void far *buf) {int i; unsigned long DiskSize; unsigned long TrueSectors; struct BootStru far *b; b=buf; printf("\n\ ----------------------------------Disk parameters:------------------------------\n\ Jump command %02X %02X %02X \n\ OEM name %-8s\n\ OEM name ", (*b).Jmp[0], (*b).Jmp[1], (*b).Jmp[2], (*b).OEM); for(i=0;i<8;) printf("%02X ",(*b).OEM[i++]); #if 0 printf("\n\ Sector size %4i bytes Cluster size %1i sect\n\ Reserved sectors (before 1st FAT) %2i FAT counter %1i\n\ Root directory entries %4i Total sectors %7u\n\ Media descr %02X FAT size %5i sect\n\ Track size %2i sec Heads %2i\n\ Hidden sectors %7li Big Number Of Sectors %7li\n\ Physical Drive No %02X Extended Boot Signature %02X\n\ Volume Serial No %04X-%04X -----------------------------------------------------\n", (*b).SectSiz, (*b).ClustSiz, (*b).ResSecs, (*b).FatCnt, (*b).RootSiz, (*b).TotSecs, (*b).Media, (*b).FatSize, (*b).TrkSecs, (*b).HeadCnt, (*b).HidnSec, (*b).BigSect, (*b).DriveNo, (*b).BootSign, (*b).SerialNo[1], (*b).SerialNo[0]); #endif #ifdef DEBUG printf(" W0 "); #endif printf("\nVolume Label (in boot) "); for(i=0;i<11;)putch__((*b).VolLbl[i++]); printf("\n "); for(i=0;i<11;)printf("%02X ",(*b).VolLbl[i++]); printf("\nFile system Id "); for(i=0;i<8;)putch__((*b).FileSysId[i++]); printf("\n "); for(i=0;i<8;)printf("%02X ",(*b).FileSysId[i++]); if ((*b).TotSecs==0) TrueSectors=(*b).BigSect; else TrueSectors=(*b).TotSecs; #ifdef DEBUG printf(" W1 "); #endif DiskSize=((long) (*b).SectSiz * TrueSectors)/1024l; #ifdef DEBUG printf(" W2 "); #endif if (DiskSize>5000) { #ifdef DEBUG printf(" W3 "); #endif DiskSize/=1024; #ifdef DEBUG printf(" W4 "); #endif printf("\nDisk size %li Mb\n",DiskSize); } else { printf("\nDisk size %li Kb\n",DiskSize); } } src/kernel/sh_1.c0100664000076500007650000000244706375554726013406 0ustar prool2prool2static void alloc(char * hexstr) {void far * ptr; long m; unsigned Bolvan; puts(""); m=htol(hexstr); if (m==0) {printf("Usage: alloc \n"); return; } Bolvan=ProcessPar; ProcessPar=0xFEDA; printf("Allocated %8lX bytes\n",m); ptr=malloc(m); if (ptr==NULL) puts("No memory"); else {printf("%4X:%4X\n",FP_SEG(ptr),FP_OFF(ptr));} ProcessPar=Bolvan; } /****************************************************************************/ static void kill_zombie(char * hexstr) {void far * ptr; int m; puts(""); m=htoi(hexstr); printf("%4X ",m); ptr=MK_FP(m,0); free(ptr); } /****************************************************************************/ static void open_(char *s) {int h; printf ("h=%2i errno=%2i ", h=open(s,O_RDONLY), errno); if (h!=-1) close(h); } /****************************************************************************/ #pragma warn-par static void stimer(int argc, char far *argv[]) { #ifdef TIME_STAMP int i; for(i=1;i<=argc;i++) { if (argv[i][0]=='-') switch (argv[i][1]) { case 'y': Int8on=1; break; case 'n': Int8on=0; clrscr(); break; default: puts("usage `stimer -y` or `stimer -n`"); } } #else puts("Timer not supported. Use `date` command"); #endif } #pragma warn+par src/kernel/stat.c0100664000076500007650000000240706314477600013507 0ustar prool2prool2#include #include #include #include #include "kernel.h" #ifdef notyet #error Preprocessor variable 'notyet' is not supported in Proolix #endif int fstat (int h, struct stat far *statbuf) { if (statbuf==NULL) {errno=EFAULT; return -1;} if ((h<0)||(h>OPEN_MAX)) {errno=EBADF; return -1;} if (!FCBS[h].Name[0]) {errno=EBADF; return -1;} (*statbuf).st_dev = 0; /* inode's device */ (*statbuf).st_ino = FCBS[h].BegClu; /* inode's number */ (*statbuf).st_mode = FCBS[h].Attr.U; /* inode protection mode */ (*statbuf).st_nlink = 1; /* number of hard links */ (*statbuf).st_uid = 0; /* user ID of the file's owner */ (*statbuf).st_gid = 0; /* group ID of the file's group */ (*statbuf).st_atime = 0; /* time of last access */ (*statbuf).st_mtime = 0; /* time of last data modification */ (*statbuf).st_ctime = 0; /* time of last file status change */ (*statbuf).st_size = FCBS[h].Size; /* file size, in bytes */ return 0; } int stat (char far *path, struct stat far *statbuf) {int i, h; if ((h=open(path,O_RDONLY))==-1) {errno=ENOENT; return -1;} i=fstat(h,statbuf); close(h); return i; } src/kernel/syscall.c0100664000076500007650000000363706667334660014225 0ustar prool2prool2/* 堭 ⥬ 맮 */ int ParLen, Alpha, Beta; int user_ax, user_ss, user_sp; void interrupt SysCall2() { /* ⮩ 㭪樨 imho ᯮ짮 ६. (???) */ /* CS ᥩ 㪠뢠 , DS/SS/SP ᪨ , 맢訩 맮 */ /* ࠭ ﭨ (ॣ஢) , 맢襣 system call */ /* ; push ax ; push bx ; push cx ; push dx ; push es ; push ds ; push si ; push di ; push bp ; mov bp,DGROUP ; mov ds,bp ; DS 㪠뢠 */ Mode=0; /* Mode kernel */ asm mov bp,sp asm mov user_ax,ax asm mov ax,SS asm mov user_ss,ax asm mov ax,BP; /* BP 㦭 ࠭ ᪮ SP */ asm mov user_sp,ax #if 0 /* ⠭ 拉 SS/SP */ asm cli asm mov ax,50H asm mov SS,ax asm mov ax,0FFFEh asm mov SP,ax asm mov BP,SP asm sti #endif /* ஢ ࠬ஢ ⥪ ⥪ */ ParLen=SysTable[user_ax].ParNo*2; asm sub SP,ParLen; asm mov Alpha,SS; asm mov Beta,SP; memcpy(MK_FP(Alpha,Beta), MK_FP(user_ss,user_sp+26), ParLen); /* 맮 㭪樨, ॠ饩 ⥬ 맮 */ (SysTable[user_ax].Entry)(); asm add SP,ParLen; asm mov Alpha,ax; asm mov Beta,dx; Mode=1; /* Mode user */ /* 뢠 ⥪, ࠭ ॣ, 祭, 饭 ⥬ 맮 ॣ AX DX */ *(int far*)MK_FP(user_ss,user_sp+16)=Alpha; *(int far*)MK_FP(user_ss,user_sp+10)=Beta; /* ⠭ ᪨ ss sp */ asm cli Global=user_ss; asm mov ax,Global asm mov SS,ax Global=user_sp; asm mov ax,Global; asm mov SP,ax asm sti } src/kernel/out_dev.c0100664000076500007650000000243406501346162014175 0ustar prool2prool2#include #include #include "kernel.h" void out_os (int c); void out_devices (void) {int i; printf("\nDev Head Sec Trk/cyl Partition"); printf("\n-------------------------------"); for (i=0;iMAX_LEN_STR) {printf("fgets: n>MAX_LEN_STR"); l_err:errno=EINVAL;return NULL;} for(i=0;i #include #include "kernel.h" void nulldev (void) { } /****************************************************************************/ void FDDstrategy (void) { } /****************************************************************************/ void HDDstrategy (void) { } src/kernel/tolower.c0100664000076500007650000000120006076520070014210 0ustar prool2prool2#include #include #include "kernel.h" /****************************************************************************/ int tolower (int ch) { if ((ch>='A')&&(ch<='Z'))return ch + 'a' - 'A'; else return ch; /* ^^^^^^^^^^^^^ portions (C) Borland Intl., 1988 */ } /****************************************************************************/ int toupper (int ch) { if ((ch>='a')&&(ch<='z'))return ch + 'A' - 'a'; else return ch; /* ^^^^^^^^^^^^^ portions (C) Borland Intl., 1988 */ } src/kernel/out_mbr.c0100664000076500007650000000221006501345254014170 0ustar prool2prool2#include #include "..\include\struct.h" void out_os (int c); void outMBR (char far * buf) { int i; struct MBRstru far * MBR; MBR = (void far * ) buf; printf(" System ----Begin--- ----End----- Preceding sec Total sec Size,Mb\n"); printf(" head sec cyl head sec cyl\n"); /* "A FAT 12 iiii ii iiii iiii ii iiii iiiiiiiiii iiiiiiiiii\n" */ for (i=0;i<4;i++) {unsigned int j; if (MBR->Partition[i].indicator==0) printf(" "); else printf("A"); printf(" "); out_os(MBR->Partition[i].system_indicator); printf("(%02X) ",MBR->Partition[i].system_indicator); printf(" %4i ",MBR->Partition[i].begin_head); printf("%2i ",(j=MBR->Partition[i].begin_sec) & 0x3F); j = (j & 0xC0)<<2; printf("%4i ",MBR->Partition[i].begin_cyl | j); printf("%4i ",MBR->Partition[i].end_head); printf("%2i ",(j=MBR->Partition[i].end_sec) & 0x3F); j = (j & 0xC0)<<2; printf("%4i ",MBR->Partition[i].end_cyl | j); printf("%10lu ",MBR->Partition[i].preceding_sec); printf("%10lu ",MBR->Partition[i].total_sec); printf("%4i\n",(MBR->Partition[i].total_sec)/2048); } } src/kernel/initv.asm0100664000076500007650000000334206100166644014216 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _initv proc SET_INT MACRO int_no, routine push CS mov ax,offset routine push ax mov ax,int_no push ax call _setvect add sp,6 ENDM extrn _setvect:near extrn InterCept:near SET_INT 20h, InterCept ; general program termination SET_INT 21h, InterCept ; function request services SET_INT 22h, InterCept ; terminate address SET_INT 23h, InterCept ; control break termination address SET_INT 24h, InterCept ; critical error handler SET_INT 25h, InterCept ; absolute disk read SET_INT 26h, InterCept ; absolute disk write SET_INT 27h, InterCept ; terminate and stay resident SET_INT 28h, InterCept ; idle loop, issued by DOS when idle SET_INT 29h, InterCept ; fast TTY console I/O SET_INT 2Ah, InterCept ; critical section and NETBIOS SET_INT 2Bh, InterCept ; internal, simple IRET in DOS 2.0-5.0 SET_INT 2Ch, InterCept ; " SET_INT 2Dh, InterCept ; " SET_INT 2Eh, InterCept ; exec command from base level command interpreter SET_INT 2Fh, InterCept ; multiplexer SET_INT 31h, InterCept ; DOS Protected Mode Interface (for DOS extenders) SET_INT 32h, InterCept ; reserved SET_INT 33h, InterCept ; mouse support SET_INT 34h, InterCept ; Microsoft/Borland floating point emulation SET_INT 35h, InterCept ; " SET_INT 36h, InterCept ; " SET_INT 37h, InterCept ; " SET_INT 38h, InterCept ; " SET_INT 39h, InterCept ; " SET_INT 3Ah, InterCept ; " SET_INT 3Bh, InterCept ; " SET_INT 3Ch, InterCept ; " SET_INT 3Dh, InterCept ; " SET_INT 3Eh, InterCept ; " SET_INT 3Fh, InterCept ; overlay manager ret _initv endp public _initv _TEXT ends end src/kernel/vector.asm0100664000076500007650000000236305670565644014407 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _getvect proc near push bp mov bp,sp push DS push bx push cx xor ax,ax mov DS,ax mov bx,word ptr [bp+4] ; interrupt no mov cl,2 shl bx,cl cli mov ax,[bx] mov dx,[bx+2] sti pop cx pop bx pop DS ; mov sp,bp pop bp ret _getvect endp public _getvect _setvect proc near push bp mov bp,sp push ax push bx push cx push DS xor ax,ax mov DS,ax mov bx,word ptr [bp+4] ; interrupt no mov cl,2 shl bx,cl cli mov ax,word ptr [bp+6] mov [bx],ax add bx,2 mov ax,word ptr [bp+8] mov [bx],ax sti pop DS pop cx pop bx pop ax ; mov sp,bp pop bp ret _setvect endp public _setvect _TEXT ends end src/kernel/getch0.asm0100664000076500007650000000042006302170150014220 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _getch0 proc near ; push DS mov ah,00h int 16h ; xor ah,ah ; pop DS ret _getch0 endp public _getch0 _TEXT ends end src/kernel/gentbl.com0100664000076500007650000003134006761267574014356 0ustar prool2prool2.0!.,ڣ+++.,+>+Njع&=87u&U=u+Yu+aC&8uր̀ى+++>&0s>&064r(>$0r"G;r>&0t>$0u;wډ++++؎JW!_ҋ3.364+3++36+6+6+Ps.[3LF!+5!++5!++5!++5!++%ʎں6!%+!%+!%+!%+!+ô@!ù+.PJU VW;r9&+r'P,P ' P,P '8P-P'FP-PD'~}-PIDD~u".P^w udždž.PDDƆR.PP  uPU.Pid.P P  u PU.P@^wg.PP+'d.PP  u`t.Pt.PFP=uP.P=ut.Pt.PFP|=u3PP u= t t= t=;tƆPXPP.PP% uPPZPXPP.P =u Pv.PVP.P=uV^w.PP%t0R.PPP tPDDPV.P/d.PP  uPPVP8P* =uZ DD tP /PPP  tPPV/PPV2/PFUg DD tP /PuK DD t P /PY/ DD tP /P=.P,DD^wG/PP$PS/Pd.PP u3cdž"GP`/P=u>;t ~;ug/P=uj/P=u;|a DD tP /Po^wn/PP#PS/PKd.PP? uPU.P%|/P|/PFPB=ur~/P,=t_3ndžGP/P=t;;t ~;ug/P=t'/P=uPv.P9;}M DD tP /P[NP/PM3PDDD_^]UVv |XvW6// ރ#w/ƣ+^]U (03(0(0 u0 0"0vaY]..+2&@Ň֓6+>+r+2v%+r`،ЎQI2ً݇ËCwr@w< t< t< u2 tB uC2I,"t"<\u<"uI DY.+Cۋ+r.+v6 t3F.&+QGY t$+36+)+ u3?&8uU>(0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FuF؁ft)FuFvVY ~ x R3~NvPVYYNFu[Fu7v }tFvVYFu |NFuF +~󫬀f<^uNЋ"k<t&<]t%<-u:w݀<]tج*tŃkuv fvFuN|PFvVY |Oޱ"jtFtFt FuĪvPVYYNF;v} FuFذJF;v} FuFvPVYY~^FFvVY ~ x R3tYtY+ҹN|ERQFvVYYZ ~5|10r* rr r rs +tYY__^]&3&3&3S0r# v*w' v :s[UVWFFF+0FvVY |fÀuuN |[<+t<-uFN |KFvVY |6+N N$w/r*<0ulueN |3FvVY #include #include "kernel.h" int Int13perror(unsigned err); /****************************************************************************/ /* #define DEBUG */ /* 室 㬠 ⮬, 뢠 ᪮ ᥪ୮, */ /* 楫묨 ஦. 㤥 ॥. */ /****************************************************************************/ extern unsigned char NearBuffer [SECTOR_SIZE]; /* defined in c0.asm */ /****************************************************************************/ int secread (int drive, unsigned long AbsSec, char *Buffer) {/* Read absolute sectors Input: drive (for int 13h Fn=2) abs sec number buffer Output: return!=0 if error */ int Track, SecNoOnCyl, i; char Head, SecOnTrk; Track=(int)(AbsSec/SectorsOnCyl); /*SectorsOnCyl=HeadCnt*TrkSecs,Track==Cyl */ SecNoOnCyl=(int)(AbsSec%SectorsOnCyl); Head=SecNoOnCyl/TrkSecs; SecOnTrk=SecNoOnCyl%TrkSecs+1; /* 2 bytes are combined to a word similar to INT 13: 76543210 1st byte (sector) Sector offset within cylinder High order bits of cylinder # 76543210 2nd byte (cylinder) Low order bits of cylinder # */ if ((i=Track &0x0300)!=0) { SecOnTrk = (SecOnTrk & 0x3F) | (int)(i>>2); } return ReadPhysSec(drive, SecOnTrk, Head, Track, Buffer); } /****************************************************************************/ int absread (int drive, int nsects, unsigned long lsect, void far *FarBuffer) { int i, j, k; unsigned err; #ifdef DEBUG printf("absread: lsect=%lu ",lsect); #endif for (i=0;i=MaxSectors) { printf("absread: lsect >=MaxSectors. lsect=%lu ",lsect); printf("MaxSectors=%lu\n",MaxSectors); return -1; } while(1) { #ifdef DEBUG /* ஢ઠ 祭 ᮬ ࠭ 64. ⥭/ 䫮 (DMA overload) */ /* H !!! 㤫 㯨 祭 ࠭ 㤥 NearBuffer 㤠- ६ */ /* printf("absread: NearBuffer = %lX ",(long)NearBuffer); */ #endif err=1; for (j=0;j>=8; printf("absread: error %2X in sec %li: ",err,lsect); Int13perror(err); printf(" Ignore (i), retry (r) or abort (a) ? "); j=getchar(); puts(""); if (j=='r') continue; else if (j=='a') return -1; else /* ignore */ break; } else break; } #if 1 for (k=0;k #include #include "kernel.h" /****************************************************************************/ int bootread (int Dev, void far *Buf) {int i, err; char InternalBuffer [SECTOR_SIZE]; for (i=0; i #include #include "kernel.h" /****************************************************************************/ char *Int13error [] = { "\000No errors", "\001Bad controller command", "\002Bad adress mark", "\003Write protect", "\004Sector ID bad or not found", "\005Reset controller error (AT)", "\010DMA fault", "\011DMA overload (over 64K frontiere)", "\013Bad track flag (AT)", "\020CRC error", "\021ECC error fixed (AT)", "\040Controller fault", "\100Seek error, track not found", "\200Timeout", "\273Undefined error (AT)", "\377Sense error (AT)" }; /****************************************************************************/ int Int13perror(unsigned err) {int i; for (i=0;;i++) { if (Int13error[i][0]==err) return printf(Int13error[i]+1); if (Int13error[i][0]==(char)0xff) break; } return printf("Illegal error code"); } /****************************************************************************/ src/kernel/int5dump.asm0100664000076500007650000000372506046774776014663 0ustar prool2prool2; INT 5 - Register dump _TEXT segment byte public 'CODE' assume cs:_TEXT sayr macro str ; ᪨ ० ࠡ⠥ push si lea si,str ; 뫮 mov si,offset str call sayr_proc pop si endm sayr chr1 macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) ; NO SAVE REG mov al,sym mov ah,0eh int 10h endm chr1 extrn sayr_proc:near extrn ohw:near _Int5dump proc push ax push DS chr1 'c' chr1 's' chr1 '=' ; mov ax,SS:[bp+4] push CS pop ax call ohw chr1 ' ' chr1 'd' chr1 's' chr1 '=' mov ax,DS call ohw push CS pop DS sayr s_bx mov ax,bx call ohw sayr s_cx mov ax,cx call ohw sayr s_dx mov ax,dx call ohw sayr s_si mov ax,si call ohw sayr s_di mov ax,di call ohw sayr s_ss mov ax,SS call ohw sayr s_sp mov ax,SP call ohw sayr s_es mov ax,ES call ohw sayr s_bp mov ax,[bp+4] call ohw pop DS pop ax IRET ;s0 db 13,10,"CS:IP=",0 s_ax db ' ax=',0 s_bx db ' bx=',0 s_cx db ' cx=',0 s_dx db ' dx=',0 s_si db ' si=',0 s_di db ' di=',0 s_ss db ' SS=',0 s_sp db ' SP=',0 s_ds db ' DS=',0 s_es db ' ES=',0 s_bp db ' BP=',0 _Int5dump endp public _Int5dump _TEXT ends end src/kernel/intercep.asm0100664000076500007650000000165005670566464014715 0ustar prool2prool2 include macros.asm _TEXT segment byte public 'CODE' assume cs:_TEXT extrn sayr_proc:near extrn ohw:near extrn _saycsip:near InterCept proc mov CS:@@BP,bp mov bp,sp push ax push bx push DS push ES push CS ; pop DS ; sayr @@s1 push bx push ES push ax mov bx,SS:[BP] mov ES,SS:[BP+2] sub bx,2 mov ax,ES:[bx] call ohw pop ax pop ES pop bx call _saycsip pop ES pop DS pop bx pop ax mov BP,CS:@@BP iret @@BP dw 0 @@s1 db 13,10,'Int command= ',0 InterCept endp public InterCept _TEXT ends end src/kernel/process.c0100664000076500007650000001402306645411644014212 0ustar prool2prool2/* " 襫" ..ࡠ祢 ****************************************************************************/ #define DEBUG_PROCESS /****************************************************************************/ extern char sh_str_orig []; jmp_buf the_return; #define F_COM 0 #define F_EXE 1 #define F_ERR 2 #define I_OFF Twix[0] #define I_SEG Twix[1] /****************************************************************************/ jmp_buf jmpb; unsigned int Twix[2]; /****************************************************************************/ int execve (char far *name, char far *_argv[], char far *far *env) { char Sec1 [SECTOR_SIZE]; char FirstSec [SECTOR_SIZE]; int i, h, argc, nenv, restos, segment, offset_s; long int FileLen, l; unsigned int len; size_t SizeMemoryBlock; char far *cc, huge *mem, huge *mem0=0, far *ptr, far *adr, far *EnvAdr; int status, n_sec; struct exe_header *H; unsigned int exe_begin, RELO_SEG; if ((h=open(name,O_RDONLY))==-1) { return 1; } if ((FileLen=filelength(h))<4) { R4: close(h); return 2; } /*** ⥭ ࢮ ᥪ ஢ઠ ᨣ DEAD/DEAF ***/ restos = (SECTOR_SIZE>FileLen) ? (int)FileLen : SECTOR_SIZE; if (read(h,Sec1,restos) != restos) {close(h); return 3; } if (Sec1[0]==0xDE) { switch (Sec1[1]) { case 0xAD: status=F_COM; break; case 0xAF: status=F_EXE; /* ViewEXE((void *)Sec1); */ break; default : status=F_ERR; } } else status=F_ERR; if (status==F_ERR) goto R4; if (status==F_COM) SizeMemoryBlock= ComMemory<<4; /*((ComMemory -1U)<<4)+1;*/ if (status==F_EXE) { /* F_EXE */ H=(void *)Sec1; SizeMemoryBlock=((long)(H->PageCnt)+1L)*SECTOR_SIZE+ (long)(H->MinMem/*-H->HdrSize*/)*16; /* printf("exe mem size=%li\n",SizeMemoryBlock); */ } if ( (void far *)(mem0=calloc(SizeMemoryBlock,1)) == NULL ) { printf("execve: No memory. (Required %l bytes)\n",SizeMemoryBlock); return 5; } mem=mem0+0x100; if (status==F_EXE) { exe_begin=FP_SEG(mem0)+0x10; /* printf("exe_begin=%04X\n",exe_begin); */ /* printf("mem0=%08lX\n",mem0); */ /* printf("mem=%08lX\n",mem); */ } /* १ ६ stdin, stdout stderr PSP (. ᠭ ६. stdio.h command/c1.asm */ *(FILE far * far *)(mem0+0x0A)=stdin; *(FILE far * far *)(mem0+0x0E)=stdout; *(FILE far * far *)(mem0+0x12)=stderr; if (status==F_COM) { memcpy((void far *)mem,Sec1,restos); mem+=restos; n_sec=(int)(FileLen/SECTOR_SIZE ); } if (status==F_EXE) { n_sec=(H->PageCnt/2)+1-(H->HdrSize/(SECTOR_SIZE/16))+1; /* printf("n_sec=%i\n",n_sec); */ } /* ⥭ ⠫ ᥪ஢ */ /* F_COM, F_EXE */ for (l=1;lSECTOR_SIZE) { restos=(int)(FileLen % SECTOR_SIZE); read(h,(void far *)mem,restos); } #if 1 if (status==F_EXE) { /* ன ६頥 ᮢ exe-㫥 */ if (lseek(h,H->TablOff,SEEK_SET)==-1L) {free((void far *)mem0);close(h);return 5;} for (i=0;iReloCnt;i++) { if (read(h,(void *)Twix,4)!=4) {free((void far *)mem0);close(h);return 6;} /* printf("relocation %04X:%04X\n",I_SEG,I_OFF); */ RELO_SEG=exe_begin+I_SEG; *(unsigned int far *)MK_FP(RELO_SEG,I_OFF) = *(unsigned int far *)MK_FP(RELO_SEG,I_OFF)+exe_begin; /* putch('@'); */ } } #endif close (h); puts(""); if (status==F_COM) { /* ७ ࠬ஢ argc, argv env 짮⥫᪮ */ len=0; for (argc=0;_argv[argc]!=NULL;argc++) len+=(int)(strlen(_argv[argc])+1); len+=(2+2+2*(argc)); /* 2 - ࠬ argc (int - 2 ) 2 - ࠬ argv (near ptr - 2 ) 2 * argc - ࠬ char *argv[] len - 㬬 ப-㬥⮢ */ nenv=0; while(env[nenv]!=NULL) {len+=(int)(strlen(env[nenv++])+1);} len+=(2+2*(nenv+1)); if (len & 1) len++; /* len */ ptr=(char far *)mem0+(unsigned int) 0xfffe-len; segment=FP_SEG(ptr); /*** ࠬ 㭪樨 main ***/ /*** argc ***/ *(int far *)ptr=argc; ptr+=2; /*** argv ***/ *(int far *)ptr=FP_OFF(ptr+4); ptr+=2; /*** env ***/ EnvAdr=ptr; ptr+=2; /* १ argv 짮⥫᪨ */ offset_s=FP_OFF(ptr)+(argc)*2; for (i=0;iReloCS; jmpb[0].j_ip=H->ExeIP; jmpb[0].j_sp=H->ExeSP; jmpb[0].j_ss=exe_begin+H->ReloSS; jmpb[0].j_flag=_FLAGS; jmpb[0].j_bp=0; jmpb[0].j_di=0; jmpb[0].j_es=FP_SEG(mem0); jmpb[0].j_si=0; jmpb[0].j_ds=FP_SEG(mem0); jmpb[0].j_ax=0; jmpb[0].j_bx=0; jmpb[0].j_cx=0; jmpb[0].j_dx=0; #ifdef DEBUG_PROCESS printf("Ll"); #endif longjmp(jmpb,0); } asm LL label near; /* ᫥ 室 뢠 䠩 */ for (i=3;i #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ char InternalBuffer [SECTOR_SIZE]; /****************************************************************************/ int ReadPhysSec2 (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk /* or cyl */, void far *Buf) {int i, err; #ifdef DEBUG printf("\nReadPhysSec2. drive=%i. sec=%i. head=%i. trk=%i.\n",drive,sec,head, trk); #endif for (i=0; i #ifndef _DIRENT_H_ #define _DIRENT_H_ #ifndef _ATTRFIELD_ #define _ATTRFIELD_ struct AttrField { unsigned int ReadOnly : 1; unsigned int Hidden : 1; unsigned int System : 1; unsigned int Label : 1; unsigned int Dir : 1; unsigned int Archive : 1; unsigned int Attr2 : 1; unsigned int Attr1 : 1; }; union FileAttr { struct AttrField B; unsigned char U; }; #endif #ifndef _FTIME_ #define _FTIME_ struct ftime { unsigned ft_tsec : 5; /* Two second interval */ unsigned ft_min : 6; /* Minutes */ unsigned ft_hour : 5; /* Hours */ unsigned ft_day : 5; /* Days */ unsigned ft_month : 4; /* Months */ unsigned ft_year : 7; /* Year */ }; #endif #define d_ino d_fileno /* backward compatibility */ #define DIR FILE struct dirent { char d_name [11]; union FileAttr Attr; char Reserv [10]; struct ftime FileDateTime; unsigned int d_fileno; /* initial cluster number in MSDOS/Proolix file systems */ unsigned long int Size; }; DIR far *opendir (const char far *dirname); #ifdef KERNEL DIR far *openwdir (const char far *dirname); #endif DIR far *openidir (int inode); struct dirent far *readdir (const DIR far *dirp); #ifdef KERNEL int writedir (const DIR far *dirp, struct dirent far *D); #endif void rewinddir (const DIR far *dirp); int closedir (const DIR far *dirp); long telldir (const DIR far *dirp); long seekdir (const DIR far *dirp, long offset, int where); int dircmp (struct dirent d1, struct dirent d2); #endif /* !_DIRENT_H_ */ src/include/dos.h0100664000076500007650000001123606501340666013470 0ustar prool2prool2/* dos.h Defines structs, unions, macros, and functions for dealing with MSDOS and the Intel iAPX86 microprocessor family. Copyright (c) Serge Pustovoitoff 1993-1997 */ #if !defined(__TIME_DATE_) #define __TIME_DATE_ struct time { unsigned char ti_min; /* Minutes */ unsigned char ti_hour; /* Hours */ unsigned char ti_hund; /* Hundredths of seconds */ unsigned char ti_sec; /* Seconds */ }; struct date { int da_year; /* Year - 1980 */ char da_day; /* Day of the month */ char da_mon; /* Month (1 = Jan) */ }; #endif #if !defined(__DOS_DEF_) #define __DOS_DEF_ /* Variables */ extern int errno; extern char ** environ; extern char * sys_errlist[]; /* prool */ #define FAT12 0 #define FAT16 1 #define NO_FAT 2 #define FA_RDONLY 0x01 /* Read only attribute */ #define FA_HIDDEN 0x02 /* Hidden file */ #define FA_SYSTEM 0x04 /* System file */ #define FA_LABEL 0x08 /* Volume label */ #define FA_DIREC 0x10 /* Directory */ #define FA_ARCH 0x20 /* Archive */ #define FA_ATTR2 0x40 /* Proolix Attr No.2 */ #define FA_ATTR1 0x80 /* Proolix Attr No.1 - Proolix file */ struct WORDREGS { unsigned int ax, bx, cx, dx, si, di, cflag, flags; }; struct BYTEREGS { unsigned char al, ah, bl, bh, cl, ch, dl, dh; }; union REGS { struct WORDREGS x; struct BYTEREGS h; }; struct SREGS { unsigned int es; unsigned int cs; unsigned int ss; unsigned int ds; }; struct REGPACK { unsigned r_ax, r_bx, r_cx, r_dx; unsigned r_bp, r_si, r_di, r_ds, r_es, r_flags; }; #define FP_OFF(fp) ((unsigned)(fp)) #define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16)) #define MK_FP(seg,ofs) ((void far *) \ (((unsigned long)(seg) << 16) | (unsigned)(ofs))) int absread (int drive, int nsects, unsigned long lsect, void far *buffer); /* prool */ int abswrite(int drive, int nsects, unsigned long lsect, void far *buffer); /* prool */ long dostounix (struct date *d, struct time *t); void getdate (struct date far *datep); /* prool */ void gettime (struct time far *timep); /* prool */ void interrupt (* getvect(int interruptno)) (); /* void far * getvect (int VecNo); */ int inport (int portid); unsigned char inportb(int portid); int int86 (int intno, union REGS far *inregs, union REGS far *outregs); /* prool */ int int86x (int intno, union REGS *inregs, union REGS *outregs, struct SREGS *segregs); void intr (int intno, struct REGPACK *preg); void outport (int portid, int value); void outportb(int portid, unsigned char value); int peek (unsigned segment, unsigned offset); char peekb (unsigned segment, unsigned offset); void poke (unsigned segment, unsigned offset, int value); void pokeb (unsigned segment, unsigned offset, char value); void setdate (struct date *datep); void settime (struct time *timep); void setvect (int interruptno, void interrupt (*isr) ()); /* These are in-line functions. These prototypes just clean up some syntax checks and code generation. */ void __cli__ (void); void __sti__ (void); unsigned char __inportb__(int portid); void __outportb__ (int portid, unsigned char value); void __int__ (int interruptnum); #define disable() __cli__() /* Clear interrupt flag */ #define enable() __sti__() /* Set interrupt flag */ #define inportb(portid) __inportb__(portid) /* Byte IN instruction */ #define outportb(portid, v) __outportb__(portid,v)/* Byte OUT instruction */ #define geninterrupt(i) __int__(i) /* Interrupt instruction */ /* some other compilers use inp, outp for inportb, outportb */ #define inp(portid) inportb(portid) #define outp(portid,v) outportb(portid,v) #if !__STDC__ #define poke(a,b,c) (*((int far*)MK_FP((a),(b))) = (int)(c)) #define pokeb(a,b,c) (*((char far*)MK_FP((a),(b))) = (char)(c)) #define peek(a,b) (*((int far*)MK_FP((a),(b)))) #define peekb(a,b) (*((char far*)MK_FP((a),(b)))) #endif #endif src/include/dir.h0100664000076500007650000000166506312073262013461 0ustar prool2prool2/* dir.h Defines structures, macros, and functions for dealing with directories and pathnames. Copyright (c) Serge Pustovoitoff 1995-1997 */ #include #if !defined(__DIR_DEF_) #define __DIR_DEF_ struct ffblk { char ff_reserved[21]; char ff_attrib; unsigned ff_ftime; unsigned ff_fdate; long ff_fsize; char ff_name[13]; }; #define WILDCARDS 0x01 #define EXTENSION 0x02 #define FILENAME 0x04 #define DIRECTORY 0x08 #define DRIVE 0x10 int chdir (const char far *path); /* prool */ int getcurdir (int drive, char *directory); char far* getcwd (char far *buf, int buflen); int mkdir (const char far *path, mode_t mode);/*prool*/ int rmdir (const char far *path); /* prool */ #endif src/include/errno.h0100664000076500007650000000711506312072344014024 0ustar prool2prool2/* errno.h Defines the system error variable errno and the error numbers set by system calls. Copyright (c) Serge Pustovoitoff 1993-1997 */ /* Dos Error Codes */ #define EZERO 0 /* Error 0 - no error */ #define EINVFNC 1 /* Invalid function number */ #define ENOFILE 2 /* File not found */ #define ENOPATH 3 /* Path not found */ #define ECONTR 7 /* Memory blocks destroyed */ #define EINVMEM 9 /* Invalid memory block address */ #define EINVENV 10 /* Invalid environment */ #define EINVFMT 11 /* Invalid format */ #define EINVACC 12 /* Invalid access code */ #define EINVDAT 13 /* Invalid data */ #define EINVDRV 15 /* Invalid drive specified */ #define ECURDIR 16 /* Attempt to remove CurDir */ #define ENOTSAM 17 /* Not same device */ #define ENMFILE 18 /* No more files */ #define ENOENT 2 /* No such file or directory */ #define EMFILE 4 /* Too many open files */ #define EACCES 5 /* Permission denied */ #define EBADF 6 /* Bad file number */ #define ENOMEM 8 /* Not enough core */ #define ENODEV 15 /* No such device */ #define EINVAL 19 /* Invalid argument */ #define E2BIG 20 /* Arg list too long */ #define ENOEXEC 21 /* Exec format error */ #define EXDEV 22 /* Cross-device link */ #define EDOM 33 /* Math argument */ #define ERANGE 34 /* Result too large */ #define EEXIST 35 /* File already exists */ #define EFAULT 36 /* Unknown error, I/O error, Proolix error */ #define EPERM 37 /* UNIX and Proolix error */ #define ESRCH 38 /* UNIX and Proolix error */ #define EINTR 39 /* UNIX and Proolix error */ #define EIO 40 /* UNIX and Proolix error */ #define ENXIO 41 /* UNIX and Proolix error */ #define ECHILD 42 /* UNIX and Proolix error */ #define EAGAIN 43 /* UNIX and Proolix error */ #define ENOTBLK 44 /* UNIX and Proolix error */ #define EBUSY 45 /* UNIX and Proolix error */ #define ENOTDIR 46 /* UNIX and Proolix error */ #define EISDIR 47 /* UNIX and Proolix error */ #define ENFILE 48 /* UNIX and Proolix error */ #define ENOTTY 49 /* UNIX and Proolix error */ #define ETXTBSY 50 /* UNIX and Proolix error */ #define EFBIG 51 /* UNIX and Proolix error */ #define ENOSPC 52 /* UNIX and Proolix error */ #define ESPIPE 53 /* UNIX and Proolix error */ #define EROFS 54 /* UNIX and Proolix error */ #define EMLINK 55 /* UNIX and Proolix error */ #define EPIPE 56 /* UNIX and Proolix error */ #define EUCLEAN 57 /* UNIX and Proolix error */ #define _sys_nerr 57 /* highest defined system error number */ extern int errno; src/include/fcntl.h0100664000076500007650000000232606312321004013772 0ustar prool2prool2/* fcntl.h Define flag values accessible to open. Copyright (c) Serge Pustovoitoff 1993-1997 Portions Copyright (c) 1983, 1990 The Regents of the University of California. All rights reserved. */ #ifndef _FCNTL_H_ #define _FCNTL_H_ /* DOS Fn=3C Directory Attribute Flags 76543210 Directory Attribute Flags 1 = read only 1 = hidden 1 = system 1 = volume label (exclusive) 1 = subdirectory 1 = archive unused */ #define O_RDONLY 1 #define O_WRONLY 2 #define O_RDWR 4 #define O_CREAT 0x0100 /* create and open file */ #define O_TRUNC 0x0200 /* open with truncation */ #define O_EXCL 0x0400 /* exclusive open */ #define O_APPEND 0x0800 /* to end of file */ /* MSDOS special bits */ #define O_TEXT 0x4000 /* CR-LF translation */ #define O_BINARY 0x8000 /* no translation */ /* Proolix special flag */ #define O_FREOPEN 8 #endif /* !_FCNTL_H_ */ src/include/io.h0100664000076500007650000000472406312074650013313 0ustar prool2prool2/* io.h Definitions for low level I/O functions. Copyright (c) Serge Pustovoitoff 1994-1997 */ #ifndef _IO_H #define _IO_H 1 #ifndef _MODE_T /* prool */ #define _MODE_T typedef unsigned int mode_t; #endif #ifndef _FTIME_ #define _FTIME_ struct ftime { unsigned ft_tsec : 5; /* Two second interval */ unsigned ft_min : 6; /* Minutes */ unsigned ft_hour : 5; /* Hours */ unsigned ft_day : 5; /* Days */ unsigned ft_month : 4; /* Months */ unsigned ft_year : 7; /* Year */ }; #endif #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 int access (const char far *path, int amode); /* prool */ int _chmod (const char far *path, int func, ... /* int attr */); /* prool */ int chmod (const char far *path, int amode); /* prool */ int chsize (int handle, long size); int _close (int handle); int close (int handle); int _creat (const char far *path, mode_t attribute); /* prool */ int creat (const char far *path, mode_t amode); /* prool */ int dup (int handle); int dup2 (int oldhandle, int newhandle); int eof (int handle); long filelength(int handle); int getftime (int handle, struct ftime far *ftimep); /* prool */ int ioctl (int handle, unsigned long func, ...); /* prool */ /* optional 3rd and 4th args are: void FAR * argdx, int argcx */ /* prool */ int isatty (int handle); long lseek (int handle, long offset, int fromwhere); int _open (const char far *path, int oflags); /* prool */ int open (const char far *path, int access,...); /* prool */ long int _read (int handle, void far *buf, unsigned long len);/*prool*/ long int read (int handle, void far *buf, unsigned long len);/*prool*/ int setftime (int handle, struct ftime far *ftimep); /* prool */ int setmode (int handle, int amode); long tell (int handle); unsigned umask (unsigned cmask); int unlink (const char far *path); int unlock (int handle, long offset, long length); long int _write(int handle, void far *buf, unsigned long len);/*prool*/ long int write(int handle, void far *buf, unsigned long len);/*prool*/ /* macros for compatibility with earlier versions & other compilers. */ #define sopen(path,access,shflag,mode) open (path, (access)|(shflag), mode) #endif /* _IO_H */ src/include/kbd.h0100664000076500007650000000167606123030516013440 0ustar prool2prool2/* kbd.h BIOS keyboard status Copyright (c) Serge Pustovoitoff 1999 */ #ifndef KBD_H #define KBD_H /* From [PC Help] BIOS keyboard flags (located in BIOSDataArea 40:17) 76543210 right shift key depressed left shift key depressed CTRL key depressed ALT key depressed scroll-lock is active num-lock is active caps-lock is active insert is active */ #define R_SHIFT 1 #define RIGHT_SHIFT 1 #define L_SHIFT 2 #define LEFT_SHIFT 2 #define CTRL 4 #define CONTROL 4 #define ALT 8 #define SCROLL_LOCK 0x10 #define NUM_LOCK 0x20 #define CAPS_LOCK 0x40 #define INS 0x80 #define INSERT 0x80 #endif src/include/limits.h0100664000076500007650000000541706605256630014212 0ustar prool2prool2/* limits.h Defines implementation specific limits on type values. Copyright (c) Serge Pustovoitoff 1993-1998 */ #ifndef LIMITS_H #define LIMITS_H here /* ⢥ ࠭祭 㫨. ᪮ - 쭮 祭 ᮣ᭮ ⠭ POSIX */ #define ARG_MAX 4096 /* (4096) . ᯨ᪠ 㬥⮢ । */ #define MAX_ENV 20 /* ᨬ쭮 ᫮ ६ । */ #define CHAR_BIT 8 /* (8) ᫮ ⨯ char */ /* ᨬ쭮 쭮 ⨯ char */ #if (((int)((char)0x80)) < 0) #define CHAR_MAX 0x7F #define CHAR_MIN 0x80 #else #define CHAR_MAX 0xFFU #define CHAR_MIN 0x00 #endif #define CHILD_MAX 6 /* (6) ᫮ ᮢ euid */ #define CLK_TCK 18 /* (10) ᫮ ⨪ ᥪ㭤 */ /* On TurboC 2.0 #define CLK_TCK 18.2 */ #define INT_MAX 0x7FFF /* ( 32767) */ #define INT_MIN ((int)0x8000) /* (-32767) */ #define LINK_MAX 8 /* (8) ᫮ 痢 䠩 */ #define LONG_MAX 0x7FFFFFFFL /* ( 2147483647) */ #define LONG_MIN ((long)0x80000000L) /* (-2147483647) */ #define MAX_CANON 255 /* (255) ᫮ । ନ */ #define MAX_INPUT 255 /* (255) */ #define MB_CUR_MAX 2 /* (MB_LEN_MAX) */ #define MB_LEN_MAX 2 /* (1) */ #define NAME_MAX 14 /* (14) ᫮ 䠩, 饣 NUL */ #define NGROUPS_MAX 1 /* (0) */ #ifndef OPEN_MAX #define OPEN_MAX 16 /* (16) ᫮ 䠩 */ #endif #ifndef TMP_MAX #define TMP_MAX 25 /* (25) */ #endif #define PATH_MAX 255 /* (255) */ #define PIPE_BUF 512 /* (512) */ #define SCHAR_MAX 0x7F /* ⨯ signed char */ #define SCHAR_MIN -128 /* . ⨯ signed char */ #define SHRT_MAX 0x7FFF /* ⨯ short */ #define SHRT_MIN ((int)0x8000) /* . ⨯ short */ #define UCHAR_MAX 0xFFU /* ⨯ unsigned char */ #define UINT_MAX 0xFFFFU /* ( 65535) */ #define ULONG_MAX 0xFFFFFFFFUL /* (4294967295) */ #define USHRT_MAX 0xFFFFU /* (65535) */ #define PROC_MAX 10 /* ᨬ쭮 ᫮ ᮢ */ /* ᮡ⢥ ࠭祭: */ /* - ࠭祭 祫 ;) */ /* ᨬ쭠 ப */ #define MAX_LEN_STR 256 #define PassLen 80 #define MAX_ARG 40 #define SECTOR_SIZE 512 #define FAT_SECS 7 #define MAX_LINE 24 #define RETRYES 15 #define BUFFERS 10 /* max 127. . ࠧ ୮ 㫠 - 64, 512+6=518 , 64 % 518 = 127. */ /* , 뤥塞 COM-䠩 (ࠣ䮢) */ #define ComMemory 0x1000UL #endifsrc/include/prool.h0100664000076500007650000000215406617053226014036 0ustar prool2prool2/* prool.h Prool's Global Header Version 1.0.12 1-Nov-98 Copyright (c) Serge Pustovoitoff, 1993-1998 */ #define EMAIL "E-mail prool@itl.net.ua" /* #define IP */ #define FIDO "FidoNet 2:461/35" #define BBS "none" #define VOICE "Voice (work) +380(572)123445, 235102" #define WWW "http://www.infocom.kharkov.ua/~prool/proolix.html" #define ESC 27 #define CR '\r' #define LF '\n' #define ENTER 13 #ifndef NULL #define NULL 0l #endif /* #define TAB '\t' #define HT '\t' #define SP ' ' #define SPACE ' ' #define BEL '\7' #define BEEP '\7' #define VT 11 #define FF 12 #define SO 14 #define SI 15 #define DC2 18 #define DC4 20 #define CAN 24 #define DEL 127 #define BS 8 */ src/include/proto.h0100664000076500007650000000731407007552234014046 0ustar prool2prool2/* proto.h Proolix Kernel Internal Fuctions Prototypes Copyright (c) Serge Pustovoitoff 1996 */ void loop(void); int mshercinit(void); void saycsip (void); void reboot (void); int bootread0 (int Dev, void far * Buf); int bootread (int Dev, void far *Buf); int secread (int dev, unsigned long lsect /* 0 - first for C convention */, char *buf); int secwrite (int dev, unsigned long lsect, char *buf); int ReadPhysSec (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk, void *Buffer); int ReadPhysSec2 (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk /* or cyl */, void far *Buf); int WritePhysSec (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk, char *Buffer); void far *end (void); void msdos(void); void initv(void); unsigned char unpack(unsigned char c); int PathToDir(const char far *path, struct dirent far *Dir); char *DirToPath(struct dirent far *Dir, char *path); void interrupt far sh (void); void interrupt far msh (void); int FlushAll(void); int LoadCache (unsigned long sec); int NewCache (unsigned long sec); int garbage (void); int shutdown(void); void reboot (void); void msdos(void); void ident(void); int l (int argc, char far *argv[]); void rm(int argc, char far *argv[] ); void mv(int argc, char far *argv[] ); void cp(int argc, char far *argv[] ); void e(int argc, char far*argv[]); void mem(void); void memd(void); void cat (int argc, char far *argv[] ); void vec(int argc,char far *argv[]); void de (void); void mount(int NewDevice); void umount(void); unsigned com_address ( int portid ) ; int readRTC (char *Hour, char *Min, char *Sec, char *Flag); int readRTCdate (char *Century, char *Year, char *Month, char *Day); int ReadTick (unsigned long *Tick, char *Flag); void On (char *str); void Off (char *str); unsigned long SecForClu (unsigned int CluNo); unsigned int NextClu (unsigned int CluNo); unsigned int NextClu2 (unsigned int CluNo); int LinkClu (unsigned int CluNo, unsigned int NeXT); unsigned int GetFreeClu(void); unsigned int AppendClu(unsigned int CluNo); int CluRead (int drive, unsigned int CluNo, void far * buffer); int putch0 (int); int putch1 (int); int putch2 (int); int putch3 (int); int open2 (int h, const char far *path, int flag); void sched (void); int OutIntVector(int i); #ifndef exe_header #include #endif int ViewEXE (struct exe_header far *Buf); void outMBR(char far *buf); void interrupt done(void); void interrupt CtrlAltDel(void); void interrupt Int0(void); void interrupt Int1(void); void interrupt Int2(void); void interrupt Int3(void); void interrupt Int4(void); void interrupt Int6(void); void interrupt Int7(void); void interrupt Int8(void); void interrupt Int20(void); void interrupt Int21(void); void interrupt Int75(void); void init (void); void nulldev (void); void FDDstrategy (void); void HDDstrategy (void); int execpix(void far *mem0,int len); int execdos(void far *mem0,int len); void SysCall1(void); void Int5dump(void); /* H ᠬ - interrupt far 㭪樨. H ᯥ譮 ᡮન com-䠩 諮 㪠 㪠 拉 ᥣ 祭 ணࠬ 墠. (. ᮮ. 맮 setvect(INT_NO, ... ) */ void ps (void); unsigned int stackend (void); unsigned int kernel_begin (void); unsigned int mem_top(void); void interrupt SysCall2(); int TR (int curdev); void print_mount (void); void out_devices (void); char dos_letter(int); unsigned int par_size_of_block ( void far *); void exitw (void);src/include/psp.h0100664000076500007650000000462006445322162013502 0ustar prool2prool2/* psp.h Program Segment Prefix (PSP) structure Copyright (c) Serge Pustovoitoff 1997 */ struct sPSP { /* by Prool */ /* comments from [Help PC] */ int CD20; /* machine code INT 20 instruction (CDh 20h) */ unsigned int TopMemPar; /* top of memory in segment (paragraph) form */ char Reserved; /* reserved for DOS, usually 0 */ /* 5 bytes - machine code instruction long call to the DOS */ /* function dispatcher (obsolete CP/M) */ char op; /* cpm_offset or .COM programs bytes available in segment */ unsigned int Avail; unsigned int cpm_segment; unsigned long Int22; /* INT 22 terminate address; used by Proolix and MSDOS */ unsigned long Int23; /* INT 23 Ctrl-Break exit address; the original INT 23 */ /* vector is NOT restored from this pointer (IP,CS) */ unsigned long Int24; /* INT 24 critical error exit address; the original */ /* INT 24 vector is NOT restored from this field (IP,CS) */ unsigned int ParentSeg; /* parent process segment addr (Undoc. DOS 2.x+) */ /* COMMAND.COM has a parent id of zero, or its own PSP */ char aHandle [20]; /* file handle array (Undocumented DOS 2.x+); if handle */ /* array element is FF then handle is available. Network */ /* redirectors often indicate remotes files by setting */ /* these to values between 80-FE. */ unsigned int aEnv; /* segment address of the environment, or zero (DOS 2.x+) */ unsigned long SS_SP; /* SS:SP on entry to last INT 21 function (Undoc. 2.x+) */ unsigned int sHandle; /* handle array size (Undocumented DOS 3.x+) */ unsigned long pHandle; /* handle array pointer (Undocumented DOS 3.x+) */ unsigned long prevPSP; /* pointer to previous PSP (deflt FFFF:FFFF, Undoc 3.x+) */ char DOS401 [20]; /* unused in DOS before 4.01 */ char FnCB [3]; /* DOS function dispatcher CDh 21h CBh (Undoc. 3.x+) */ char Unused [9]; char FCB1 [16]; /* default unopened FCB #1 (parts overlayed by FCB #2) */ char FCB2 [20]; /* default unopened FCB #2 (overlays part of FCB #1) */ unsigned char cLine_ctr; /* count of characters in command tail; all bytes */ /* following command name; also default DTA (128 bytes) */ char cLine [127]; /* all characters entered after the program name followed */ /* by a CR byte */ }; src/include/psp.inc0100664000076500007650000000476306445011530014026 0ustar prool2prool2 ; struct sPSP { by Prool comments from [Help PC] ; original from dos.h CD20 dw ? ; machine code INT 20 instruction (CDh 20h) TopMemPar dw ? ; top of memory in segment (paragraph) form Reserved db ? ; reserved for DOS, usually 0 LongCall db 5 dup (?) ; machine code instruction long call to the DOS ; function dispatcher (obsolete CP/M) Avail dw ? ; .COM programs bytes available in segment (CP/M) Int22 dd ? ; INT 22 terminate address; used by Proolix and MSDOS Int23 dd ? ; INT 23 Ctrl-Break exit address; the original INT 23 ; vector is NOT restored from this pointer (IP,CS) Int24 dd ? ; INT 24 critical error exit address; the original ; INT 24 vector is NOT restored from this field (IP,CS) ParentSeg dw ? ; parent process segment addr (Undoc. DOS 2.x+) ; COMMAND.COM has a parent id of zero, or its own PSP aHandle db 20 dup (?) ; file handle array (Undocumented DOS 2.x+); if handle ; array element is FF then handle is available. Network ; redirectors often indicate remotes files by setting ; these to values between 80-FE. aEnv dw ? ; segment address of the environment, or zero (DOS 2.x+) SS_SP dd ? ; SS:SP on entry to last INT 21 function (Undoc. 2.x+) sHandle dw ? ; handle array size (Undocumented DOS 3.x+) pHandle dd ? ; handle array pointer (Undocumented DOS 3.x+) prevPSP dd ? ; pointer to previous PSP (deflt FFFF:FFFF, Undoc 3.x+) DOS401 db 20 dup (?) ; unused in DOS before 4.01 FnCB db 3 dup (?) ; DOS function dispatcher CDh 21h CBh (Undoc. 3.x+) LList dd ? ; Proolix: far address of LList structure ; DOS: unused Unused db 4 dup (?) ; DOS: unused FCB1 db 16 dup (?) ; default unopened FCB #1 (parts overlayed by FCB #2) FCB2 db 19 dup (?) ; default unopened FCB #2 (overlays part of FCB #1) cLine_ctr db ? ; count of characters in command tail; all bytes ; following command name; also default DTA (128 bytes) cLine db 127 dup (?) ; all characters entered after the program name followed ; by a CR byte src/include/stdlib.h0100664000076500007650000000641106312075616014163 0ustar prool2prool2/* stdlib.h Definitions for common types, variables, and functions. Copyright (c) Serge Pustovoitoff 1994-1997 */ #if !defined(__STDLIB) #define __STDLIB #ifndef _SIZE_T #define _SIZE_T typedef unsigned long size_t; #endif #ifndef _DIV_T #define _DIV_T typedef struct { int quot; int rem; } div_t; #endif #ifndef _LDIV_T #define _LDIV_T typedef struct { long quot; long rem; } ldiv_t; #endif /* Maximum value returned by "rand" function */ #define RAND_MAX 0x7FFF typedef void (* atexit_t)(void); int abs (int x); double atof (const char *s); int htoi (const char far *s); /* prool */ long int htol (const char far *s); /* prool */ int atoi (const char far *s); /* prool */ long atol (const char far *s); /* prool */ void far * calloc (size_t nitems, size_t size); /* prool */ div_t div (int numer, int denom); void exit (int status); void free (void far *block); /* prool */ char far * getenv (const char far *name); /* prool */ long labs (long x); ldiv_t ldiv (long numer, long denom); void far * malloc (size_t size); /* prool */ void qsort (void far *base, size_t nelem, size_t width,/*prool*/ int /**/ (far *fcmp) (/* const void far *, const void far * */)); int rand (void); void far * realloc(void far *block, size_t size); /* prool */ void srand (unsigned seed); double strtod (const char *s, char **endptr); long strtol (const char *s, char **endptr, int radix); int system (const char far *command); unsigned long strtoul (const char *s, char **endptr, int radix); #if !__STDC__ #ifndef NULL #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #define NULL 0 #else #define NULL 0L #endif #endif /* Variables */ extern int errno; extern char ** environ; extern char * sys_errlist[]; /* prool */ #define abs(x) (((x) < (0)) ? (-(x)) : (x)) /* prool */ #define labs(x) (((x) < (0)) ? (-(x)) : (x)) /* prool */ #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #define random(num) (rand() % (num)) #define randomize() srand((unsigned)time(NULL)) char * ecvt (double value, int ndig, int *dec, int *sign); void _exit (int status); char * fcvt (double value, int ndig, int *dec, int *sign); char * gcvt (double value, int ndec, char *buf); char far * itoa (int value, char far *string, int radix); /* prool */ void * lfind (const void *key, const void *base, size_t *num, size_t width, int (*fcmp)(/* const void *, const void * */)); unsigned long _lrotl(unsigned long val, int count); unsigned long _lrotr(unsigned long val, int count); char far * ltoa (long value, char far *string, int radix); /* prool */ int putenv (const char *name); unsigned _rotl (unsigned value, int count); unsigned _rotr (unsigned value, int count); char far * ultoa (unsigned long value, char far *string, int radix); /* prool */ #endif #endif src/include/string.h0100664000076500007650000000447506312072312014206 0ustar prool2prool2/* string.h Definitions for memory and string functions. Copyright (c) Serge Pustovoitoff 1994-1997 */ #ifndef _SIZE_T #define _SIZE_T typedef unsigned long size_t; #endif void far * memccpy (void far *dest,const void far *src,int c, size_t n); void far * memchr (const void far *s, int c, size_t n); int memcmp (const void far *s1, const void far *s2, size_t n); void far * memcpy (void far *dest, const void far *src, size_t n); int memicmp (const void far *s1, const void far *s2, size_t n); void far * memmove (void far *dest, const void far *src, size_t n); void far * memset (void far *s, int c, size_t n); void movedata(unsigned srcseg, unsigned srcoff, unsigned dstseg, unsigned dstoff, size_t n); char far * stpcpy (char far *dest, const char far *src); char far * strcat (char far *dest, const char far *src); char far * strchr (const char far *s, int c); int strcmp (const char far*s1, const char far*s2); char far * strcpy (char far*dest, const char far*src); size_t strcspn (const char far *s1, const char far *s2); char far * strdup (const char far *s); char far * strerror(int errnum); int stricmp (const char far *s1, const char far *s2); size_t strlen (const char far *s); char far * strlwr (char far *s); char far * strncat (char far *dest, const char far *src, size_t maxlen); int strncmp (const char far *s1, const char far *s2, size_t maxlen); char far * strncpy (char far*dest, const char far*src, size_t maxlen); int strnicmp(const char far *s1, const char far *s2, size_t maxlen); char far * strnset (char far *s, int ch, size_t n); char far * strpbrk (const char far *s1, const char far *s2); char far * strrchr (const char far *s, int c); char far * strrev (char far *s); char far * strset (char far *s, int ch); size_t strspn (const char far *s1, const char far *s2); char far * strstr (const char far *s1, const char far *s2); char far * strtok (char far *s1, const char far *s2); char far * strupr (char far *s); char far * _strerror (const char far *s); /* compatibility with other compilers */ #define strcmpi(s1,s2) stricmp(s1,s2) #define strncmpi(s1,s2,n) strnicmp(s1,s2,n) src/include/struct.h0100664000076500007650000001214506652162020014220 0ustar prool2prool2/* struct.h Proolix Kernel structures (struct) Copyright (c) Serge Pustovoitoff 1994, 1995 */ #ifndef LIMITS_H #include "limits.h" #endif #ifndef _IO_H #include #endif #if !defined(__TIME_DATE_) #define __TIME_DATE_ struct time { unsigned char ti_min; /* Minutes */ unsigned char ti_hour; /* Hours */ unsigned char ti_hund; /* Hundredths of seconds */ unsigned char ti_sec; /* Seconds */ }; struct date { int da_year; /* Year - 1980 */ char da_day; /* Day of the month */ char da_mon; /* Month (1 = Jan) */ }; #endif #ifndef STRUCT_H #define STRUCT_H struct MemBlk { char Type; unsigned int OwnerPar; unsigned int SizePar; }; /* struct TimeField { unsigned int Sec2 : 5; unsigned int Min : 6; unsigned int Hour : 5; }; struct DateField { unsigned int Day : 5; unsigned int Month : 4; unsigned int Year : 7; }; */ struct BootStru { char Jmp [3]; char OEM [8]; int SectSiz; char ClustSiz; int ResSecs; char FatCnt; int RootSiz; unsigned int TotSecs; char Media; int FatSize; int TrkSecs; int HeadCnt; unsigned long HidnSec; unsigned long BigSect; char DriveNo; char Thing; char BootSign; int SerialNo [2]; char VolLbl [11]; char FileSysId [8]; /* int FATaddr; int StartClu; int RootSize; */ }; struct Partition_stru { unsigned char indicator; /* 00 - non-bootable partition 80 - bootable partition (one partition only) */ unsigned char begin_head; unsigned char begin_sec; /* and 2 high bits of cylinder # */ unsigned char begin_cyl; /* low order bits of cylinder # */ /* 2 bytes are combined to a word similar to INT 13: 76543210 1st byte (sector) Sector offset within cylinder High order bits of cylinder # 76543210 2nd byte (cylinder) Low order bits of cylinder # */ unsigned char system_indicator; unsigned char end_head; unsigned char end_sec; /* and 2 high bits of cylinder # */ unsigned char end_cyl; /* low order bits of cylinder # */ unsigned long preceding_sec; unsigned long total_sec; }; struct MBRstru { char master_boot_loader [0x1BE]; struct Partition_stru Partition [4]; unsigned int Signature; /* 55AA */ }; struct DevRecord { char *Name; int Major; int Minor; char Byte; /* 1 - byte-oriented device, 0 - block-oriented */ }; struct DevByte { void (*dev_open) (); void (*dev_close) (); void (*dev_read) (); void (*dev_write) (); void (*dev_ioctl) (); }; struct DevBlock { void (*dev_open) (); void (*dev_close) (); void (*dev_strategy) (); }; /* ⠡ ᮢ */ #include struct processes { int pid; int status; /* 1 - ⨢, 0 - ⨢ ( ) */ int wait; /* pid (), 砭 ⮣ 0, ᫨ */ jmp_buf control_point; char huge *mem0; }; /* ୮ 㫠 */ struct BufPool { unsigned long Sec; unsigned int Status; /* : 0 - ᢮, 1 - , 2 - */ unsigned int Counter; unsigned char M [SECTOR_SIZE]; }; struct reloc { unsigned int offset; unsigned int segment; }; /* ᯮ塞 EXE 䠩 ( MSDOS) */ struct exe_header { /* ਨ [TECH Help!] */ char MZ[2]; /* "" 䠩 .EXE ('MZ') */ unsigned int PartPag; /* ᫥ ࠭ (筮 ) */ unsigned int PageCnt; /* ࠧ 512-⮢ ࠭, */ unsigned int ReloCnt; /* ᫮ ⮢ ⠡ ६饭 */ unsigned int HdrSize; /* 16-⮢ ࠣ */ unsigned int MinMem; /* ॡ㥬 殬 ணࠬ (ࠣ) */ unsigned int MaxMem; /* ᨬ ॡ㥬 殬 ணࠬ (ࠣ) */ unsigned int ReloSS; /* ᥣ⭮ ᬥ饭 ᥣ ⥪ ( ⠭ SS) */ unsigned int ExeSP; /* 祭 ॣ SP (㪠⥫ ⥪) ᪥ */ unsigned int ChkSum; /* ஫쭠 㬬 (⥫쭠 㬬 ᫮ 䠩) */ unsigned int ExeIP; /* 祭 ॣ IP (㪠⥫ ) ᪥ */ unsigned int ReloCS; /* ᥣ⭮ ᬥ饭 ᥣ ( ⠭ CS) */ unsigned int TablOff; /* ᬥ饭 䠩 1- ६饭 ( 001cH) */ unsigned int Overlay; /* ૥ (0 ) */ struct reloc RelTbl []; }; struct DeviceStruct { char FileSystem; int head; int sec; int trk; unsigned long ResSecs; unsigned long MaxSectors; char dos_disk; /* 'A' 'B' 'C' 'D' ... */ char system_indicator; }; #endif src/include/sys/0040775000076500007650000000000007150743252013347 5ustar prool2prool2src/include/sys/STAT.H0100664000076500007650000000651306312072130014222 0ustar prool2prool2/* stat.h Definitions used for file status functions Copyright (c) Serge Pustovoitoff 1995-1997 */ #include #ifndef _STAT_H #define _STAT_H 1 #define S_IFMT 0xF000 /* file type mask */ #define S_IFDIR 0x4000 /* directory */ #define S_IFIFO 0x1000 /* FIFO special */ #define S_IFCHR 0x2000 /* character special */ #define S_IFBLK 0x3000 /* block special */ #define S_IFREG 0x8000 /* or just 0x0000, regular */ #define S_IREAD 0x0100 /* owner may read */ #define S_IWRITE 0x0080 /* owner may write */ #define S_IEXEC 0x0040 /* owner may execute */ int fstat (int handle, struct stat far *statbuf); /* prool */ int stat (char far *path, struct stat far *statbuf); /* prool */ #define lstat stat #if 1 /* Modified by Prool */ #define S_ISDIR(m) (m & FA_DIREC) /* directory */ /* regular file */ #define S_ISREG(m) (!((m & FA_DIREC)||(m & FA_LABEL))) /* fifo: include both fifo and socket (pipe) */ #if 1 #define S_ISFIFO(m) (0) #define S_ISLNK(m) (0) /* symbolic link */ #define S_ISCHR(m) (0) /* char special */ #define S_ISBLK(m) (0) /* block special */ #define S_ISSOCK(m) (0) /* socket */ #endif #define S_ISLABEL(m) (m & FA_LABEL) /* device label */ /* * Current stat structure with larger uid/gid/dev fields; * still 32-bit offsets and sizes, so we reserve space to increase later. */ struct stat { dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ nlink_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ dev_t st_rdev; /* device type */ #ifdef notyet struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ #else time_t st_atime; /* time of last access */ long st_spare1; time_t st_mtime; /* time of last data modification */ long st_spare2; time_t st_ctime; /* time of last file status change */ long st_spare3; #endif off_t st_size; /* file size, in bytes */ long st_size1; /* reserved for st_size expansion */ long st_blocks; /* blocks allocated for file */ long st_blocks1; /* reserved for st_blocks expansion */ unsigned long st_blksize; /* optimal blocksize for I/O */ unsigned long st_flags; /* user defined flags for file */ unsigned long st_gen; /* file generation number */ long st_lspare; long st_qspare[2*2]; }; #endif int mkdir (const char far *path, mode_t mode); /* prool */ #endif /* _STAT_H */ src/include/sys/TYPES.H0100664000076500007650000000202606312070064014352 0ustar prool2prool2/* types.h Types. Copyright (c) Serge Pustovoitoff 1994-1997 */ #ifndef __TIME_T #define __TIME_T typedef long time_t; #endif #ifndef _SIZE_T #define _SIZE_T typedef unsigned long size_t; #endif #ifndef _MODE_T /* prool */ #define _MODE_T typedef unsigned int mode_t; #endif #ifndef __CLOCK_T #define __CLOCK_T typedef long clock_t; #endif #ifndef _DIV_T #define _DIV_T typedef struct { int quot; int rem; } div_t; #endif #ifndef _LDIV_T #define _LDIV_T typedef struct { long quot; long rem; } ldiv_t; #endif #ifndef _TYPES_H /* prool */ #define _TYPES_H #ifndef _CC_T /* prool */ #define _CC_T typedef unsigned char cc_t; #endif typedef int dev_t; typedef int gid_t; typedef int ino_t; typedef unsigned nlink_t; typedef unsigned long off_t; typedef int pid_t; typedef void far *sigjmp_buf; typedef unsigned speed_t; typedef unsigned tcflag_t; typedef int uid_t; typedef unsigned wchar_t; #endif src/include/unistd.h0100664000076500007650000000105506312075730014204 0ustar prool2prool2/* unistd.h Copyright (c) Serge Pustovoitoff 1994, 1995 */ #ifndef _UNISTD_H_ #define _UNISTD_H_ #include /* #define POSIX_JOB_CONTROL */ /* #define POSIX_SAVED_IDS */ /* #define POSIX_VERSION 199401L */ /* ᨨ ⠭ POSIX */ /* #define POSIX_CHOWN_RESTRICTED */ /* #define POSIX_NO_TRUNC */ /* ᫨ ।, , ᮤ. NAME_MAX ᨬ . 訡, H . ⮫쪮 NAME_MAX ᨬ */ /* #define POSIX_VDISABLE 0 */ #endif /* !_UNISTD_H_ */ src/include/stdio.h0100664000076500007650000001522006336707014014022 0ustar prool2prool2/* stdio.h Definitions for stream input/output. Copyright (c) Serge Pustovoitoff 1994-1997 */ #if !defined(__STDIO_DEF_) #define __STDIO_DEF_ #include #ifndef _FTIME_ #define _FTIME_ struct ftime { unsigned ft_tsec : 5; /* Two second interval */ unsigned ft_min : 6; /* Minutes */ unsigned ft_hour : 5; /* Hours */ unsigned ft_day : 5; /* Days */ unsigned ft_month : 4; /* Months */ unsigned ft_year : 7; /* Year */ }; #endif #ifndef _ATTRFIELD_ #define _ATTRFIELD_ struct AttrField { unsigned int ReadOnly : 1; unsigned int Hidden : 1; unsigned int System : 1; unsigned int Label : 1; unsigned int Dir : 1; unsigned int Archive : 1; unsigned int Attr2 : 1; unsigned int Attr1 : 1; }; union FileAttr { struct AttrField B; unsigned char U; }; #endif #ifndef _SIZE_T #define _SIZE_T typedef unsigned long size_t; #endif #ifndef NULL # if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) # define NULL 0 # else # define NULL 0L # endif #endif #if !defined(__STDARG) #include #endif /* prool */ /* Definition of the control structure for streams */ typedef struct {char Name [NAME_MAX+1]; char File; /* file type: 0 - device driver, 1 - ordinary file, 2 - directory, 3 - MS DOS root directory */ /* int Major; int Minor; */ union FileAttr Attr; int flag; struct ftime FileDateTime; unsigned int BegClu; /* 䠩 ⠫ - 砫 , ᯥ樠 䠩 - ᯥ. 䠩 ⠡ */ unsigned long int Size; unsigned int Drive; /* or filesystem */ /* inode (.) ⠫ ⮬ 䠩 */ unsigned int DirInode; /* 樨 ⮬ 䠩 ⠫ (. opendir() seekdir() */ long DirSeekPos; unsigned int AbsClu; unsigned long AbsSec; unsigned long AbsOffset; char Buf [32]; } FILE; /* End-of-file constant definition */ #define EOF (-1) /* End of file indicator */ /* Constants to be used as 3rd argument for "fseek" function */ #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 #if 1 /* prool */ extern FILE far *stdin ; extern FILE far *stdout; extern FILE far *stderr; #else /* Standard I/O predefined streams for MSDOS TurboC 2.0 */ extern FILE _streams[]; #define stdin (&_streams[0]) #define stdout (&_streams[1]) #define stderr (&_streams[2]) #define stdaux (&_streams[3]) #define stdprn (&_streams[4]) #endif void ohd (unsigned long int ll); /* prool */ void ohs (const char far *s); /* prool */ typedef long fpos_t; int fgetpos (FILE far *stream, fpos_t far *pos); /* prool */ int fsetpos (FILE far *stream, const fpos_t far *pos); /* prool */ int fclose (FILE far *stream); /* prool */ int fflush (FILE far *stream); /* prool */ int fgetc (FILE far *stream); /* prool */ FILE far* fopen (const char far *path, const char far *mode); /* prool */ int fprintf (FILE far *stream, const char far *format, ...); /* prool */ int fputc (int c, FILE far *stream); /* prool */ int fputs (const char far *s, FILE far *stream); /* prool */ size_t fread (void far *ptr, size_t size, size_t n, FILE far *stream); /* prool */ FILE far* freopen (const char far *path, const char far *mode, FILE far *stream); /* prool */ int fscanf (FILE *stream, const char *format, ...); int fseek (FILE far *stream, long offset, int wh); /* prool */ long ftell (FILE far *stream); /* prool */ size_t fwrite (const void far *ptr, size_t size, size_t n, FILE far *stream); /* prool */ #ifdef KERNEL /* proolix */ char * gets (char *s); char * fgets (char *s, int n, FILE far *stream); #else char far * gets (char far *s); char far * fgets (char far *s, int n, FILE far *stream); #endif char far* _gets (char far *s); /* prool */ void perror (const char far *s); /* prool */ int printf (const char far *format, ...); /* prool */ int puts (const char far *s); /* prool */ #define puts0(s) printf(s) /* ᮢ⨬ 㫥 (㫥 - 稥) */ int Puts0 (const char far *str); /* Prool */ int puti (int w, int Prec, int Zeroes); /* prool */ int putl (long int w, int Prec, int Zeroes); /* prool */ int rename (const char far *oldname, const char far *newname); /* prool */ void rewind (FILE far *stream); /* prool */ int scanf (const char *format, ...); int sprintf (char far *buffer, const char far *format, ...); /* prool */ int sscanf (const char *buffer, const char *format, ...); char far* strerror (int errnum); int ungetc (int c, FILE *stream); int vfprintf (FILE *stream, const char *format, va_list arglist); /* prool */ int vfscanf (FILE *stream, const char *format, va_list arglist); int vprintf (const char far *format, va_list arglist); /* prool */ int vscanf (const char *format, va_list arglist); int vsprintf (char far *buffer, const char far *format, va_list arglist); /* prool */ int vsscanf (const char *buffer, const char *format, va_list arglist); #if !__STDC__ int fcloseall(void); FILE far* fdopen (int handle, char far *type); /* prool */ int fgetchar (void); int flushall (void); int fputchar (int c); int getw (FILE *stream); int putw (int w, FILE *stream); char far* _strerror(const char far *s); int unlink (const char far *path); /* prool */ #ifdef KERNEL int delete (const char far *path); /* prool */ #endif #endif int _fgetc (FILE *stream); /* used by getc() macro */ int _fputc (char c, FILE *stream); /* used by putc() macro */ int fileno (const FILE far *stream); /* prool */ /* The following macros provide for common functions */ #ifdef Proolix int feof (FILE far *stream); int ferror (FILE far *stream); #else #define ferror(f) ((f)->flags & _F_ERR) #define feof(f) ((f)->flags & _F_EOF) #endif #define remove(path) unlink(path) #define getc(f) fgetc(f) #define putc(c,f) fputc(c,f) int putchar (int); int getchar (void); #define ungetc(c,f) ungetc((c),f) /* traditionally a macro */ extern int More; /* prool */ extern int NLine; /* prool */ #endif src/include/stdarg.h0100664000076500007650000000101506312071362014153 0ustar prool2prool2/* stdarg.h Definitions for accessing parameters in functions that accept a variable number of arguments. Copyright (c) Serge Pustovoitoff 1993-1997 */ #if !defined(__STDARG) #define __STDARG typedef void far *va_list; /* prool */ #define va_start(ap, parmN) (ap = ...) #if 0 #define va_arg(ap, type) (*((type *)(ap))++) #else #define va_arg(ap, type) (*((type far *)(ap))++) #endif #define va_end(ap) #define _va_ptr (...) #endif src/include/time.h0100664000076500007650000000202206312072312013620 0ustar prool2prool2/* time.h Struct and function declarations for dealing with time. Copyright (c) Serge Pustovoitoff 1994-1997 */ #ifndef _TM_DEFINED #define _TM_DEFINED #ifndef __TIME_T #define __TIME_T typedef long time_t; #endif #ifndef __CLOCK_T #define __CLOCK_T typedef long clock_t; #endif struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; char * asctime (const struct tm *tblock); char far* ctime (time_t time); /* prool */ double difftime(time_t time2, time_t time1); struct tm * gmtime(const time_t *timer); struct tm * localtime(const time_t *timer); time_t time (time_t far *timer); /* proolix */ clock_t clock(void); #if !__STDC__ extern int daylight; extern long timezone; int stime(time_t *tp); void tzset(void); #endif #endif src/include/alloc.h0100664000076500007650000000121706312072544013770 0ustar prool2prool2/* alloc.h memory management functions and variables. Copyright (c) Serge Pustovoitoff 1993-1997 */ #ifndef _STDDEF #define _STDDEF #ifndef _SIZE_T #define _SIZE_T typedef unsigned long size_t; #endif #endif #ifndef NULL #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #define NULL 0 #else #define NULL 0L #endif #endif void far* calloc (size_t nitems, size_t size); /* prool */ unsigned long coreleft (void); /* prool */ void free (void far *block); /* prool */ void far* malloc (size_t size); void far* realloc (void far *block, size_t size); /* prool */ src/include/process.h0100664000076500007650000000202506664032402014351 0ustar prool2prool2/* process.h Symbols and structures for process management. Copyright (c) Serge Pustovoitoff 1994-1999 */ #include int exec(char far *path); int execl(char far *path, char far *arg0, ...); int execle(char far *path, char far *arg0, ...); int execlp(char far *path, char far *arg0, ...); int execlpe(char far *path, char far *arg0, ...); int execv(char far *path, char far *argv[]); int execve(char far*name, char far*_argv[], char far*far*env); int execvp(char far *path, char far *argv[]); int execvpe(char far *path, char far *argv[], char far *far *env); void exit(int status); void _exit(int status); int system(const char far *command); /* Proolix */ int fork (void); /* Proolix */ int service(int fn); /* Proolix: kernel service: fn=0 - ps */ void ps_(void); /* Proolix */ int wait (pid_t pid); /* Proolix */ int sema_lock (int far *sema); /* Proolix */ void sema_unlock (int far *sema); /* Proolix */ src/include/readme.1st0100664000076500007650000000220306645132324014411 0ustar prool2prool2 Proolix Include Files (Headers, *.h for C-compiler) (C) Serge Pustovoitoff, 1995-1999 ᫨ Proolix । (ifdef Proolix), ᡮઠ 㫨 㫨c-⨫. ६ KERNEL ᯮ ਣ묨 header' by BSD 筮 . ᫨ KERNEL ।, ந室 BSD Proolix. ᫨ KERNEL ।, , ⨫ ணࠬ 짮⥫. 室 - ⮣, ⥬ 맮 㭪樨 ࠧ 맮 譥 ⨫. , ⨫ 㫨 । ⥬ 맮 ࠬ ⨯ char * 䨪 char far * ( ᬮ , ⨫ ஬ Turbo C 2.0 tiny, 뫪 ⨯ char *  㬮砭 near). 易 ⥬, ⨫ ⪮஢ tiny ⮬ 뫪 ⨫ ⭮ ந ⮫쪮 far-㪠⥫ﬨ, 祬 ᫮ far 㪠뢠 . ࣥ ⮢⮢, 13-03-97. 21:25:46 prool@infocom.kharkov.ua Fido 2:461/35 src/develop/0040775000076500007650000000000007725636611012554 5ustar prool2prool2src/develop/man.c0100664000076500007650000000336306723536510013467 0ustar prool2prool2/* Man utility for Proolix by Yurii Rashkovskii ( 2:461/11@fidonet.org, yrashk@antisocial.com ) 27.04.98 # Started (1st release) man 0.1 Thanks to Prool for his more.c sources. */ #include #include #include #include #define MAN "/usr/man/" #define MAX_LINE 24 #define STR_LEN 256 #define Proolix char man_d[120]; void getman(char *prog); void main(int argc,char *argv[]) {char str[120]; FILE far *fp; printf("man 0.1 utility, Copyright (c) 1998, Yurii Rashkovskii \n"); if (argc==1) getman("man"); else { strcpy(str,MAN); strcat(str,argv[1]); fp=fopen(str,"r"); if (fp==NULL) { setcolor(0x0F); printf("man: Unable to open %s (help file)\nPlease type 'man man' to get help\n",str); setcolor(0x07); } else { fgets(man_d,1,fp); man_d[29]=0; fclose(fp); getman(argv[1]); } } } void getman(char *prog) { {char str [STR_LEN]; char st[120]; FILE far *ff; int l, z,nl=1, counter=0; strcpy(st,MAN); strcat(st,prog); printf("man: listing %s%s\n",MAN,prog); if ((ff=fopen(st,"r"))==NULL) {printf("man: Can't open %s\n",prog);} else while (fgets(str,STR_LEN,ff)!=NULL) { l=(int)strlen(str); if (str[l-1]=='\n') str[l-1]=0; /* ohs(str); */ #ifdef Proolix if (str[0]==10) puts(str+1); else puts(str); #else puts(str); #endif counter++; if (++nl>MAX_LINE) { printf(" %% ( [ %s ] [%i] of [%i] [ ESC exits ])",man_d,counter-(MAX_LINE-1),counter); if (getchar()==27) { printf("\n"); break; } puts(""); nl=1; for (z=1;z<25;z++) printf("\n"); } } } }src/develop/makefile0100664000076500007650000000532506761506674014262 0ustar prool2prool2# OS Proolix - development kit makefile # Use Turbo C 2.0 make TasmFlags = /w2 /t /q /ml /z /m4 # '-v+ -y+' is debug switches # TCFlag = -I..\include -DProolix -v+ -y+ TCFlag = -N- -I..\include -DProolix -wcln -wsig -wucp -wrvl -wamp -wamb -wnod \ -wpro -K TCFlag = $(TCFlag) -g1 -j1 CPPFlag = -I..\include -DProolix TC = \tc Kernel = ..\kernel Include = ..\include .obj.com: tlink /c/t/m/s/x ..\command\c1 $&,$&,,..\command\lib1 $(Kernel)\cs0 .c.obj: tcc -ms -c $(TCFlag) $& .asm.obj: tasm $(TasmFlags) $& .c.asm: tcc -mt -c -S $(TCFlag) $& .c.i: cpp $(CPPFlag) $& all: hello he bpatch.com hc bpatch.com: bpatch.c tcc -mt -lt bpatch ############################################################################## # memory model small he: he.obj tlink /c/m/s/x ..\command\ce $&,$&.,,..\command\lib1 ..\kernel\cs0 bpatch he 0xAFDE he.obj: he.c tcc -ms -c $(TCFlag) $& he.asm: he.c tcc -ms -c -S $(TCFlag) $& ############################################################################## # memory model small hc: hc.obj tlink /c/m/s/x ..\command\ce $&,$&.,,..\command\lib1 cc0 bpatch hc 0xAFDE hc.obj: hc.c tcc -mc -c $(TCFlag) $& hc.asm: hc.c tcc -mc -c -S $(TCFlag) $& ############################################################################## hello: hello.obj tlink /c/t/m/s/x ..\command\c1 $&,$&.,,..\command\lib1 hello.obj: hello.c hello.asm: hello.c install: all copy hello a:\bin\hello copy he a:\bin\he copy hc a:\bin\hc clean: del *.bak del *.map del *.tmp del *.lst del hello.asm del m.asm del m.obj del m.com del m.exe del *.dic del *.i del norton.ini sh: sh.obj tlink /c/t/m/s/x ..\command\c1 $&,$&.,,..\command\lib1 sh.obj: sh.c zadroka.h $(Include)\conf.c $(Include)\limits.h \ $(Include)\unistd.h $(Include)\struct.h c:\bin\sh: sh copy sh c:\bin\sh t1: t1.obj tlink /c/t/m/s/x ..\command\c1 $&,$&.,,..\command\lib1 t1.obj: t1.c t2: t2.obj tlink /c/t/m/s/x ..\command\c1 $&,$&.,,..\command\lib1 t2.obj: t2.c src/develop/hc0100664000076500007650000000176606761253334013074 0ustar prool2prool2ޯ  6" rj*.3P\UFPPtP4YYP*YYFP YYPYY 3PY]ø̈́ø̈́ø̈́UVWv~ _^] static string dynamic string Hello, press any key stackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstacksrc/develop/hello.c0100664000076500007650000000031706471350200014001 0ustar prool2prool2#include #include #include #include void main(void) { printf("Hello, world! Ver from 14.02.98, 17:05:03 "); printf("press any key\n"); getch(); exit(0); } src/develop/cc0.lib0100664000076500007650000000200006516432046013667 0ustar prool2prool2 SCOPYh _TEXTCODE( SCOPY@ UVWv~ _^]OtLLSHCh _TEXTCODE( LXLSH@#sـ ˀ3˗tLURSHh _TEXTCODE(LXURSH@4#sـ ˀ3˓tLXMULh _TEXTCODE( LXMUL@Vt㑅tȖ^̊tM&5+!0:LLSH!LURSH!LXLSH@LXMUL!LXMUL@LXURSH@SCOPY!SCOPY@src/develop/files.bbs0100664000076500007650000000014306664352454014342 0ustar prool2prool2HELLO.C Hello, world! HE.C Hello, world! HC.C Hello, world! SH.C Proolix External Simply Shell src/develop/hc.c0100664000076500007650000000044606516424470013306 0ustar prool2prool2/* memory model compact */ #include #include #include #include char s1[]=" static string "; void main(void) { char s2[]=" dynamic string "; printf("Hello,\n"); printf(s1); printf(s2); printf("\npress any key\n"); getch(); exit(0); } src/develop/he0100664000076500007650000000176606761253334013076 0ustar prool2prool2ޯ  6" rj*.3P\UFPPtP4YYP*YYFP YYPYY 3PY]ø̈́ø̈́ø̈́UVWv~ _^] static string dynamic string Hello, press any key stackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstackstacksrc/develop/he.c0100664000076500007650000000044406516424366013312 0ustar prool2prool2/* memory model small */ #include #include #include #include char s1[]=" static string "; void main(void) { char s2[]=" dynamic string "; printf("Hello,\n"); printf(s1); printf(s2); printf("\npress any key\n"); getch(); exit(0); } src/develop/hello0100664000076500007650000000017406761253334013575 0ustar prool2prool2ޭX. BPYYmPYY 3PŸ́ø̈́ø̈́Hello, world! Ver from 14.02.98, 17:05:03 press any key src/develop/sh0100664000076500007650000000244306704435324013103 0ustar prool2prool2ޭX. UFPFPFPFPFPFPFPFP_P]VF.,P㋇, .u^UV3^&w&7UF^&& Gu^]VW353 P#DDF;|P3F}| tGP|_^VP3LJLJF|*((&_&&G&GP(PTP>(t؀>( t3( uƄ(F(u&3( t ( tFO|(uu(ڋ&㉗.,&>&(~PY( t( t FO}(u值(t2Ƅ(F( t( u FO}(uO} (t|>&u&LJ.LJ,32H6.6, uJhF㋟H?u,&?uP@P6.6,6 tP6.6, uVP6.6, u@9P6.6, u6*6(OP6.6, uP6.6, u PDD$=u Ph=>$t6$DDWPFDD"6.6,sP8PLDD<PDDp^ø̈́ø̈́ø̈́ø̈́ø̈́ø̈́ø̈́ø;̈́ø̈́ø̈́ø̈́ø̈́ø̈́ø̈́ø̈́PUTTfuckfuck out Date is %2i-%02i-%02i %2i:%02i:%02i %s -Proolix external shell 12.04.99, 18:26:07 HOME=/$ Too many argumentsNull command clsclearechosetdatepssh: sorry, can't forksh: exec error src/develop/sh.c0100664000076500007650000000653206704440316013324 0ustar prool2prool2/* #define DEBUG */ #include #include #include #include #include #include #include #include "prool.h" #include "conf.c" #include "limits.h" #include "unistd.h" #include "struct.h" #include "zadroka.h" int p; int _argc; char far*_argv [MAX_ARG]; char str[MAX_LEN_STR]; char far * far * _env; char far* __env [MAX_ENV]; /*****************************************************************************/ void date (void) { struct date d; struct time t; getdate(&d); gettime(&t); printf("Date is %2i-%02i-%02i %2i:%02i:%02i\n\n", d.da_day,d.da_mon,d.da_year+1980, t.ti_hour,t.ti_min,t.ti_sec); } /*****************************************************************************/ void echo(void) {int i=1; while (_argv[i]) printf("%s ",_argv[i++]); } /*****************************************************************************/ void put_env(char far*far*_env) { int i; for (i=0; _env[i] != NULL; i++) { puts (_env[i]); } } /*****************************************************************************/ void ladder (void) {int i,j; for (;;) { for (i=0;i<80;i++) { for (j=0;jMAX_ARG) {printf("Too many arguments"); goto l2;} for(;(i #include #include int main (int argc, char *argv[]) {int magick, h; if (argc!=3) { printf("usage: bpatch filename magick\n\n\ Par example: bpatch he 0xDEAF\n"); return 1; } sscanf(argv[2],"%X",&magick); printf("name=%s magick=%X",argv[1],magick); if ((h=open(argv[1],O_WRONLY))==-1) {printf("open error\n"); return 2; } if (write(h,&magick,2)!=2) {printf("write error\n"); return 3; } if (close(h)==-1) {printf("close error\n"); return 4; } return 0; } src/develop/bpatch.com0100664000076500007650000002145206471546522014514 0ustar prool2prool2.0!.,ڣ.>Njع&=87u&U=uYuaC&8uր̀ى+>z s>z p$r(>x r"G;r>z t>x u;wډ+؎JW!_ҋ3.*$p$+$ $666P.[$LF!O5!{}5!5!5!%ʎں6!%{!%!%!%!ô@!ù].PJUVW9&r"~~tP DDFPPuvuPv Pu=uPV DD=PFPV=tP4 DDVDD=u P DD3_^]UVv |XvW6  ރ#w ƣ^]U | *$| | ur t v v.Y]..2&@Ň֓6>r2v%+r`،ЎQI2ً݇ËCwr@w< t< t< u2 tB uC2I,"t"<\u<"uI Y.Cۋ+r.v6 t3F.&QGY t$36) u3?&8uU>| uF| ㉇*$| 3]UVW~El$;ul$ul$wl$D_^]UVW~F)5F@|j$;u6j$~u_^]UVF3%RP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Xtry r)bV% ?src/bm/files.bbs0100664000076500007650000000021506144656462013301 0ustar prool2prool2CB.ASM Boot manager CRT file (asm) MAKEFILE Makefile BOOT.OLD Boot manager (src) MAKEFILE.OLD Makefile src/bm/msdos.asm0100664000076500007650000000143606100463636013333 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _msdos proc extrn _RestoreVec:near ; 뢠 cli call _RestoreVec sti xor ax,ax mov ES,ax ; Read MBR mov dl,80h ; drive mov dh,0 ; head mov cl,1 ; sec mov ch,0 ; trk mov al,1 ; sec count mov ah,2 ; Fn read mov bx,7c00h int 13h nop jc @@reboot ;jmp 0:7c00 db 0eah dw 7c00h dw 0 @@reboot:; jmp ffff:0 db 0eah dw 0 dw 0ffffh _msdos endp public _msdos _TEXT ends end src/bm/hdd2.asm0100664000076500007650000000143306100465646013027 0ustar prool2prool2_TEXT segment byte public 'CODE' assume cs:_TEXT _hdd2 proc extrn _RestoreVec:near ; 뢠 cli call _RestoreVec sti xor ax,ax mov ES,ax ; Read MBR mov dl,81h ; drive mov dh,0 ; head mov cl,1 ; sec mov ch,0 ; trk mov al,1 ; sec count mov ah,2 ; Fn read mov bx,7c00h int 13h nop jc @@reboot ;jmp 0:7c00 db 0eah dw 7c00h dw 0 @@reboot:; jmp ffff:0 db 0eah dw 0 dw 0ffffh _hdd2 endp public _hdd2 _TEXT ends end src/bm/out_mbr.c0100664000076500007650000000170406400025236013306 0ustar prool2prool2#include void outMBR (char far *buf) { int i; struct MBRstru far *MBR; MBR=(void far *)buf; printf("System ----Begin---- ----End----- Preceding sec Total sec\n"); printf(" head sec cyl head sec cyl\n"); /* "A FAT 12 iiii ii iiii iiii ii iiii iiiiiiiiii iiiiiiiiii\n" */ for (i=0;i<4;i++) {unsigned int j; if (MBR->Partition[i].indicator==0) printf(" "); else printf("A"); printf(" "); out_os(MBR->Partition[i].system_indicator); printf(" %4i ",MBR->Partition[i].begin_head); printf("%2i ",(j=MBR->Partition[i].begin_sec) & 0x3F); j = (j & 0xC0)<<2; printf("%4i ",MBR->Partition[i].begin_cyl | j); printf("%4i ",MBR->Partition[i].end_head); printf("%2i ",(j=MBR->Partition[i].end_sec) & 0x3F); j = (j & 0xC0)<<2; printf("%4i ",MBR->Partition[i].end_cyl | j); printf("%10lu ",MBR->Partition[i].preceding_sec); printf("%10lu\n",MBR->Partition[i].total_sec); } } src/bm/tlib.cmd0100664000076500007650000000045006400025260013104 0ustar prool2prool2bootl/C/E-+printf-+sec4clu2-+mem-+tolower-+conv-+ctype-+strchr-+char_in-+char_out-+string-+putch0-+getch0-+kbhit-+txtattr-+hdd2-+msdos-+cold-+reboot-+bootread-+out_os-+cursor-+videopag-+int86-+out_mbr & -+int13err-+readsec-+bootred0-+vector-+out_iv-+viewexe-+nextclu2-+cluread-+strlen-+absread src/bm/cb.asm0100664000076500007650000001220706466160400012566 0ustar prool2prool2; Startup module for Proolix /boot (similar c0t.obj from Turbo C 2.0 and ; similar crt.o from UNIXs) ; Version 0.0.1.7 23-Apr-97 ; History ; 0.0.1.7 23-Apr-97 ; 0.0.1.6 22-Apr-97 ; 0.0.1.5 20-Apr-97 ⫮ 让 mov SP, ... ; 0.0.1.4 10-May-96 add internal stack ; 0.0.1.3 9-Mar-96 ; 0.0.1.2 27-Feb-96 ... ; 0.0.1.1 26-Feb-96 cb.arj ; 0.0.1.1 25-Feb-96 cb.arj ; 0.0.1.0 11-Jan-96 cb.arj ; ; 0.0.0.15 5-Nov-95 c0.asm ; 0.0.0.15 4-Nov-95 ... ; 0.0.0.14 15-Jan-95 c0.asm sayr macro str ; ᪨ ० ࠡ⠥ push si lea si,str ; 뫮 mov si,offset str call sayr_proc pop si endm sayr chr macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) ; NO SAVE REG mov al,sym mov ah,0eh int 10h endm chr KernPSP equ 50h _TEXT segment byte public 'CODE' DGROUP group _TEXT,_DATA,_BSS org 100h assume cs:DGROUP,ds:DGROUP ; ,ss:DGROUP .8086 _Begin: mov ax,CS mov DS,ax mov ES,ax ; mov DGROUP@,ax cli mov SS,ax mov SP,offset 0FFECH ; StackEnd ; 0fffeh sti ; chr 'A' ; call _saycsip extrn _main:near jmp _main _kernel_start: public _kernel_start ; mov ax,KernPSP mov DS,ax mov ES,ax cli mov SS,ax mov SP,0fffeh sti db 0eah ; /* KERNEL START: JMP 50:100 */ dw 100h,KernPSP ; ;DGROUP@ dw 0 ;public DGROUP@ ; comment | _saycsip proc near ; REG SAVED push ax push DS chr 'i' chr 'p' chr '=' push CS pop ax call ohw chr ':' call ll ll: pop ax call ohw chr ' ' chr 'd' chr 's' chr '=' push DS pop ax call ohw push CS pop DS sayr s_ax pop ax push ax call ohw sayr s_bx mov ax,bx call ohw sayr s_cx mov ax,cx call ohw sayr s_dx mov ax,dx call ohw sayr s_si mov ax,si call ohw sayr s_di mov ax,di call ohw sayr s_ss mov ax,SS call ohw sayr s_sp mov ax,SP call ohw sayr s_es mov ax,ES call ohw sayr s_bp mov ax,BP call ohw pop DS pop ax ret ;s0 db 13,10,"CS:IP=",0 s_ax db ' ax=',0 s_bx db ' bx=',0 s_cx db ' cx=',0 s_dx db ' dx=',0 s_si db ' si=',0 s_di db ' di=',0 s_ss db ' SS=',0 s_sp db ' SP=',0 s_ds db ' DS=',0 s_es db ' ES=',0 s_bp db ' BP=',0 _saycsip endp ohw proc ; 뢮 ᫮ HEX-. 室: ᫮ ax. ; ॣ ࠭. ; 뢠 ணࠬ ohb push ax ; . ࠤ al. mov al,ah call ohb pop ax ; . al. call ohb ret ohw endp sayr_proc proc ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; All registers saved ; ᪨ ० ࠡ⠥ ; ALL REGS SAVED! push ax push si PUSHF cld sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: POPF pop si pop ax ret sayr_proc endp ohb proc ; Procedure output hex byte Ver 0.1.1 6 Dec 93 via BIOS ; Input: AL - byte ; All regs. reserved ;) ; Not worked in graph mode. bl - bg color !!! push ax push cx push dx mov dl,al mov cl,4 shr al,cl call ohb1 mov al,dl and al,0fh call ohb1 pop dx pop cx pop ax ret ohb endp ohb1 proc ; Regs not saved !!! push ax cmp al,9 ja @@_1 ; al > 9 ; al <= 9 add al,'0' jmp @@_out @@_1: add al,'A'-10 @@_out: mov ah,0eh int 10h pop ax ret ohb1 endp ; | _TEXT ends _DATA segment byte public 'DATA' _DATA ends _BSS segment byte public 'BSS' _BSS ends end _Begin src/bm/boot.h0100664000076500007650000000012106466163402012611 0ustar prool2prool2#define EXTEND 5 #define EXTEND2 0xF #define _HDD_ 0x80 #define MAX_LINES 22 src/bm/booth0100664000076500007650000002322606664626236012557 0ustar prool2prool2U$;si-D%~رS3SPKLITE Copr. 1992 PKWARE Inc. All Rights ReservedNot enough memory$ a! OOFF2;<AcdefrJts33JtJtӅtJtӀr Ju. t:3ۃt&JtrJtJtJtӀs.,V+^눬Ȁn9| %!!Xt]I#####Њ! JK!D=t =t="3ƇI V(UK=t. J p9^TGR1ZJ/J2.2,e(0B>Bxn9Ftu_эPPP/ t x9hHT F}鱀*^]ø$)))?) 4K 44 P ) Q:~~ FH3" ~Ơ ) sv1 .C|$'xC VWv>"M6 50?I2 ÉFW#DPv(-NJ_;S B+G( KK ]&&Mx[YՑ2 %?psQSv('0kX ObsO1<K` K4?A8Jщ t!M HJ5 Fk XcP K 0 VF Фt rW -G30 092"" 5;†*q& G ܘH=@~JR p (CINH44',gd8xHHBA&4 VJ)!!^EHKbd+q/@$M_^Q0KRAB(}DD,.g Q$)< (EOF~@D=t/0t*3ފ4044 |4u3zFB| ;sdPw ;w YJ.P ^^ JQII`J,-RP E Fm ngr3-:O {5{MԠ EO e؀?eJ [ G RRH^*n  l63Ҹ 'eR|/w,ẅ)18A ` %\f2A: K(EPDP(=U !؃ȟmw);8 3( ,C.PY2;H|Yn"Ub`g)PM P+3ek|)yJ &E= v) Wߋ!BP*+D܋V<g]t7&,)MR 7&t 3Lm>C)Ǫ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ɵ Hdr@ =.2EXE npxn~|=p0a 8%%2X˥i IgnV(itry r)E!ba ?'src/bm/sec4clu2.c0100664000076500007650000000142506145355350013274 0ustar prool2prool2#include #include #include #include "kernel.h" /****************************************************************************/ /* #define DEBUG */ /****************************************************************************/ unsigned long SecForClu (unsigned int CluNo) {unsigned long l; /* Sector=ResSecs + FatCnt*FatSize + (RootSiz*32)/SectSiz + ((CluNo-2)*ClustSiz) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DataStart */ #if 0 if ((CluNo>MaxClusters)||(CluNo<2)) { printf("SecForClu: Invalid cluster number. CluNo=%i, MaxClusters=%i", CluNo,MaxClusters); return -1; } #endif l=DataStart + ( ((unsigned long)CluNo-2) * CluSize ); #ifdef DEBUG printf("sec4clu: return %li ",l); #endif return l; } src/bm/nextclu2.c0100664000076500007650000000165406761520344013421 0ustar prool2prool2#include #include #include /* NextClu(), NextClu2() - next cluster number compute and load to Cache) */ /* NextClu() - kernel's internal module */ /* NextClu2() - boot manager internal module */ /* ᮢ뢠 NextClu() NextClu2() ! */ extern unsigned int MaxClusters; extern int FATMode; extern char huge * FAT; unsigned int NextClu2 (unsigned int CluNo) /* -1 for eof or error */ { /* for FAT12 */ unsigned int i; if ((CluNo>MaxClusters)||(CluNo==0)) { printf("NextClu: Invalid cluster number. CluNo=%u, MaxClusters=%u", CluNo, MaxClusters); return -1; } if (FATMode==FAT12) { /* FAT 12 */ i=*(unsigned int huge *)(FAT+ (((unsigned long)CluNo) * 3)/2); if (CluNo & 1) i>>=4; else i&=0xfff; if (i>0xff0) return -1; } else { /* FAT 16 */ i=*(unsigned int far *)(FAT+ ((unsigned long)CluNo) * 2); if (i>0xfff0) return -1; } return i; }src/bm/makefile0100664000076500007650000001721606545770604013220 0ustar prool2prool2# OS Proolix. Boot manager makefile. # Use Turbo C 2.0 make.exe TasmFlags = /q /t /w2 /m4 #TasmFlags = /t /w2 /m4 /l # LinkFlag = /c/t/d/m/s LinkFlag = /c/d/m/s TCOpt = -K -wcln -wsig -wucp -wrvl -N- # -wstv # TCFlag = -mt -I..\include -I..\kernel -DKERNEL -DProolix $(TCOpt) CPPFlag = -I..\include TC = \tc # Proc = \usr\prool\proc Commands = ..\command Include = ..\include Kernel = ..\kernel KernelFiles = kernel.c progname.c alloc.c process.c syscall.c ConfFiles = $(Include)\conf.c $(Include)\limits.h $(Include)\unistd.h \ $(Include)\struct.h $(Include)\prool.h $(Include)\proto.h $(Kernel)\kernel.h .a.obj: tasm /ml /z $(TasmFlags) /jjumps $&.a .c.obj: tcc -c $(TCFlag) -o $& $& .asm.obj: tasm /ml /z $(TasmFlags) $& .c.asm: tcc -c -S $(TCFlag) $& .asm.a: app $&.asm $&.a .c.i: cpp $(CPPFlag) $& ############################################################################## boot: boot.com ..\kernel\pklite -o boot.com boot. boot.com: boot.obj cb.obj bootl.lib $(Kernel)\cs0.lib tlink /c/d/m/s/t cb boot,boot,boot,bootl $(Kernel)\cs0 boot.obj: boot.c boot.h $(Include)\struct.h $(Kernel)\ppt.c tcc -c -B -mt -I..\include $(TCOpt) \ -DKERNEL -DProolix -DBOOT $& ############################################################################## bootf: bootf.com ..\kernel\pklite -o bootf.com bootf. bootf.com: bootf.obj cb.obj bootl.lib $(Kernel)\cs0.lib tlink /c/d/m/s/t cb bootf,bootf,bootf,bootl $(Kernel)\cs0 bootf.obj: boot.c boot.h $(Include)\struct.h tcc -c -B -mt -I..\include $(TCOpt) -obootf \ -DKERNEL -DProolix -DBOOT -DAUTO -DDEF_BOOT=0 boot ############################################################################## booth: booth.com ..\kernel\pklite -o booth.com booth. booth.com: booth.obj cb.obj bootl.lib $(Kernel)\cs0.lib tlink /c/d/m/s/t cb booth,booth,booth,bootl $(Kernel)\cs0 booth.obj: boot.c boot.h $(Include)\struct.h tcc -c -B -mt -I..\include $(TCOpt) -obooth \ -DKERNEL -DProolix -DBOOT -DAUTO -DDEF_BOOT=2 boot ############################################################################## boot.asm: boot.c boot.h $(Include)\struct.h tcc -c -S -mt -I..\include $(TCOpt) \ -DKERNEL -DProolix -DBOOT $& a:\boot: boot copy boot a:\boot bootl.lib: tlib.cmd printf.obj sec4clu2.obj mem.obj tolower.obj \ conv.obj ctype.obj strchr.obj char_in.obj char_out.obj \ string.obj bootread.obj out_iv.obj viewexe.obj nextclu2.obj \ putch0.obj getch0.obj out_os.obj cursor.obj videopag.obj \ kbhit.obj txtattr.obj int86.obj out_mbr.obj \ hdd2.obj msdos.obj cold.obj \ reboot.obj bootred0.obj \ vector.obj readsec.obj \ int13err.obj \ cluread.obj strlen.obj absread.obj tlib @ tlib.cmd out_mbr.obj: out_mbr.c tcc -c $(TCFlag) $(Kernel)\out_mbr.c out_os.obj: $(Kernel)\out_os.c $(ConfFiles) tcc -c -oout_os.obj $(TCFlag) $(Kernel)\out_os.c strlen.obj: $(Kernel)\strlen.c $(ConfFiles) tcc -c -ostrlen.obj $(TCFlag) $(Kernel)\strlen.c absread.obj: $(Kernel)\absread.c $(ConfFiles) $(Kernel)\kernel.h tcc -c -oabsread.obj $(TCFlag) $(Kernel)\absread.c cluread.obj: $(Kernel)\cluread.c $(ConfFiles) $(Kernel)\kernel.h tcc -c -ocluread.obj $(TCFlag) $(Kernel)\cluread.c nextclu2.obj: nextclu2.c $(ConfFiles) tcc -c -onextclu2.obj $(TCFlag) nextclu2.c viewexe.obj: $(Kernel)\viewexe.c tcc -c -oviewexe.obj $(TCFlag) $(Kernel)\viewexe.c out_iv.obj: $(Kernel)\out_iv.c $(ConfFiles) $(Kernel)\kernel.h tcc -c -oout_iv.obj $(TCFlag) $(Kernel)\out_iv.c bootread.obj: $(Kernel)\bootread.c $(ConfFiles) $(Kernel)\kernel.h tcc -c -obootread.obj $(TCFlag) $(Kernel)\bootread.c string.obj: $(Kernel)\string.c $(ConfFiles) tcc -c -ostring.obj $(TCFlag) $(Kernel)\string.c char_in.obj: $(Kernel)\char_in.c $(ConfFiles) tcc -c -ochar_in.obj $(TCFlag) $(Kernel)\char_in.c char_out.obj: $(Kernel)\char_out.c $(ConfFiles) tcc -c -ochar_out.obj $(TCFlag) $(Kernel)\char_out.c strchr.obj: $(Kernel)\strchr.c $(ConfFiles) tcc -c -ostrchr.obj $(TCFlag) $(Kernel)\strchr.c ctype.obj: $(Kernel)\ctype.c $(ConfFiles) tcc -c -octype.obj $(TCFlag) $(Kernel)\ctype.c conv.obj: $(Kernel)\conv.c $(ConfFiles) tcc -c -oconv.obj $(TCFlag) $(Kernel)\conv.c printf.obj: $(Kernel)\printf.c $(ConfFiles) tcc -c -B -DBOOT $(TCFlag) -oprintf.obj $(Kernel)\printf.c printf.asm: $(Kernel)\printf.c $(ConfFiles) tcc -c -S -DBOOT $(TCFlag) -oprintf.asm $(Kernel)\printf.c #printf.obj: printf.asm # tasm /ml /z $(TasmFlags) $& sec4clu2.obj: sec4clu2.c $(ConfFiles) $(Kernel)\kernel.h tcc -c $(TCFlag) sec4clu2.c mem.obj: $(Kernel)\mem.c $(ConfFiles) tcc -c $(TCFlag) -omem.obj $(Kernel)\mem.c tolower.obj: $(Kernel)\tolower.c $(ConfFiles) tcc -c $(TCFlag) -otolower.obj $(Kernel)\tolower.c videopag.obj: $(Kernel)\videopag.c $(ConfFiles) tcc -c $(TCFlag) -ovideopag.obj $(Kernel)\videopag.c int13err.obj: $(Kernel)\int13err.c $(ConfFiles) tcc -c $(TCFlag) -oint13err.obj $(Kernel)\int13err.c putch0.obj: $(Kernel)\putch0.asm tasm /ml /z $(TasmFlags) $(Kernel)\putch0.asm; getch0.obj: $(Kernel)\getch0.asm tasm /ml /z $(TasmFlags) $(Kernel)\getch0.asm; kbhit.obj: $(Kernel)\kbhit.asm tasm /ml /z $(TasmFlags) $(Kernel)\kbhit.asm; txtattr.obj: $(Kernel)\txtattr.asm tasm /ml /z $(TasmFlags) $(Kernel)\txtattr.asm; hdd2.obj: $(Kernel)\hdd2.asm tasm /ml /z $(TasmFlags) $(Kernel)\hdd2.asm; msdos.obj: $(Kernel)\msdos.asm tasm /ml /z $(TasmFlags) $(Kernel)\msdos.asm; cold.obj: $(Kernel)\cold.asm tasm /ml /z $(TasmFlags) $(Kernel)\cold.asm; reboot.obj: $(Kernel)\reboot.asm tasm /ml /z $(TasmFlags) $(Kernel)\reboot.asm; bootred0.obj: $(Kernel)\bootred0.asm tasm /ml /z $(TasmFlags) $(Kernel)\bootred0.asm; vector.obj: $(Kernel)\vector.asm tasm /ml /z $(TasmFlags) $(Kernel)\vector.asm; readsec.obj: $(Kernel)\readsec.asm tasm /ml /z $(TasmFlags) $(Kernel)\readsec.asm; cursor.obj: $(Kernel)\cursor.asm tasm /ml /z $(TasmFlags) $(Kernel)\cursor.asm; int86.obj: $(Kernel)\int86.asm tasm /ml /z $(TasmFlags) $(Kernel)\int86.asm; install: boot copy boot a:\boot all: boot booth bootf cb.obj: cb.asm bak: del *.bak del *.map del *.tmp del *.lst del *.dic del *.i del norton.ini clean: bak del *.obj del *.lib del boot del tcpick.pck reboot: reboot src/bm/boot0100664000076500007650000002355006761536476012413 0ustar prool2prool2PX%;si-D%~رS3SPKLITE Copr. 1992 PKWARE Inc. All Rights ReservedNot enough memory$ a! OOFF2;<AcdefrJts33JtJtӅtJtӀr Ju. t:3ۃt&JtrJtJtJtӀs.,V+^눬Ȁz;| #!tXL#]####!!D=PPt =t="3ƇL + UK=:@.L |;/CAGAR1ZE7LL2R2,(v)0BBi@xz;thu]P躅P0 tP` ;YYS F}^]ø"$''6, 2 JB < I3]v~~@FI3LEBA !/ s .œH&Y3J VWv>O6L.ALuR=8 $~*!AӉF*]1VGPv2%/%[kނ[[PE.GM M .&OP[Y4H %?9QS;'X Ob9O3<MzM4VH8LЅO4.ZKHnL ,<~. $4$_VRF t U ʠ*W"LG3n77Ne9"% * @F6T1G P@VK>@~@VI Ɋ  n8TXK>::  g]dKvb 6&dD  #U#R)`)^)(2ҩM}Pԡ(Y+21@O_,RY/ EwY E(5> SF(FvC@I<u1!*3ߊ%%8U88%G |tXMJ~(| ;saw ;w V].ȃ ^^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~M NW4(ne*IO(4ru>.6a!Fa!{ ф.|E  =Fe%}73_9B3 @UĠAV3N u ti tepuy׆ Ճ JP ۃ W3n ;r w@;r+@[ntƋ N g!3VB K ^Mv~ ɜCsـ ˀB93 ÝrˎaS} Bs2Њ^ӊ%[B L]B+AA+ Ax6S6-x%x7S|5- --+cA,2+.CL boot: ex0tend sectoP(r reaerr ( %sP 8Aolix'managQP v. 0. 1.2 26-Aug-99,ess ESC fastlyJTingRRuptjqu`wceZhelp - hE&dloamx [ Ι:@jvalidevic@partiUCeA 7 :(  %PANIC! C lussize=f%i1J7og eYLFgza( Masupp*?\cG {+%#( abs%c"u(KH H`%s'und. Fir]?weWr3Sz .Ling dL04X:0MZCOM KERNELsilleg L6Hdr@ =2n EXEC! ynp}=Dt%FsF?FqS]WA(INGVMaybe,v7=In 13hQqcha \edRBy*Dv 1]MSDE&tiBsoftwarcu F.eZA2idS(akL a Vo HuQ)A* Pf/Qod(ulDr.Web htMBRlR$HPREpBOOTLD'%12LMO†NODUMPBEprf0OFlag '%c'hn`  w-+ #00c+FNhlL+Difi_f ouxXfeEgGcspn%3type7z(null)w*"jGbIjsjD123456789ABCDEFGHIJKLMNOPQRSTXYZ=nfV@w 'd ʚ;@0B "iy[3`R*T. A9O quit, co{eArjBuBBBBBBBC)C4CJC\CyCCCNoBspBNC2NmY~rkWrP|eoCctS ID b* `ReVCA(ATDMA*DS o2&( f64K) e. PFackNCCRCSEC 6x! TC{k@ek),PTime (&UeHned= 6gM ]`8_%2X`6ZiHgn(iX8tryX" r)b$_4 ?bsrc/bm/boot.c0100664000076500007650000006067506761255342012633 0ustar prool2prool2#define VERSION "Proolix boot manager ver. 0.0.1.2 26-Aug-99" /* #define DEBUG */ /* History in reverse order 0.0.1.2 26-Aug-99 - 0.0.1.1, compile by Turbo C 2.01 (all previous compiled by TC 2.0) 0.0.1.1 23-Feb-99 - add NumLock off, anykey for interrupt boot sec. 0.0.1.0 10-Mar-98 0.0.0.29 15-Feb-98 0.0.0.28 4-Feb-98 0.0.0.27 18-Aug-97 0.0.0.26 10-Aug-97 0.0.0.25 31-May-97 0.0.0.24 31-May-97 0.0.0.23W 12-May-97 - add command MORE and NOMORE 0.0.0.22 11-May-97 - F1 - boot from 1st HDD 0.0.0.21 6-May-97 - ᤥ ࠡ ࠬ 32 ⥫쭮 0.0.0.20 1-May-97 - fixed case Cylinder>255 in HDD 0.0.0.19 27-Apr-97 - booted from A:, B:, C:, D:, etc... 0.0.0.18 26-Apr-97 0.0.0.17 23-Apr-97 0.0.0.16 22-Apr-97 0.0.0.15 21-Apr-97 0.0.0.14 20-Apr-97 - ⫮ 让 mov SP, ... 0.0.0.13 19-Apr-97 - add boot.h and AUTOSTART preprocessor variable 0.0.0.12 12-May-96 - 뭥 Cluster static 0.0.0.11 21-Apr-96 0.0.0.10 20-Apr-96 - /boot ⥯ ᦠ PKLite' 0.0.0.9 15-Apr-96 - 㧪  ࠧ c ( ⮫쪮 C: 뫮 ࠭) 0.0.0.8 11-Apr-96 - ᤥ ࠡ FAT ࠧ஬ , 祬 64 0.0.0.7 6-Apr-96 0.0.0.7 5-Apr-96 0.0.0.6 4-Apr-96 0.0.0.5 31-Mar-96 0.0.0.5 30-Mar-96 - HDD... 0.0.0.4 27-Mar-96 - add "dump" command 0.0.0.3 25-Mar-96 0.0.0.2 18-Mar-96 - ࠡ⠫ ⮫쪮 ࠬ 1024 (ࠡ⠫ 3" 720k ᪥⠬ ࠡ⠫ 3" 1.2M) 0.0.0.1 13-Mar-96 0.0.0.1 12-Mar-96 0.0.0.1 9-Mar-96 0.0.0.0 27-Feb-96 */ #include #include #include #include #include #include #include #include #include #include #include "boot.h" #define AUTOSTART #ifndef DEF_BOOT #define DEF_BOOT 0 /* default boot device 0 - a: 1 - b: 2 - c: */ #endif #define CLUSTER_ADDR MK_FP(0x4050, 0) #define FAT_ADDR MK_FP(0x5050, 0) #define COMMAND_LINE 80 #define KERNEL_BEGIN_SEG 0x60 #define EXE_HEADER_SIZE 0x1c #define MAX_CLU_SEC 64 /* 64 */ /* 16 */ #define PSP KERNEL_BEGIN_SEG-0x10 #ifdef _HERCULES_ #define MAIN_COLOR 7 #else #define MAIN_COLOR 11 #endif #define ReadPhysSec2 ReadPhysSec unsigned char NearBuffer [SECTOR_SIZE]; char far * pCluster; unsigned long RootBeg; unsigned long RootEnd; int CurrentDevice; int FATMode; struct BootStru *B; char huge *FAT ; int NextDrive=2; /* disk C: */ int NextDOSDrive='C'; void kernel_start (void); struct DeviceStruct Devices [LASTDRIVE]; /* Devices [0] - disk A: sec=0 if not present Devices [1] - disk B: sec=0 if not present Devices [2] - disk C: sec=0 if not present Devices [3] - disk D: sec=0 if not present ... */ /*--------------------------------------------------------------------------*/ int TextAttr=MAIN_COLOR; char far *KbdStatus; char Russian [256]; char Buf [SECTOR_SIZE]; char Buf2 [SECTOR_SIZE]; char MBRBuf [SECTOR_SIZE]; char command [COMMAND_LINE]; int errno; int SectorsOnCyl; unsigned long MaxSectors; int TrkSecs; int HeadCnt; int CluSize; unsigned int CluSizeBytes; int FatSize; int FatCnt; unsigned long ResSecs; unsigned long DataStart; unsigned int TargetForBugs; unsigned int MaxClusters; int More=0; int NLine=0; /****************************************************************************/ void cold (void); void hdd2 (void); void out_os (int c); #include "..\kernel\ppt.c" /****************************************************************************/ void ident (void) { printf("\n\n%s\n\n",VERSION); #ifdef AUTOSTART printf("Press ESC fastly for interrupt boot sequence\n"); #endif printf("help - help\n\n\ Enter - load standard Proolix kernel\n\n\ F1 - forced boot from 1st HDD\n\n\ "); } /****************************************************************************/ void help (void) { ident(); printf("\ help - this help\n\ 0:\n\ 1: - set FDD\n\ 2:\n\ 3:\n\ ... - set HDD\n\ reboot - hot reboot\n\ cold - cold reboot\n\ msdos - load OS from HDD 0\n\ hdd2 - load OS from HDD 1 (if present)\n\ ls - ls\n\ more - set more on\n\ nomore - set more off\n\ dump filename - hex dump of filename\n\ "); } /****************************************************************************/ int TR (int curdev) { if (curdev>1) return _HDD_; /* HDD */ else return curdev; /* FDD */ } /****************************************************************************/ void RestoreVec (void) { } /****************************************************************************/ int sema_lock (void /* ;) */ ) { return 0; } /****************************************************************************/ void sema_unlock (void /* ;) */ ) { } /****************************************************************************/ int putch__(char c) { switch (c) { case 0: c=' '; break; default: if (c<' ') c='.'; } return putch(c); } /****************************************************************************/ #ifdef DEBUG void out_boot(void far *buf) {int i; unsigned long DiskSize; unsigned long TrueSectors; struct BootStru far *b; b=buf; printf("\n\ ----------------------------------Disk parameters:------------------------------\n"); printf("Jump command %02X %02X %02X \n",(*b).Jmp[0],(*b).Jmp[1],(*b).Jmp[2]); printf("OEM name %-8s\n\ OEM name ",(*b).OEM); for(i=0;i<8;) printf("%02X ",(*b).OEM[i++]); #if 1 printf("\nSector size %4i bytes Cluster size %1i sect\n",(*b).SectSiz,(*b).ClustSiz); printf("Reserved sectors (before 1st FAT) %2i FAT counter %1i\n",(*b).ResSecs,(*b).FatCnt); printf("Root directory entries %4i Total sectors %7u\n",(*b).RootSiz,(*b).TotSecs); printf("Media descr %02X FAT size %5i sect\n",(*b).Media,(*b).FatSize); printf("Track size %2i sec Heads %2i\n",(*b).TrkSecs,(*b).HeadCnt); printf("Hidden sectors %7li Big Number Of Sectors %7li\n",(*b).HidnSec,(*b).BigSect); printf("Physical Drive No %02X Extended Boot Signature %02X\n",(*b).DriveNo,(*b).BootSign); printf("Volume Serial No %04X-%04X\n", (*b).SerialNo[1], (*b).SerialNo[0]); #endif printf("\nVolume Label (in boot) "); for(i=0;i<11;)putch__((*b).VolLbl[i++]); printf("\n "); for(i=0;i<11;)printf("%02X ",(*b).VolLbl[i++]); printf("\nFile system Id "); for(i=0;i<8;)putch__((*b).FileSysId[i++]); printf("\n "); for(i=0;i<8;)printf("%02X ",(*b).FileSysId[i++]); if ((*b).TotSecs==0) TrueSectors=(*b).BigSect; else TrueSectors=(*b).TotSecs; DiskSize=((long) (*b).SectSiz * TrueSectors)/1024l; if (DiskSize>5000) { DiskSize/=1024; printf("\nDisk size %li Mb\n",DiskSize); } else { printf("\nDisk size %li Kb\n",DiskSize); } } #endif /****************************************************************************/ void setdisk (int NewDevice) {int sec, head, trk, olddevice, oldpart; unsigned long i; olddevice=CurrentDevice; CurrentDevice=NewDevice; if (NewDevice>1) { /* HDD */ if (Devices[NewDevice].sec==0) { printf("bootman: invalid device\n"); CurrentDevice=olddevice; return; } head=Devices[NewDevice].head; sec=Devices[NewDevice].sec; trk=Devices[NewDevice].trk; if (ReadPhysSec (_HDD_, sec, head, trk, Buf)) { printf ("boot: partition boot sector read error\n"); CurrentDevice=olddevice; return; } /* printf("========================================================\n"); */ B = (void *) Buf; #if 0 out_boot((void far *) Buf); #endif HeadCnt=B->HeadCnt; TrkSecs=B->TrkSecs; SectorsOnCyl=HeadCnt*TrkSecs; #if 0 ResSecs=(unsigned long)Devices[NewDevice].sec+ (unsigned long)Devices[NewDevice].head*(unsigned long)TrkSecs+ (unsigned long)Devices[NewDevice].trk*SectorsOnCyl; #else ResSecs=(unsigned long)(Devices[NewDevice].sec & 0x3F)+ (unsigned long)Devices[NewDevice].head*(unsigned long)TrkSecs+ (unsigned long)(Devices[NewDevice].trk|((int)(Devices[NewDevice].sec & 0xC0)<<2))* SectorsOnCyl; #endif #ifdef DEBUG printf("ResSecs=%lu\n",ResSecs); #endif MaxSectors=Devices[NewDevice].MaxSectors+ResSecs; FATMode=Devices[NewDevice].FileSystem; } else { /* FDD */ if (Devices[NewDevice].sec==0) { printf("bootman: invalid device\n"); CurrentDevice=olddevice; return; } if (bootread0 (CurrentDevice, Buf)) { printf ("boot: boot sector read error :( \n"); CurrentDevice=olddevice; return; } B = (void *) Buf; #if defined (DEBUG) out_boot((void far *) Buf); #endif if ((i=B->ResSecs)!=0) ResSecs=i; ResSecs=B->HidnSec+1; if ((i=B->TotSecs)!=0) MaxSectors=i; else MaxSectors=B->BigSect+B->HidnSec; #ifdef DEBUG printf("MaxSectors=%li\n",MaxSectors); #endif HeadCnt=B->HeadCnt; TrkSecs=B->TrkSecs; SectorsOnCyl=HeadCnt*TrkSecs; FATMode=FAT12; } CluSize=B->ClustSiz; if (CluSize>MAX_CLU_SEC) printf("\nPANIC!!! Cluster size=%i sec - is too large for this realization\n\n\ Max supported cluster size=%i sec\n\n",CluSize,MAX_CLU_SEC); CluSizeBytes=CluSize * SECTOR_SIZE; FatSize=B->FatSize; FatCnt=B->FatCnt; RootBeg = ResSecs + B->FatCnt * B->FatSize; RootEnd = RootBeg + ( ( B->RootSiz * 32 ) / B->SectSiz ) - 1; DataStart = RootEnd+1; MaxClusters=(unsigned int)((MaxSectors-DataStart)/CluSize+1); #ifdef DEBUG printf("RootBeg =%lu\n",RootBeg); printf("RootEnd =%lu ",RootEnd); printf("ResSecs =%lu ",ResSecs); printf("MaxSectors =%lu =%08lX MaxClusters =%u\n", MaxSectors,MaxSectors,MaxClusters); printf("\nHeadCnt =%2i TrkSecs =%2i FatSize =%2i FatCnt =%1i\n", HeadCnt,TrkSecs,FatSize,FatCnt); printf("B->SectSiz =%i ", B->SectSiz ); printf("B->ClustSiz=%i ", B->ClustSiz); printf("B->ResSecs =%u ", B->ResSecs ); printf("B->FatCnt =%i ", B->FatCnt ); printf("B->RootSiz =%i ", B->RootSiz ); printf("B->TotSecs =%u ", B->TotSecs ); printf("B->Media =%02X ", B->Media ); printf("B->FatSize =%i ", B->FatSize ); printf("B->TrkSecs =%i ", B->TrkSecs ); printf("B->HeadCnt =%i ", B->HeadCnt ); printf("B->HidnSec =%lu ",B->HidnSec ); printf("B->BigSect =%lu ",B->BigSect ); printf("B->DriveNo =%02X ", B->DriveNo ); printf("B->BootSign=%02X ", B->BootSign); printf("DataStart = %lu ",DataStart); printf("\nCluster size = %u bytes\n",CluSizeBytes); #endif } /****************************************************************************/ void ls (void) {int i, k; unsigned long j; struct dirent *Ent; for (j=RootBeg;j<=RootEnd;j++) { if (absread (TR(CurrentDevice), 1, j, Buf2)) printf ("boot: sector %lu absread error\n", j); else { for (k=0;k<16;k++) { Ent = (void *) (Buf2+k*32); if ((*Ent).d_name[0]==0) continue; if ((*Ent).d_name[0]==0xE5) continue; #if 0 if ((*Ent).Attr.B.Label) continue; if ((*Ent).Attr.B.Dir) continue; #endif for (i=0;i<11; i++) printf("%c",Ent->d_name[i]); printf(" %u\n",Ent->d_fileno); } } } } /****************************************************************************/ void load_and_run (char *KernelName) {int i, k; unsigned int Clu; unsigned long j; unsigned len, len1; struct dirent *Ent; char DirectoryRecord [11]; char huge * Adr; struct exe_header far * H; unsigned int far * Rel; unsigned int I_OFF, I_SEG, RELO_SEG; for (i=0;i<11;i++)DirectoryRecord[i]=' '; memcpy(DirectoryRecord,KernelName,strlen(KernelName)); for (j=RootBeg;j<=RootEnd;j++) if (absread (TR(CurrentDevice), 1, j, Buf2)) printf ("boot: sector %lu absread error\n", j); else { for (k=0;k<16;k++) { Ent = (void *) (Buf2+k*32); if (Ent->d_name[0] && ((*Ent).d_name[0]!=0xE5)) { if (Ent->Attr.B.Label) continue; if (Ent->Attr.B.Dir) continue; if (memcmp(Ent->d_name,DirectoryRecord,11)==0) { printf("Kernel `%s' found. First cluster=%u Size=%lu\n", KernelName,Ent->d_fileno,Ent->Size); printf("Loading to %04X:0000\n",KERNEL_BEGIN_SEG); /* Load FAT */ j=ResSecs; FAT = FAT_ADDR; #if 1 for (i=0; id_fileno; Adr = MK_FP (KERNEL_BEGIN_SEG,0); CluRead(TR(CurrentDevice),Clu,(char far *)Adr); if (memcmp((char far *)Adr,"MZ",2)) { /* COM */ printf("COM KERNEL\n"); Adr += CluSizeBytes; Clu=NextClu2(Clu); while (Clu!=0xFFFFU) { CluRead(TR(CurrentDevice),Clu,(char far *)Adr); putch('#'); Adr += CluSizeBytes; Clu=NextClu2(Clu); }; kernel_start(); } else { #if 1 memcpy(pCluster,(char far *)Adr,CluSizeBytes); #else {int ii; for (ii=0;iiHdrSize) > 0x20) {printf ("boot: illegal HdrSize = %04X",len1); goto l1; } /* 㧪 䠩 */ Adr = MK_FP (KERNEL_BEGIN_SEG,0); #if 1 memcpy((char far *)Adr,pCluster+(len1<<4), len=CluSizeBytes-(len1<<4)); #else {int ii, jj; jj=len1<<4; for (ii=0;ii<(len=CluSizeBytes-jj);ii++) *(Adr+ii)=*(pCluster+jj+ii); } #endif Adr += len; Clu=NextClu2(Clu); #if !defined(_HERCULES_) textattr(9); #endif while (Clu!=0xFFFFU) { CluRead(TR(CurrentDevice),Clu,(char far *)Adr); #ifdef DEBUG putch('#'); /* printf(" %08lX",Adr); */ #endif Adr += CluSizeBytes; Clu=NextClu2(Clu); }; /* ன ६頥 ᮢ */ puts(""); Rel=(unsigned int far *)(pCluster + (H->TablOff)); for (i=0; iReloCnt; i++) { /* printf(" #%02X",i); */ I_OFF=*Rel++; /* printf(" I_OFF=%04X",I_OFF); */ I_SEG=*Rel++; /* printf(" I_SEG=%04X",I_SEG); */ RELO_SEG=KERNEL_BEGIN_SEG+I_SEG; /* printf(" RELO_SEG=%04X",RELO_SEG); */ *(unsigned int far *)MK_FP(RELO_SEG,I_OFF) = *(unsigned int far *)MK_FP(RELO_SEG,I_OFF)+KERNEL_BEGIN_SEG; putch('@'); } #if !defined(_HERCULES_) textattr(4); #endif puts("\nEXEC! "); *(int far *)MK_FP(PSP,0)=0x20CD; /* INT 20H :) */ *(int far *)MK_FP(PSP,2)=0x9FFF; /* LZEXE */ *(int far *)MK_FP(PSP,4)=CurrentDevice; /* EXEC ! */ /* ES = DS = PSP */ /* SS = START_SEG+ReloSS, SP = ExeSP */ /* CS = START_SEG+ReloCS, IP = ExeIP */ /* (: PUSH seg; PUSH offset; RETF) */ i=H->ReloSS+KERNEL_BEGIN_SEG; asm mov cx,i; i=H->ReloCS+KERNEL_BEGIN_SEG; asm mov dx,i; i=H->ExeSP; asm mov si,i; i=H->ExeIP; asm mov di,i; asm mov bx,PSP; asm mov DS,bx; asm mov ES,bx; asm cli; asm mov SS,cx; asm mov SP,si; asm sti; asm push dx; asm push di; asm retf; } } } } } printf("Kernel `%s' not found\n",KernelName); l1:; } /****************************************************************************/ void dump (char far *Command) {int i, k, Clu; unsigned long j; unsigned len, len1; struct dirent *Ent; char DirectoryRecord [11]; char far *FileName; char far *ppp; if ((FileName=strchr(Command,' '))==NULL) return; FileName++; if (*FileName==0) return; printf("Dump %Fs\n",FileName); for (i=0;i<11;i++)DirectoryRecord[i]=' '; memcpy(DirectoryRecord,FileName,strlen(FileName)); for (j=RootBeg;j<=RootEnd;j++) if (absread (TR(CurrentDevice), 1, j, Buf2)) printf ("boot: sector %lu absread error\n", j); else { for (k=0;k<16;k++) { Ent = (void *) (Buf2+k*32); if ((*Ent).d_name[0] && ((*Ent).d_name[0]!=0xE5)) { if ((*Ent).Attr.B.Label) continue; if ((*Ent).Attr.B.Dir) continue; if (memcmp(Ent->d_name,DirectoryRecord,11)==0) { printf("File `%Fs' found. Cluster %u\n",FileName,Ent->d_fileno); #ifdef DEBUG printf(" press any key "); getch(); #endif /* Load FAT */ j=ResSecs; FAT = FAT_ADDR; for (i=0; id_fileno; #ifdef DEBUG printf("FAT loaded\n"); printf(" press any key "); getch(); #endif while (Clu!=-1) { CluRead(TR(CurrentDevice),Clu,pCluster); ppp=pCluster; for (i=0;i>6)+1; if (i) Devices[0].sec=-1; if (i>1) Devices[1].sec=-1; if (*(char far *)MK_FP(0,0x475)) /* 40h:75h - number of fixed disk drives */ if (bootread0 (_HDD_, MBRBuf)) /* [Interrupt List] */ printf ("boot: MBR read error\n"); else { /* printf("# head sec trk ResSecs MaxSectors\n"); */ process_partition_table (MBRBuf); } else ; /* outMBR(MBRBuf); */ } /****************************************************************************/ char *gets (char *s) { int i; char buf[MAX_LEN_STR]; char c; for(i=0;i'); gets(command); strupr(command); /* printf("\ncom=`%s'\n",command); */ if (command[0]==0) { load_and_run ("KERNEL"); } else if (strcmp(command,"HELP")==0) help(); else if (strcmp(command,"REBOOT")==0) reboot(); else if (strcmp(command,"COLD")==0) cold(); else if (strcmp(command,"MSDOS")==0) msdos(); else if (strcmp(command,"HDD2")==0) hdd2(); else if (strcmp(command,"LS")==0) ls(); else if (strcmp(command,"MORE")==0) More=1; else if (strcmp(command,"NOMORE")==0) More=0; else if (memcmp(command,"DUMP ",5)==0) dump(command); else if (command[1]==':') { setdisk(command[0]-'0'); } else { load_and_run (command); } } }src/history.doc0100664000076500007650000007440207010271742013275 0ustar prool2prool2 ᠭ 㫨 ⭮ 浪 ( 㭪 ਨ 筮 뢠 ,  ⮩ ᨨ ) ⮤ 㬥 ᨩ 﫠, ਬ ࠢ ⠪: ᨨ 砥 ⥪ . , ਬ, ᥭ 㫨 ᨨ. ⥪饣 (⥪ ⮪) ६ (--ᥪ㭤) 樨 ⠢ ⮬᪨ ᯮ짮 ९ ६ Turbo C 2.0 (__DATE__ __TIME__). 砥 - ⢥ 㫨, ⠪ 砥 ᪠ । ᢥ (ਬ, ⠢ BBS ftp ࠭ 䠩-) ᨨ. ⢥ , ⥬ 騩 ࠧ ᨨ ௥ . ( ᠬ , MSDOS 3.0 ⫨砥 2.0 ᨫ쭥, 祬 3.0 3.1). ᫥ (⢥) ࠧ ᨨ ࠢ ⪨ ணࠬ 筮 ४樨. TODO ? - ࠩ (DEVices) - 㤠 㦭 . 맮 ⨯ end Kernel History (In STACK (REVERSE) order) H 浪 Ver. 0.1.1.19 4-Nov-99 Ver. 0.1.1.18 2-Nov-99 - 㧪 - Windows 95 OSR2 RUS Ver. 0.1.1.17 26-Aug-99 - 0.1.1.16, compile by Turbo C 2.01 (all previous compiled by TC 2.0) Ver. 0.1.1.16 12-Apr-99 Ver. 0.1.1.15 3-Mar-99 Ver. 0.1.1.15 23-Feb-99 Ver. 0.1.1.14 22-Feb-99 Ver. 0.1.1.14 21-Feb-99 Ver. 0.1.1.14 20-Feb-99 Ver. 0.1.1.14 19-Feb-99 Ver. 0.1.1.13 18-Feb-99 Ver. 0.1.1.12 7-Feb-99 Ver. 0.1.1.11 22-Jan-99 Ver. 0.1.1.11 8-Jan-99 - ᠫ exec() ( execve(), ᠭ 㦥 㫥 process.c, 騩 exec(), 㤥 ଠ쭮 뢠 ᮢ 㤥 ᮮ⢥⢮ ॡ POSIX); ⠪ ᠫ exit() Ver. 0.1.1.10 7-Jan-99 - fork() ࠡ⠫!!! :)) Ver. 0.1.1.10 6-Jan-99 Ver. 0.1.1.10 5-Jan-99 Ver. 0.1.1.9 4-Jan-99 Ver. 0.1.1.8 3-Oct-98 - fork() Ver. 0.1.1.7 2-Oct-98 - ࠢ ᪮쪮 訡, ⮬ ᫥ start (樨 ᪨) Ver. 0.1.1.6 1-Oct-98 - ࠡ⠫ ᪥ !!! Ver. 0.1.1.5 30-Sep-98 Ver. 0.1.1.4 29-Jun-98 ਠ ஢騪 (not worked) Ver. 0.1.1.0 15-Feb-98. ࠢ , 砢訩 ⮬, ࠡ⠫ 䠩 ⥬ FAT-12 . ⬥ ࠢ ( ᨨ 㫨 0.0.0.21 (L) 31-May-97), - ᬮ 뫨 ᥭ ⮫쪮 ᥩ. Ver. 0.1.1.2 8-Apr-98 Ver. 0.1.1.1 10-Mar-98 Ver. 0.1.1.0 14-Feb-98 Ver 0.1.0.33 14-Dec-97 Version 0.1.0.31 31-Aug-97 Version 0.1.0.30 24-Aug-97 - add system calls absread, abswrite; fixed bug (訩, ᫨ > 11. PATH_MAX ᨬ (. include/limits.h, ᥩ =255 ᨬ)) Version 0.1.0.29 17-Aug-97 Version 0.1.0.28 11-Jul-97 Version 0.1.0.27 30-Jun-97 Version 0.1.0.26 21-Jun-97 Version 0.1.0.25 9-Jun-97 kernel.ovl 稪 ᪨ ⮢ (portions copyright by G. Shepelev) Version 0.1.0.26 31-May-97 Version 0.1.0.25 31-May-97 ࠢ , 訩 砥 맮 read(h,buf,len) len>1024 Version 0.1.0.24 21-May-97 Version 0.1.0.23 18-May-97 Version 0.1.0.23 17-May-97 Version 0.1.0.22 15-May-97 Version 0.1.0.21W 14-May-97 Version 0.1.0.20W 12-May-97 ᨨ 䨪ᮬ "W" ᮡ࠭ , ࠡ. ࠢ 訡 ࠡ FAT > 64K Version 0.1.0.19 11-May-97 Version 0.1.0.17 2-May-97 Version 0.1.0.17 1-May-97 fixed case Cylinder>255 in HDD Version 0.1.0.16 30-Apr-97 Version 0.1.0.15 28-Apr-97 ⫮ 让 裡 ⥬, ⪮஢ Turbo C 2.0 small, DS=SS, 뫮 DS!=SS Version 0.1.0.14 28-Apr-97 Version 0.1.0.14 27-Apr-97 booted from A:, B:, C:, D:, etc... Version 0.1.0.13 26-Apr-97 Version 0.1.0.12 24-Apr-97 add system calls wherex(), wherey() Version 0.1.0.11 23-Apr-97 Version 0.1.0.10 21-Apr-97 Version 0.1.0.9 20-Apr-97 ⫮ 让 mov SP, ... (. c0.asm 20-Apr-97) Version 0.1.0.8 22-Mar-97 Version 0.1.0.8 21-Mar-97 Version 0.1.0.8 20-Mar-97 Version 0.1.0.7 19-Mar-97 Version 0.1.0.6 13-Mar-97 - ஢ 㤨 䠩 । ࠩ⮢ Version 0.1.0.5 9-Mar-97 Version 0.1.0.5 8-Mar-97 Version 0.1.0.4 3-Mar-97 Version 0.1.0.4 2-Mar-97 Version 0.1.0.4 1-Mar-97 Version 0.1.0.3 23-Feb-97 Version 0.1.0.2 17-Feb-97 H稭 ᨨ 0.1.0.0 㫨, - ࠡ⠥ ⫠稪 AFD-Pro (c) AdTec GmbH, 1987 Version 0.1.0.1 2-Feb-97 Version 0.1.0.1 1-Feb-97 Version 0.1.0.0 26-Jan-97 0.0.2.4 16-Oct-96 ࠭ 訡: ࠭ ࠡ FAT (LinkClu()) ﬨ FAT 0.0.2.4 15-Oct-96 0.0.2.3 14-Oct-96 ࠢ 訡 裡 DS!=SS (. src/kernel/c0.asm) 0.0.2.3 13-Oct-96 0.0.2.3 12-Oct-96 0.0.2.2 29-Sep-96 0.0.2.1 16-Sep-96 0.0.2.0 12-Sep-96 0.0.2.0 11-Sep-96 0.0.1.30 10-Jun-96 0.0.1.29 18-May-96 0.0.1.28 16-May-96 0.0.1.27 15-May-96 0.0.1.26 15-May-96 0.0.1.25 12-May-96 0.0.1.24 12-May-96 0.0.1.23 11-May-96 砫 control-break 0.0.1.22 10-May-96 - fixed ᪮쪮 bugs... 0.0.1.21 ??? 0.0.1.20 ??? 0.0.1.19 21-Apr-96 0.0.1.19 20-Apr-96 0.0.1.18 19-Apr-96 0.0.1.18 18-Apr-96 - ᮧ 㫨 mailing list proolix@infocom.kharkov.ua 0.0.1.17 17-Apr-96 - ᮡࠫ 㫨 ࠡ 稢 ࠧ ଠ DOS 4.0. axl ᠫ 㫨 ping (TCP/IP ) 0.0.1.17 15-Apr-96 - ࠢ 㭪樨 printf(), 訩 ᯮ짮 ଠ "%lu". ࠢ 㭪 ultoa() 0.0.1.17 14-Apr-96 0.0.1.17 13-Apr-96 - ࠢ 㭪樨 getcwd() 0.0.1.16 11-Apr-96 10-Apr-96 7-Apr-96 - ஦ 0.0.1.15 6-Apr-96 0.0.1.15 5-Apr-96 - ࠢ  ࠡ ⮬... 0.0.1.14 4-Apr-96 - ࠡ⠫ ⮬, ࠢ  0.0.1.13 3-Apr-96 0.0.1.13 31-Mar-96 0.0.1.12 30-Mar-96 0.0.1.12 27-Mar-96 - 砫 ࠡ ⮬ 0.0.1.12 26-Mar-96 0.0.1.12 25-Mar-96 । 㧨 ᪥ ࠧ஬ 512. ࠢ. ஢७ ᪥ 3" (720k 1.44 M) 5" (360 K 1.2 M) 0.0.1.11 24-Mar-96 0.0.1.11 22-Mar-96 0.0.1.10 21-Mar-96 0.0.1.9 20-Mar-96 0.0.1.8 19-Mar-96 0.0.1.7 18-Mar-96 0.0.1.6 17-Mar-96 ⨯ EXE 饬 ࠡ⠥. 㯠 ணࠬ PKLITE by PKWARE Corp. 0.0.1.6 16-Mar-96 0.0.1.5 14-Mar-96 0.0.1.5 13-Mar-96 0.0.1.5 12-Mar-96 0.0.1.5 10-Mar-96 0.0.1.5 9-Mar-96 Boot-manager ⥯ 㦠 ⮫쪮 OS Proolix, 㣨 ⮭ ணࠬ ⨯ COM (ਬ ⮭ Arcanoid (ar.com) Last Mission (mission.com) Proolix Games (. ⠫ games) 0.0.1.4 7-Mar-96 0.0.1.4 6-Mar-96 0.0.1.4 5-Mar-96 砫 ⨯ EXE 0.0.1.4 27-Feb-96 ஬ 稪, 稪, Boot Manager ver. 0.0.0.0 ࠡ⠫ !!! (㧨 ⨯ COM) 0.0.1.4 26-Feb-96 0.0.1.4 25-Feb-96 0.0.1.4 22-Feb-96 0.0.1.4 21-Jan-96 0.0.1.4 20-Jan-96 0.0.1.4 19-Jan-96 0.0.1.4 15-Jan-96 0.0.1.4 11-Jan-96 0.0.1.4 10-Jan-96 砫 ஬ 稪 /boot ( ⮣ boot ᥪ ᨨ 0.0.2.3 16-Sep-95 㧨 אַ (䠩 /kernel)). ⥯ boot-ᥪ 㤥 㧨 ஬ 稪 /boot, /boot 㤥 㧨 /kernel 0.0.1.3 29-Dec-95 0.0.1.3 28-Dec-95 0.0.1.2 27-Dec-95 - fork() ??? 0.0.1.1 25-Dec-95 - zarabotal perviy variant novogo systemnogo vyzova exec() 0.0.1.1 24-Dec-95 0.0.1.0 14-Dec-95 H . 祭 MSDOS. ।뢠 襩 ᮢ⨬ UNIX. ⠡ ᮢ (struct processes include/struct.h), 1, ᤥ ਠ syscall ( ᯮ짮 ⠡ ᮢ). ९ᠭ exec() exit(). 㤥 ᠭ fork(). ࠧ 㤥 ᯥਧ ⠩. ப ᯮ Linux8086 by Chad Page, Minix, BSD, , ᪠ .H堥 (vovik@glutton.uanet.kharkov.ua). ⠢ 㫨 㤥 ⢫ 䠩 proolixN.arj (proolixN.z/proolixN.tgz), N - ᫥ ᨨ (0.0.1.0 -> proolix0.arj, 0.0.1.1 -> proolix1.arj, 0.0.1.10 -> proolixa.arj etc). 0.0.0.112 13-Dec-95 11-Dec-95 - 뢠, 㫨 ଠ쭮 㧨 3" (720 1.44), ᨨ 砫, ⭮, ⥪ 㧨 ଠ쭮. H ftp 뫮 3" ࠧ image720.gz image144.gz 0.0.0.111 10-Dec-95 - 㭪権 㯯 mem.h string.h ࠭ 砫 ஢ન 'if (dest==NULL) return NULL'. 蠫 ࠡ ⠡楩 ஢ 뢠 ( ன ࠢ NULL). Minix' 㬠 㭪 ⮦ ⠪ ஢ப. ⮬ . ( ஢ઠ 50820, ⥯ - 50340, delta=480 bytes) 0.0.0.111 9-Dec-95 8-Dec-95 7-Dec-95 0.0.0.110 6-Dec-95 . images 360K 1.2M, . . ls Ls 5-Dec-95 . pix.tgz 20-Nov-95 19-Nov-95 ७ᥭ Minix Proolix 娤 ansi.h, ⨫: banner 15-Nov-95 0.0.0.109 12-Nov-95 - , 11-Nov-95, ⢥ OS Proolix. १ ⮢ ⠭, 稭  - 㫥 execve(). 樨 EXE 䠩 ( 祭) 뫮. ( EXE 䠩 뫠 ᨨ 0.0.0.102 23-Mar-95) 11-Nov-95 - ᯥਬ஢ ஬ Linux8086 0.00.3, ⠫ ᮡ Minix, ⠫ ᮡ Minix bcc ( ⢮ gcc Linux8086 0.00.3) 10-Nov-95 - ⤠ VGA . Proolix 㤥 㫥. ("" 맮 setcolor/getcolor ⫠ ࠭, VGA) 0.0.0.108 8-Nov-95 0.0.0.107 8-Nov-95 0.0.0.106 7-Nov-95 - . more, . ohs() 0.0.0.106 6-Nov-95 - ᡮમ ணࠬ yap/more Minix. 㫨 curses ணࠬ 饣 ࠪ (signal(), wait() etc...) 0.0.0.106 5-Nov-95 - ணࠬ 㯯 printf ᯮ짮 printf_buf, 뤥塞 malloc, ந室 ᠭ. ᯮ짮 쭮 ᨢ new_printf_buf (. printf.c), 뫮 ࠭ ( ᨨ 0.0.0.106 7-Oct-95) ࠡ⠥ ଠ쭮. 0.0.0.106 4-Nov-95 0.0.0.106 25-Oct-95 0.0.0.106 15-Oct-95 0.0.0.106 12-Oct-95 0.0.0.106 11-Oct-95 0.0.0.106 8-Oct-95 - । -樨 㯯 printf, ᮫짮 ⥪, ᭮ ࠭⢠ . ࠩ ᮫ ९ᠭ . ᭥... :( 0.0.0.106 7-Oct-95 - ᮧ ⫥, 㭪樨 㯯 printf 祭 ᨫ쭮 ᯮ ⥪, ⥪ ந室 . (+⥪ ᥣ - 64, ॢ襭 ࠧ । 55-56 뢮 ப १ printf 稭 , 祧, ᫮ printf 뢮 ப 㬥). H室 ९ printf ⠪, ⮡ ⢥ ஢ ப ᯮ짮 ᨢ, ࠧ騥 ⥪, ᨢ, 뤥塞 alloc/malloc ( 뤥 ந室 ᥣ , 饣 㫠 conventional memory ॡ ⮫쪮 far pointers) 0.0.0.106 1-Oct-95 - 㫨ᮬ ࠡ⠫ arcanoid mission ਡ⨢ 設 0.0.0.106 28-Sep-95 0.0.0.106 24-Sep-95 - ࠡ ⮬ 0.0.0.107 24-Sep-95 - 㧪 0.0.0.107 23-Sep-95 - 㧪 0.0.0.107 22-Sep-95 - 㧪 0.0.0.107 17-Sep-95 - 㧪 0.0.0.107 16-Sep-95 - 㧪 0.0.0.107 15-Sep-95 - 㧪 0.0.0.107 3-Sep-95 - . . 맮 getcolor 0.0.0.107 1-Sep-95 - ᫥ 뢠 㫨. . . 맮 rand, srand, setcolor 0.0.0.106 6-Jun-95 0.0.0.105 25-May-95 0.0.0.105 14-May-95 0.0.0.104 14-May-95 0.0.0.104 23-Apr-95 0.0.0.104 19-Apr-95 0.0.0.104 16-Apr-95 0.0.0.104 10-Apr-95 0.0.0.104 6-Apr-95 0.0.0.103 25-Mar-95 - ࠢ 訡 cp /bin/e /1/ee malloc o । 64 0.0.0.102 24-Mar-95 - ࠢ mkdir() 0.0.0.102 23-Mar-95 - 祭 ७ GNU ⨫ 㣨 ⨫ 㫨 㦥 ଠ .exe. ⮫쪮 ⮬, - ⨫ 64. pointers (*), । ⥬ 맮 , far (far *). ⮡ ᫮ far (FAR), ⨫ tiny, ࠭, compact, large huge - 䠩 ࠧ .com (aka .bin aka .sav), 䠩 .exe H砫 ࠡ ଠ⮬ .exe 0.0.0.101 19-Mar-95 0.0.0.101 18-Mar-95 0.0.0.101 17-Mar-95 - ࠡ⠫ ଠ쭮 GNU rmdir & rm. H砫 ls 0.0.0.100 15-Mar-95 - த ⫠ GNU rmdir & rm 0.0.0.100 13-Mar-95 0.0.0.99 8-Mar-95 - ᮡࠫ GNU-⨫ - rm rmdir. ࠡ . ⪠ unarj ! 0.0.0.98 5-Mar-95 - ⠫ ୥ 㦥 ᤥ. fixed bug in open2() (case of open(".")). ⥬ 맮 rmdir(). 믮塞 ணࠬ PATH 0.0.0.97 4-Mar-95 - . open2(), ᤥ (the case of open("/dir/file")). 㭪 openwdir 0.0.0.97 3-Mar-95 - ࠢ . close(), 易 ⨥ ⠫, fixed bug in mkdir() 0.0.0.96 27-Feb-95 - 㭪 getcwd() pwd ࠡ ࠢ쭮 ⠫, . 㭪 .맮 getenv, mkdir, md 0.0.0.96 26-Feb-95 - . open2() ᮧ 䠩 MSDOS , . lseek(,0,SEEK_SET) 0.0.0.96 25-Feb-95 - ࠢ boot-ᥪ - ண  䠩 kernel ७ ⠫ ஬ ( ந室 䫨 kernel kernel.ovl). H boots.asm 0.0.2.1 25-Feb-95. . open2() ( ᮧ 䠩) lseek() 0.0.0.95 23-Feb-95 - ७ l ls ⥬ 맮 telldir seekdir । ࠡ ୥ ⠫, 뢠 䠩. MS DOS ! UNIX/POSIX ⠫ 䠩 ( ⮬ ᫥ ୥), ᯥ稢 ன, ⮣쭮 ணࠬ஢. MSDOS ୥ ⠫ 㭨 - ⢥ ⠫,  䠩 ( 䨪஢ , ।⠢ 楯窮 ஢, 䠩 ୥ ⠫). ஬ ⮣, ୥ ⠫ MSDOS 뫮 "." "..", ⠫. ( 뢠 ஢ ⪥ 䠩 "." ".." 砥, ⥪騬  root ("/")). ( ࡠ MSDOS  㤨⮬ MSDOS 1.0 aka CP/M-86). open2() ࠢ. 0.0.0.94 21-Feb-95 - ⠫ ᮡ zoo 㫨. zoo 쥬 64 com-䠩 . H 㫨 exe-㫨. ⠫ ᮡ GNU file utilities 㫨. ࠫ 쭮 ⥪ ᯮ짮 header-files from BSDI UNIX ࠬࠬ POSIX_SOURCE etc. GNU-⨫ 㫨 ⥬ 맮. external variable environ. 0.0.0.94 15-Feb-95 - `key` 0.0.0.94 13-Feb-95 - `s` (`string`), ࠢ ஢ trace, . page videomod 0.0.0.94 12-Feb-95 - sys_errlist, modified perror(), 㤠 ᪮쪮 io.c stdio.c dir.c 0.0.0.94 11-Feb-95 - . lseek(), opendir() 0.0.0.94 9-Feb-95 - ࠧࠡ⠭ ⮤ 뤠 ஢筮 ଠ樨 ⫠ ண ணࠬ 㫨 ( ᯮ짮 ⠭ । Turbo C ९ APP) 0.0.0.94 30-Jan-95 0.0.0.94 29-Jan-95 - 맮 chdir S_ISDIR, S_ISREG, S_ISLABEL 0.0.0.94 28-Jan-95 - 맮 getcwd() 0.0.0.93 23-Jan-95 - । ⥬ 뢠 60h 83h ᤥ ।塞 䠩 conf.c ⥬ 맮 㭪樨 offset(), seg(), farptr() 0.0.0.92 22-Jan-95 - প 䨪 㫥 (msherc.asm, msherc1.asm). . 맮 int86 0.0.0.92 21-Jan-95 - boot record 易 ⨬ 䠩 뤥 ⤥ ⠫ BOOT ⤥ 娢 pix_boot.arj. ᥬ஢ msherc.com. ᮯ 猪 16:00 0.0.0.92 19-Jan-95 - ᯥਬ ᡮમ GNU ⨫ Proolix. ࠭, ॠ ( POSIX , , ॢ ⠫, ࠩ, ஢ 䠩 ⥬, 짮⥫᪮ (permissions) ( 筮)) 0.0.0.91 16-Jan-95 - . close(), getftime setftime, . touch 0.0.0.91 15-Jan-95 - absread ⠫ 뢮 ᮮ饭 訡. . printf("%s",NULL). . 訡 䠩, 騬 ⠢ (⥯ ) {=} (⠪ 訡, 㦥 檨) 0.0.0.91 14-Jan-95 - . printf("%2X") de.c (diskeditor), read(), . absread.c (NearBuffer ᤥ static ࠧ ய DMA error, ந室 祭 64 ࠭), , , 㯮 {0.0.0.86 16-Dec-94} (᭨ . cp, ᫥ ॢ饭 cp ய) 0.0.0.91 13-Jan-95 0.0.0.91 12-Jan-95 - ᮢ 檮 ᤥ ૥ ( १. - 먣࠭ ⥬ ᠬ 1) । ⨯ 0.0.0.90 11-Jan-95 - ࠢ printf("%s"). . printf. . ଠ %u, 䨪 "-" ("%-10s") 0.0.0.89 10-Jan-95 - 㭪樨 . 맮 fgets, fputc, fputs, fread, fwrite, fprintf, vfprintf, ftell, fseek, fgetpos, fsetpos, rewind. 䠩 堭ࠬ 0, 1, 2 ⮪ stdin, stdout, stderr. H- ⮩ ᨥ ᮡࠫ unarj! 뤠 ⠢! 0.0.0.89 9-Jan-95 - 㭪樨 . 맮 _chmod, access ᮢ 檮 ⨢ ஫ boot-ᥪ (ver. 0.0.2.0 9-Jan-95, 493 bytes) 砫 . ஫ PTS DOS (. [H⥭]) H砫 ⮪ I/O (䠩 stream.c): 㭪樨 .맮 fopen, freopen, fdopen, fileno, fgetc, fclose 0.0.0.89 8-Jan-95 - 㭪樨 . 맮 getftime, setftime, chmod 0.0.0.89 7-Jan-95 - . 쪨 . ணࠬ ( .맮) ohb/ohw/ohd, puti/putl. ⥯ printf 0.0.0.89 6-Jan-95 - . . gets. ࠡ⠭ 堭 । ६ ᪨ ⭮. . errno command\c1.asm, include\errno.h, kernel\klib.asm open() (䠩 io.c). 㭪樨 ( ⥬ 맮) putch/putchar getch/getchar ᤥ 묨 . ६ More, 㯭 ᪨ ᮢ, ࠢ 㧮 뢮 ࠭. . setmore. ࠬ 'width' 㭪 ᥬ⢠ printf 0.0.0.88 29-Dec-94 - ࠢ "騩" gets. (.., ⠪ , 㦥 , ࠢ, ⮬ - ( 砥, - ७ header-䠩 ⠫, include, ⨫). ࠧ祭 樨 樨 ⨫ ९ୠ ६ KERNEL, । ⮫쪮 ६ 樨 (. 拉୮ makefile . stdio.h). ࠢ atoi() ࠢ 2 vsprintf(), 﫨 sprintf, vprintf, printf ࠢ itoa()/ltoa() . printf 맮 㭪権 puts0 ᫥騥 ohw/puti etc ॣ୮ 맮 printf ᥬ ⨫ ࠭ ⥬ 맮 ( 㭪樨) puts0(. stdio.h) puti() 㦥  - 뢮 ᫨誮 ப printf() १୮ 讣 祭 MAX_LEN_STR limits.h 0.0.0.87 25-Dec-94 - ⥬ 맮 printf, sprintf, vsprintf, vprintf, itoa, ltoa, ultoa. 0.0.0.87 24-Dec-94 - 砫 printf: 㭪 printf 0.0.0.87 23-Dec-94 - . write (室 १ ᥪ), absread/abswrite. cp, 祬  訡 ७ Cp. 0.0.0.86 18-Dec-94 - AppendClu 0.0.0.86 17-Dec-94 - ࠡ 楫 ﭠ - ⮣, 窠 (4 ) F8-Enter ;) 0.0.0.86 16-Dec-94 -  cp de (RTFM "Press ENTER") 0.0.0.86 15-Dec-94 - open(), close(). 㦥 cp de 0.0.0.85 14-Dec-94 - abs, labs, . 맮 div, ldiv. 騥 맮 㯯 str* mem*, 㦥 ࠢ 㦥 (. string.c mem.c). 誠 맮 system() 0.0.0.84 13-Dec-94 - ࠢ ஢ FAT, . unlink(), . msdos() (. . । . . MSDOS, ⥯ MSDOS 㦠 msdos 祭 ⠩ (.䠩 msdos.asm)). Hᠭ cp 0.0.0.84 12-Dec-94 - ࠢ write, open, close. Hᠭ unlink(), rename() ᮮ. . 맮 rm mv 0.0.0.83 11-Dec-94 - : abswrite, secwrite, WritePhysSec, 䫠 O_CREAT, O_WRONLY, O_RDWR 㭪樨 open, . 訡 puti, 㭪 write !!!, 㭪樨 NewCashe, AppendClu, LinkClu 0.0.0.83 10-Dec-94 - ⨬஢ ⥭ 䠩 㭪樨 read(). ࠡ⠫ msdos (㧪 msdos । 㫨 뢠 ᪮ A:), mount umount 0.0.0.83 9-Dec-94 - ⨬஢ ⥭ 믮塞 䠩 㭪樨 execve() ࠡ ࠬ-蠬 0.0.0.82 7-Dec-94 - internal command `buf`, ⫮  ⬥ ஢ ᠬ । ᯮ㥬 0.0.0.81 5-Dec-94 - ᤥ MSDOS. BUFFERS ஢. (#define BUFFERS . 䠩 limits.h, ⠫ include, 娢 pix_incl.arj) 0.0.0.81 4-Dec-94 0.0.0.81 1-Dec-94 - ࠡ ᪮ ਧ १ Cashe 0.0.0.81 29-Nov-94 0.0.0.81 27-Nov-94 - int.command timer, 楫 ⥬ 맮 ⨯ str* (string.h/string.c), isalpha (ctype.h/ctype.c), malloc/free, tell/lseek 0.0.0.81 26-Nov-94 - syscall raise(int sig) 0.0.0.80 21-Nov-94 0.0.0.80 20-Nov-94 0.0.0.80 19-Nov-94 - boot 0.0.1.4 19-Nov-94, ⢥ 0.0.0.79 13-Nov-94 - boot (boot.asm 0.0.1.2 13-Nov-94) ࠡ⠥ !!! 0.0.0.78 8-Nov-94 - boot-ᥪ 㧨 0:7c00, - 稭 60:0, ⮬, ᫨ 30, ६ 㧪 㤥 boot-ᥪ 㧪 ४. ⮬ boot-ᥪ (ver. 0.0.1.0), 㤥 ६ 2- ⠡ 뢠 㦠 㤠. (H diskette parameter table!!!) - 砥 2- ⠡ 뢠. H int f0 - F000:XXXX - - BIOS. . boot- ᥪ (ver. 0.0.1.1) 㤠 ࠭⢮ - 1000:0500. 0.0.0.78 7-Nov-94 - ᥬ ணࠬ SysCall (klib.asm), ॠ 堭 ⥬ 맮, ९뢠 , ⮬ ⠪ . 0.0.0.78 6-Nov-94 - 㭪 fork() 0.0.0.78 5-Nov-94 - ps 0.0.0.77 3-Nov-94 - ࠢ boot-ᥪ (0.0.0.7 3-Nov-94), ⥯ ⠥ ᥪ ᪮쪮 ࠧ 訡 (retrying) 0.0.0.76 26-Oct-94 - izmenen adres zagruzki v boots.asm (boots.asm ver.0.0.0.6 26-Oct-94) na PSP=50h (bilo PSP=70h). Gruzitsya i s 360K i s 1.2M (???!!!) Gipoteza: kogda kernel udlinitsya na 200h bytes - opyat' nachnutsya glucki :( 0.0.0.75 24-Oct-94 - ࠢ ... ⥯ 㧨 360, ࠭ 㧨. H 㧨 1.2, ࠭ ᨨ 㧨... ??? ( 3" gruzitsya, no gluckaet, hotya ran'she sovsem ne gruzilas') 0.0.0.74 23-Oct-94 - 맮 strchr, strcmp, strcpy, strncpy, strlen 譨 襫 sh.com, fixed bugs in argc, argv & env params 0.0.0.73 20-Oct-94 - ࠡ ⮩, 뢮 - 㣫 ࠭, 맮 gettime getdate, date 0.0.0.72 18-Oct-94 - system call htoi 0.0.0.71 16-Oct-94 - gentbl 祭 (imho) 0.0.0.70 14-Oct-94 - ᤥ limits.h unistd.h, ᮣ᭮ POSIX errno (), lib1.lib (). H ᠭ ⥬ 맮 ( ᥬ) 室 ⠡ ᠭ ( ⨫): gentbl.c/gentbl.com - , syscall.tbl - ⠡ .맮 0.0.0.69 12-Oct-94 - 㭪樨 wherex(), wherey(), 騩 ᨬ 㣫 - ।⢠ BIOS - . ⥬ 饣 ᨬ 㣫 ᤥ ६ ( CMOS) 0.0.0.68 8-Oct-94 0.0.0.67 6-Oct-94 - ஢ ( ࠭!), ᤥ - 襪/襪 뢠, ⮫쪮 , , ᤥ ࠡ⪠ 뢠 8 騩 ᨬ 㣫 () - ⮫쪮 㫥 0.0.0.66 5-Oct-94 - internal command 'ls' - modify & add flags -L -F -T -M - 魮 ᤥ ࠡ⪠ BackSpace gets() 0.0.0.65 3-Oct-94 - env । ஦ . . "set". 0.0.0.64 26-Sep-94 - । 室 ⠪, ⮡ 뫪 (㪠⥫ '*') 뫨 far ( ࠧ ⮩ ॠ樨 ⥬ 맮). 砫 । 㭪樨 open/read 㭪樨 ࠡ ப. read ⨬஢ ᪮ 0.0.0.63 25-Sep-94 - de 0.0.0.62 24-Sep-94 - cat.com: 䫠 -H -M -A, .맮 strlen, 䠩-ன⢠ /dev/* 0.0.0.57 15-Sep-94 - 譨 ⨫ cat.com crc.com, .맮 perror, exit, getche 0.0.0.56 15-Sep-94 - ᤥ । argc, argv 짮⥫᪨ , ᫥ 㧪 ᪠ rc.com (᫨ 室, 筮 ;), ᤥ echo 0.0.0.51 12-Sep-94 - 砫 । argc, argv 짮⥫᪨ 0.0.0.50 4-Sep-94 - 0.0.0.47 2-Sep-94 - 㫨 設 286, system call shutdown, fixed error in asm proc getch(), ࠢ, ⭮, ५祭 -ᥪ, ᭮ ࠭⢮ 㫠 ᪮ etc. H 3- ᪠ 㧨 (࠭ 㧨). IMHO - 楯祪 ஢ ( ࠭ 'cat - H' 䠩 ᫨誮 ஡) CRC - ﭭ !!!??? :( 0.0.0.45 19-Jul-94 - ls 㤥 뤠 쥬 ᪠, 쥬 ⮣ ᢮. 쭨 () ࠡ , 㦭 ஢ 㫨. H ᨨ ! 0.0.0.44 18-Jul-94 - fixed error in absread.c (᫥ ᬥ ᪥ 﫠 read error) 0.0.0.43 13-Jul-94 - system calls ohw, ohb, puti, fixed error in sh.c ( . ப . ஡ - ஢) 0.0.0.42 12-Jul-94 - system calls open, read, close, filelength, puts0, minus, 誨 write, lseek, creat, dup 0.0.0.41 7-Jul-94 - ࠫ p㬥⠫ 設. H ⥯ Li- nux , VPIX' :( DV 2:461/35@FidoNet ⫠ DV 2:461/36 :( 0.0.0.40 5-Jul-94 - fixed err in ls.c (60 sec & 62 sec), history.doc 0.0.0.39 4-Jul-94 - fixed error on puti() (stdio.h) - output ** 00 {XT ࠫ :( } 0.0.0.38 20-Jun-94 - 쥤 38- ᨩ 0.0.0.38 18-Jun-94 - 㫨, ⪮஢ , XT/VGA, 㡡 - , -  ᨨ ࠢ ।饩, ⮫쪮 﫠 0.0.0.38 14-Jun-94 - 맮 exec_ ଠ 믮塞 䠩 - ᨣ ஢ઠ 0.0.0.37 9-Jun-94 - 訡 맮 0 ᫮ ࠬ஢, -㫨 ⠢ ப ⮩ 樨 䨪樥, 室 obj bin 0.0.0.36 8-Jun-94 - ࠡ⠫ ⥬ 맮 putch('Y') ।祩 N ࠬ஢ ⥪ 짮⥫ ⥪ . ( hello.c - hello.com) ⠡ ⥬ 맮. ⥬ 맮 -ணࠬ (㭪権) N ࠬࠬ 㤥 ᫮ 0.0.0.35 7-Jun-94 - redko poluchaetsya sest' za Proolix :( ᫨ 樮 ⥬ 㫨 蠥 ࠡ, 䨣... ࠡ ;) 0.0.0.34 3-May-94 - doskey Ver 0.0.0.2 3-May-94 0.0.0.33 2-May-94 - doskey by C, 2:461/61.99@Fido 0.0.0.32 2-May-94 - 㫨 ଥ Infocom. 0.0.0.31 4-Mar-94 - ᫥ 㫨 ଥ SIA 0.0.0.30 2-Mar-94 - Lost 150 000 ukr. coupon :( 0.0.0.29 1-Mar-94 - touch *.* ;) 0.0.0.28 28-Feb-94 0.0.0.27 27-Feb-94 - ਭ ࠡ -0010. Fixed error in setvect() 0.0.0.26 24-Feb-94 0.0.0.25 23-Feb-94 0.0.0.24 22-Feb-94 - Proolix for mouse (XProolix) 0.0.0.23 14-Feb-94 0.0.0.22 11-Feb-94 - । 砥 㫨... :( 㫨 /2 ० -ᨨ - ... ( OS/2, DOS-  㠫쭮 XT ᫥ ⮣ ᫮) 0.0.0.21 5-Feb-94 - int0 ... 0.0.0.20 4-Feb-94 - ࠡ ⥭ 設. ... :( - 訫 , , ⠪ ;) 0.0.0.19 31-Jan-94 - ࠫ ⥭ 設 - ࠡ :( 0.0.0.13 12-Jan-94 - break key ('\b') 0.0.0.12 11-Jan-94 - alloc.h 0.0.0.8 26-Dec-93 - fixed error in ls, in puti ⮣ , 砫 㫨 室 - ᥭ 1993 ( )src/boot/0040775000076500007650000000000007725637107012062 5ustar prool2prool2src/boot/bp.c0100664000076500007650000003450507007540162012616 0ustar prool2prool2#define VER "Boot Processor 0.1.6 2-Nov-99 (C) 1993-1999, S.Pustovoitoff" /* : 0.1.6 2-Nov-99 - ⢥ (ᬥ᪨) 䨪樨 0.1.5 10-Mar-98 0.1.4 24-Feb-98 - ᤥ ࠡ ᫥묨 extended partition 0.1.3 16-Jan-98 - ᤥ ࠡ extended partition 0.1.2 11-Jan-98 0.1.1 7-Jan-98 0.1.0 28-Dec-97 - add bootread() instead of absread(), add outMBR, add bootwrite() instead of abswrite() 0.0.20 32-Aug-97 - fixed small bug 0.0.19 24-Aug-97 - MSDOS/Proolix version 0.0.18 22-Aug-97 0.0.17 27-Apr-97 0.0.16 26-Apr-97 0.0.15 3-Apr-96 0.0.14 24-Sep-95 0.0.14 24-Sep-95 0.0.13 16-Sep-95 0.0.13 15-Sep-95 - ࠢ 訡 ࠡ ⪨ ᪠ 0.0.12 21-Mar-95 - ᬥ⨪ ᮢ Mike Aizatsky, 2:461/21.100 0.0.11 26-Nov-94 - ࠫ progname(). H䨣 뫠 㦭!? 0.0.10 19-Nov-94 - ᫥ -d  ᨬ 0.0.9 5-Sep-94 - -y switch 0.0.8 3-Sep-94 - 뢮 䠩 InName 0.0.7 26-Jan-94 0.0.6 10-Jan-94 putch__() 0.0.5 23-Dec-93 0.0.4 11 Dec 93 rename to BP - Boot Processor 0.0.3 0.0.2 7 Dec 93 0.0.1 6 Dec 93 add out_boot(), -d switch 0.0.0 2 dec 93 ⮣ Buffered MonoPIP 2.04 22 Nov 93 */ #include #include #include #include #include #include #include #define FAT12 0 #define FAT16 1 #define NO_FAT 2 #undef OPEN_MAX #undef TMP_MAX #include "..\include\prool.h" #define __TIME_DATE_ #define _FTIME_ #include "..\include\conf.c" #include "..\include\limits.h" #include "..\include\struct.h" #define SECSIZE 512 #define _HDD_ 0x80 /* Global definitions */ char FlagR = 0; char FlagI = 0; char FlagY = 0; char dev = 0xF0; int NextDrive=2; int NextDOSDrive='C'; struct DeviceStruct Devices [LASTDRIVE]; /* Devices [0] - disk A: sec=0 if not present Devices [1] - disk B: sec=0 if not present Devices [2] - disk C: sec=0 if not present Devices [3] - disk D: sec=0 if not present ... */ int active=-1; int bootread0 (int dev, void far * buf); int bootwrite (int dev, void far * buf); int ReadPhysSec (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk /* or cyl */, char *Buffer); int WritePhysSec (unsigned char drive, unsigned char sec, unsigned char head, unsigned char trk /* or cyl */, char *Buffer); #include "..\kernel\out_os.c" #include "..\kernel\out_mbr.c" int bootread (int Dev, void *Buf) {int i, err; char InternalBuffer [SECTOR_SIZE]; for (i=0; i [filename] [-r] [-i] [-a] [-y]\n\ -r - reverse copy (file->boot/master boot sector),\n\ DEFAULT (without '-r') - boot/master boot sector->file\n\ \n\ -i - install file to boot/master boot sector,\n\ BPB and partition table not change!\n\ -d - drive:\n\ @ - master boot record of 1st HDD\n\ Boot records:\n\ 0 - drive 0 (floppy drive A:)\n\ 1 - drive 1 (floppy drive B:)\n\ 2 - drive 2 (1st partition of 1st HDD)\n\ ...\n\ -a - set active partition (for extended partition only)\n\ -y - assume 'y' on all queries\n"); } putch__(char c) { switch (c) { case 0: c=' '; break; default: if (c<' ') c='.'; } return putch(c); } void out_devices() {int i; printf("\nDev Head Sec Trk/cyl Partition"); printf("\n-------------------------------"); for (i=0;i5000) { DiskSize/=1024; printf("\nDisk size %li Mb\n",DiskSize); } else { printf("\nDisk size %li Kb\n",DiskSize); } } #define EXTEND 5 #define EXTEND2 0xF int extended_partition(int dev) { if (dev==0xFF) return 1; if ((Devices[dev].system_indicator==EXTEND ) || (Devices[dev].system_indicator==EXTEND2) ) return 1; return 0; } void out_boot_or_mbr (int dev, void far *buf) { if (extended_partition(dev)) outMBR(buf); else out_boot(buf); } #include "..\kernel\ppt.c" void test_devices (void) {unsigned int i; struct MBRstru *MBR; char MBRBuf [SECTOR_SIZE]; for (i=0;i 0: 0 = ᪮ ன (AX & 0001H) > 1: 8087 ᮯ () > 2-3: ਭ᪠ RAM (AX & 0eH) 01H=16K; 04H=32K; 0eH=64K ( ) > 4-5: 砫/⨢ ० (AX & 0030H) 10H=40- 梥; 20H=80- 梥; 30H=TTL ஬ > 6-7: ᥣ ᪮ -1 (AX & 00c0H) 00H=1; 40H=2; 80H=3; c0H=4 > 8: DMA (AX & 0100H) > 9-11: RS232 (AX & 0e00H) 000H=; 200H=1; 400H=2; ... e00H=7 >12: 1=஢ (AX & 1000H) >13: 1=᫥.ਭ (PC/Jr ⮫쪮) >14-15: ⠭ ਭ஢ (AX & c000H) 0000H=; 4000H=1; 8000H=2; c000H=3 : ᯮ ஢ન ० . ᫨ (AX & 30H) = 30H, ஬Ģ ᥣ RAM 0b000H, 0b800H. */ i=((*(unsigned int far *)MK_FP(0,0x410) & 0xC0)>>6)+1; if (i) Devices[0].sec=-1; if (i>1) Devices[1].sec=-1; if (bootread0 (_HDD_, MBRBuf)) printf ("test_devices: MBR read error\n"); process_partition_table (MBRBuf); } int read_boot_or_mbr (int dev, char *buf) { int sec; if ((dev==0)||(dev==1)) { /* A: or B: */ return bootread(dev,buf); } if (dev==0xFF) { return bootread(_HDD_,buf); } sec=Devices[dev].sec; if (sec==0) return -1; return ReadPhysSec (_HDD_,sec,Devices[dev].head,Devices[dev].trk,buf); } int write_boot_or_mbr (int dev, void *buf) { int sec; if ((dev==0)||(dev==1)) { /* A: or B: */ return bootwrite(dev,buf); } if (dev==0xFF) { return bootwrite(_HDD_,buf); } sec=Devices[dev].sec; if (sec==0) return -1; return WritePhysSec (_HDD_,sec,Devices[dev].head,Devices[dev].trk,buf); } char buf [SECSIZE], bufboot[SECSIZE]; int main (int argc, char *argv[] /* , char *env[] */) { int i; int FileNameCounter; char InName [80]; int h; struct MBRstru *mbr_p; #if 1 clrscr(); #else for (i=0;i<25;i++)puts(""); #endif ident(); FileNameCounter=0; for(i=1;i=SECSIZE) printf(" or more\n"); else printf("\n"); if (i>SECSIZE) {printf("Not enough memory in boot sector\n");return 2;} else if (i>510) printf("Warning! Last 1-2 bytes lost!\n"); close(h); if (extended_partition(dev)) { /* MBR or extended partition */ for (i=0;i<0x1BE;i++)bufboot[i]=buf[i]; /* bootloader */ if ((active>=0)&&(active<4)) { /* set active partition */ mbr_p=(void *)bufboot; mbr_p->Partition[active].indicator=0x80; out_boot_or_mbr(dev,bufboot); } } else { /* plain boot sector */ for (i=0;i<3+8;i++)bufboot[i]=buf[i]; /* JMP and OEM name */ for (i=0x26; i %s sector %i:\n\nOverwrite %s sector (y/n) ? ", InName,sector_type(dev),dev,sector_type(dev)); if (reply("YN")!=1) return 1; } printf("\nFile %s -> %s sector %i: !\n", InName,sector_type(dev),dev); if (write_boot_or_mbr(dev,bufboot)){printf("Disk write error\n"); return 2;} } else if (!FlagR) { /* boot -> file */ printf("%s sector %i: -> file %s\n",sector_type(dev),dev,InName); if(read_boot_or_mbr(dev,buf)==-1){printf("Disk read error\n"); return 2;} out_boot_or_mbr(dev,buf); if((h=open(InName,O_CREAT|O_WRONLY|O_BINARY,S_IWRITE))==-1) {printf("Boot image open/creat error in file %s\n",InName); return 2;} if(write(h,buf,SECSIZE)!=SECSIZE) {printf("Boot image write error\n"); return 2;} if(close(h)) {printf("Boot image close error\n"); return 2;} } else { /* file -> boot */ if (!FlagY) { printf("File %s -> %s sector %i:\n\nOverwrite %s sector (y/n) ? ", InName,sector_type(dev),dev,sector_type(dev)); if(reply("YN")!=1)return 1; } printf("\nFile %s -> %s sector %i: !\n", InName,sector_type(dev),dev); if((h=open(InName,O_RDONLY|O_BINARY))==-1) {printf("Boot image open error in file %s\n",InName); return 2;} if(read(h,buf,SECSIZE)!=SECSIZE) {printf("Boot image read error\n"); return 2;} out_boot_or_mbr(dev,buf); if(close(h)) {printf("Boot image close error\n"); return 2;} if(write_boot_or_mbr(dev,buf)){printf("Disk write error\n"); return 2;} } return 0; }src/boot/fat12.asm0100664000076500007650000000201506465173710013467 0ustar prool2prool2; for FAT-12 NextClu proc ; Input: ax - cluster no ; Output: ax - next cluster from FAT ; cf=1 if EOF ; REGS SAVED ! push bx push cx push dx push di push ES mov di,ax mov bx,3 mul bx ; dx:ax := ax * bx shr ax,1 ; ax := ax /2 ; ax - addr in FAT mov bx,FATseg mov ES,bx mov bx,ax mov ax,word ptr ES:[bx] test di,1 jz @@1 mov cl,4 shr ax,cl jmp @@2 @@1: and ax,0fffh @@2: ; cmp ax,0fffh ; je @@cf ; cmp ax,0ff7h ; je @@cf cmp ax,word ptr MaxClusters+off ja @@cf clc @@ret: pop ES pop di pop dx pop cx pop bx ret @@cf: stc jmp @@ret NextClu endp src/boot/boots.bin0100664000076500007650000000077206761253110013670 0ustar prool2prool2@Proolix p )BOOT FAT12 &6xD |L3r\|||)|P|  | t@)|ȣ<|XQP}PrXQ +|t Y X@Y2 tYGP|}|PwrX@ | |XP0ûPXsP0мP0SQRVW}t%;|w_^ZY[SQRVWP||X3؋3BQʊދ׊sYY_^ZY[PSQSRHHؠ |)|Z[PsX |@Y[XPXPQRб $ZYXP< w07Xsrc/boot/boot_p.asm0100664000076500007650000003331006075037220014026 0ustar prool2prool2 PAGE ,132 ; Boot sector ver. 0.0.1.1 8-Nov-94 from Proolix operating system ; Copyright (C) Serge Pustovoitoff, 1993, 1994 off equ -100h Drive equ 0 ; Drive A ;ModifyParams equ 'Yes' Buff equ 0 ; 500h ?!!!!!!!!!! NewSeg equ 1050h PSPSeg equ 50h ; 70h ??????????????????????????????? LoadAddr equ (PSPSeg shl 4)+100h ;############################################################################# ; Print character sym to tty ; APS revised chr1 macro sym ; via BIOS ; Not worked in graph mode (bl - bg color!) ; NO SAVE REGS !!! mov ax,0e00h+sym int 10h endm chr1 ;############################################################################# ; NO SAVE REGS !!! ; ப, 筠 ப say. 쪮 say ᯮ 㭪 9h ; , sayr - 㭪 BIOS (㭪 0eh 뢠 10h) ; ᪨ ० ࠡ⠥ ; APS revised ; APS ! ᥣ ⠥ ப ; APS ! const str sayr macro str mov si,offset str call sayr_proc endm sayr ;############################################################################# locals ; ⪨ jumps ; ⪨ 室 .model tiny .code org 100h ;????????????????????????????? Begin: jmp short start db 90h OEM db 'KERNEL',0,0 SectSize dw 2 ;512 ;?! 2 ClustSiz db 2 ResSecs dw 1 FatCnt db 2 RootSiz dw 112 TotSecs dw 0b40h ;720 ;?! 0b40h Media db 0f0h ;0fdh ;?! f0 FatSize dw 9 ;2 ;?! 9 TrkSecs dw 18 ;9 ;?! 12h HeadCnt dw 2 HidnSec dd 0 BigNo dd 0 ; Big total no of sectors dw 0 ; Physical drive no db 9 ; Extended boot signature FATaddr dw 0,0 ; ! internal vars StartClu dw 0 ; ! Lbl db 'No_Kernel',0,0 ; Volume label db 'FAT12 ' ; File system ID RootSize dw ' ' ; use 2 last bytes of File system id SectSiz dw 512 ;?! 2 OldVec dw 2 dup (0) start: ; Table 11 bytes - drive param ; CS:IP = 0:7C00 SS=30 SP=F6 DS=0 ES=0 BX=7C00 Flags=0206 (DF==0) ; 0:0 - 0:100 - 1- ⠡ 뢠 ; ⥪: c 30:F6 (0:3F6) 0 ; ROM BIOS area 0:400-0:500 ; 0:500 - 0:10500 (1000:0500) - ⮬ 㤥 ; १ boot' 1000:0500 (1050:0) mov si,bx ; si <- 7C00h mov cx,NewSeg mov ES,cx mov cx,512 xor di,di ; es:di <- 1050h:0 rep movsb ; 0:7C00h -> 1050h:0 chr1 '1' ; Indicate Ok db 0eah ; JMP long l_fork (in child process) dw l_fork+off,NewSeg l_fork: push es pop ds XOR AX,AX mov dl,Drive int 13h ; Disk dl=drive ah=func 00h ; reset disk, al=return status chr1 '2' loc_3: sayr Ident+off ; 'P' mov al,byte ptr FatCnt+off ; al <- ⢮ FAT cbw ; ax <- ⢮ FAT mov cx,word ptr FatSize+off ; cx <- ࠧ FAT mul cx ; (dx:)ax <- 㬬 ; ࠧ FAT ; (dx = 0) add ax,word ptr ResSecs+off ; ax <- FAT + boot ; ax - Root Beginning Sector mov word ptr StartClu+off,ax ; PUSH ax mov ax,word ptr RootSiz+off mov cx,32 mul cx mov cx,word ptr SectSiz+off ; APS dec ax ; 1- 蠣 㣫 ; APS ^^^^^ div cx ; dx:ax / cx -> ax; mod -> dx ; ax - Root Size in Sectors ; APS inc ax ; 2- 蠣 㣫 ; APS ^^^^^ add word ptr StartClu+off,ax ; 稫 # 1- ; mov cx,ax mov word ptr RootSize+off,ax ; ᥪ POP ax ; ax - Root Bg Sec @@loop: ; load root directory push cx push ax mov bx,600h ; 1000h ******************* mov ES,bx mov bx,Buff mov dl,Drive call SecRead ; ⠥ ᥪ jc l_err mov cx,16 ; directory entries in 1 sector ; !!!!!! @@l: push cx mov cx,6 mov di,bx mov si,offset OEM+off rep cmpsb je l_found pop cx add bx,32 loop @@l pop ax inc ax pop cx loop @@loop ;㧨 ᥪ ᪠ ; end of load root dir ; inkey2 l_err: sayr Lbl+off Vis: jmp short Vis ;***************************************************************************** ; APS revised sayr_proc proc ; Ver 0.0.1 9-Dec-93 ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; NO REG SAVED !!! ; ᪨ ० ࠡ⠥ ; APS cld ; APS sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: ret sayr_proc endp ;***************************************************************************** Ident db 'P',0 Ver db 'I',0 l_found: pop cx sayr Ver+off ; jmp Vis ; Found kernel ; bx - kernel dir record ; word ptr [bx+1ah] - 1st cluster mov ax,word ptr es:[bx+1ah] ; ax - 1st cluster ; LoadFAT PUSH ax ; save ax with 1st clu no mov bx,Buff add bx,word ptr SectSiz+off ; Addr buf for FAT mov word ptr FATaddr+off,bx ; ࠭ . mov word ptr FATaddr+2+off,es mov ax,word ptr ResSecs+off ; 1- ᥪ FAT ; mov cx,word ptr FatSize+off ; 쪮 ᥣ ᥪ஢ MOV CX,2 ; @@l: mov dl,Drive call SecRead jc l_err add bx,word ptr SectSiz+off ; ࠧ ᥪ loop @@l mov al,byte ptr ClustSiz+off cbw mov dx,word ptr SectSiz+off mul dx mov cx,ax ; Cluster Size in Bytes ;!!!!!!!!!!!!!!!!!!!!!!!!!!!! xor ax,ax mov es,ax ;!!!!!!!!!!!!!!!!!!!!!!!!!!!! POP ax ; restore ax (1st clu of KERNEL) mov bx,LoadAddr MOV BX,1100h MOV ES,BX XOR BX,BX l2: mov dl,Drive call CluRead add bx,cx ; cmp bx,off ; , ??? ; jae l3 ; call NextClu ; set ax jnc l2 DB 0EAH DW 000H,1100H db 0eah ; JMP PSPSeg:100 dw 100h,PSPSeg l3: sayr Lbl+1+off l4: jmp l4 ;ssize db 'SIZE',0 ;**************************************************************************** NextClu proc ; Input: ax - cluster no ; Output: ax - next cluster from FAT ; cf=1 if EOF ; Use global var: ; FATaddr dw 0 ; REGS SAVED ! push bx push cx push dx push si push di push es mov di,ax mov bx,3 mul bx ; dx:ax := ax * bx shr ax,1 ; ax := ax /2 ; ax - addr in FAT mov si,ax les bx,dword ptr FATaddr+off mov ax,word ptr es:[bx+si] test di,1 jz @@1 mov cl,4 shr ax,cl ; jmp @@2 @@1: and ax,0fffh @@2: ; cmp ax,word ptr TotSecs+off ; ?!!!!! cmp ax,0ff8h jae @@cf clc @@ret: pop es pop di pop si pop dx pop cx pop bx ret @@cf: stc jmp @@ret NextClu endp ;**************************************************************************** SecRead proc ; ver 0.0.1 3-Nov-94 (for boot) ; Read absolute sectors ; Input: ax - abs sec number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; BP - autobase register ; DS - data segment reg ; Use global variables (based on BP!): ; word ptr HeadCnt+off ; word ptr TrkSecs+off ; Output: cf=1 if error ; ALL REGS SAVED !!! ; APS revised push ax push cx push dx push si push di mov si,bx ; save bx & dx mov di,dx PUSH ax mov ax,word ptr HeadCnt+off mov cx,word ptr TrkSecs+off mul cx ; dx:ax := HeadCnt*TrkSecs .. ஢ ; 樫 ᥬ ; => dx=0 mov bx,ax POP ax xor dx,dx ; dx:ax - Abs Sec No div bx ; ax - Trk; dx - mod ; Ax - ஦, ன 室 㦭 ᥪ mov bx,ax ; bx - track no mov ax,dx xor dx,dx ; dx:ax - module div cx ; dx:ax / TrkSecs; ax - Head; dx - Sec on Head-1 inc dx ; dx - Sec on Head mov cx,5 l_loop: push cx mov cl,dl ; sector mov ch,bl ; track ; Warning: track < 255 !!! mov bx,si ; Restore bx - offset for buff mov dx,di ; Restore dl - drive no mov dh,al ; head mov ax,0201h; Fn=02, Read 1 sector int 13h jnc l_break pop cx loop l_loop jmp short l_ret l_break: pop cx l_ret: pop di pop si pop dx pop cx pop ax ret SecRead endp ;**************************************************************************** CluRead proc ; Read cluster ; Input: ax - cluster number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; BP - autobase register ; DS - data segment reg ; Use global variables (based on BP!): ; StartClu dw 0 ; Number sector of 1st cluster ; ClustSiz db 2 ; SectSiz dw ; ALL REGS SAVED !!! ; APS revised push ax push bx push cx ; Sector = StartClu + ((Clu-2) * ClustSiz) PUSH bx PUSH dx dec ax dec ax mov bx,ax mov al,byte ptr ClustSiz+off cbw mov cx,ax mul bx add ax,word ptr StartClu+off ; ax - sector POP dx ; Restore dl POP bx ; cx - ClustSiz @@l: call SecRead jc l_err add bx,word ptr SectSiz+off inc ax loop @@l pop cx pop bx pop ax ret CluRead endp ;***************************************************************************** ;***************************************************************************** ;***************************************************************************** end Begin src/boot/booth12.bin0100664000076500007650000000077107007540152014016 0ustar prool2prool2HProolix +2)BOOT FAT16 |&||||F|H|'|)| |"|||+)|'| |2@6|| t@)|)|ȡF|H|}QPRrQ +|tY ZXY@ָEG%||||3ۋ|rՌƃ @ | |ȡ%|`03FsP0؎мP0PSQRSHHؠ |)|'|[Kss@ZY[XSQRWË&t%;6|w_ZY[PQR6|ˆB|36|C|D| QD| 6B|ʆ鲀6C|sYZYXYsrc/boot/bootd.asm0100664000076500007650000001444106114105372013655 0ustar prool2prool2 PAGE ,79 ; Debugging boot sector 0.0.0.4 25-Feb-96 ; Copyright (C) Serge Pustovoitoff 1994, 1995 ; History ; 0.0.0.4 25-Feb-96 ; 0.0.0.3 16-Sep-95 ; 0.0.0.3 15-Sep-95 ; 0.0.0.2 8-Nov-94 off equ 7c00h - 100h ; . 뢮 ᨬ १ ROM BIOS. chr1 macro sym ; Not worked in graph mode (registr bl - background color!) ; NO SAVED REGS !!! mov ax,0e00h+sym int 10h endm chr1 sayr macro str ; NO SAVE REGS !!! ; ப, 筠 ப say. 쪮 say ᯮ 㭪 9h ; , sayr - 㭪 BIOS (㭪 0eh 뢠 10h) ; ᪨ ० ࠡ⠥ mov si,offset str call sayr_proc endm sayr locals jumps .model tiny .code org 100h Begin: jmp short l db 90h ; '12345678' OEM db 'KERNEL',0,0 SectSiz dw 512 ClustSiz db 2 ResSecs dw 1 FatCnt db 2 RootSiz dw 112 TotSecs dw 720 Media db 0fdh FatSize dw 2 TrkSecs dw 9 HeadCnt dw 2 HidnSec dd 0 BigNo dd 0 ; Big total no of sectors dw 0 ; Physical drive no db 9 ; Extended boot signature ;dd 1 ; Volume serial no FATaddr dw 0 ; ! internal vars StartClu dw 0 ; ! Lbl db 'No_Kernel',0,0 ; Volume label db 'FAT12 ' ; File system ID RootSize dw ' '; use 2 last bytes of File system id OldVec dw 2 dup (0) l: ; Table 11 bytes - drive param push CS pop DS call saycsip sayr s1+off mov ax,FatSize+off call ohw sayr s2+off xor ax,ax mov ES,ax mov ax,word ptr ES:[13h*4+2] call ohw l0: jmp l0 saycsip proc ; REG SAVED push ax PUSHF sayr s0+off push CS pop ax call ohw chr1 ':' call l1 l1: pop ax PUSH BX mov bx,offset l1-Begin sub ax,bx call ohw POP BX sayr s_ax+off pop ax push ax call ohw sayr s_bx+off mov ax,bx call ohw sayr s_cx+off mov ax,cx call ohw sayr s_dx+off mov ax,dx call ohw sayr s_f+off POP ax ; flags (from stack) -> ax ; (see PUSHF) call ohw sayr s_si+off mov ax,si call ohw sayr s_di+off mov ax,di call ohw sayr s_ss+off mov ax,SS call ohw sayr s_sp+off mov ax,SP call ohw sayr s_ds+off mov ax,DS call ohw sayr s_es+off mov ax,ES call ohw sayr s_bp+off mov ax,BP call ohw pop ax ret s0 db 13,10,"Bg CS:IP=",0 s1 db " FatSize=",0 s2 db " int 13h =",0 s_ax db ' ax=',0 s_bx db ' bx=',0 s_cx db ' cx=',0 s_dx db ' dx=',0 s_si db ' si=',0 s_di db ' di=',0 s_ss db ' SS=',0 s_sp db ' SP=',0 s_ds db ' DS=',0 s_es db ' ES=',0 s_bp db ' BP=',0 s_f db ' Flags=',0 saycsip endp comment | ints proc ; Reg no saved !!! sayr s1+off mov cx,0ffh mov bp,0 l1: mov al,0ffh sub al,cl call ohb chr1 ' ' mov ax,[bp+2] call ohw chr1 ':' mov ax,[bp] call ohw chr1 13 chr1 10 add bp,4 test cx,0fh jnz l3 inkey2 l3: loop l1 ret s1 db 13,10,"ints",13,10,0 ints endp | comment | Int21 proc sayr Ver+off iret Int21 endp | comment | dump proc mov cx,520 xor si,si @@l: mov ax,byte ptr Begin-base[bp+si] call ohb inc si loop @@l ret dump endp | sayr_proc proc ; Ver 0.0.1 9-Dec-93 ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; NO REG SAVED !!! ; ᪨ ० ࠡ⠥ ; cld sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: ret sayr_proc endp ohw proc ; 뢮 ᫮ HEX-. 室: ᫮ ax. ; ॣ ࠭. ; 뢠 ணࠬ ohb push ax ; . ࠤ al. mov al,ah call ohb pop ax ; . al. call ohb ret ohw endp ohb proc ; Procedure output hex byte Ver 0.1.1 6 Dec 93 via BIOS ; Input: AL - byte ; All regs. reserved ;) ; Not worked in graph mode. bl - bg color !!! push ax push cx push dx mov dl,al mov cl,4 shr al,cl call ohb1 mov al,dl and al,0fh call ohb1 pop dx pop cx pop ax ret ohb endp ohb1 proc ; Regs not saved !!! push ax cmp al,9 ja @@_1 ; al > 9 ; al <= 9 add al,'0' jmp @@_out @@_1: add al,'A'-10 @@_out: mov ah,0eh int 10h pop ax ret ohb1 endp Buff label byte ; for 512 byte space end Begin src/boot/bootrw.asm0100664000076500007650000000760406455725712014103 0ustar prool2prool2; read/write boot/master boot sector modules for bp.c locals _TEXT segment byte public 'CODE' assume cs:_TEXT ; bootread0 (int dev, void far * buf) return 0 or ErrorCode _bootread0 proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 ; word ptr [bp+6] - argument 2 ... push bx push cx push dx push ES mov dx,word ptr [bp+4] mov bx,word ptr [bp+6] mov ES,word ptr [bp+8] mov cx,1 mov dh,0 mov ax,0201h ; Fn=02, Read 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _bootread0 endp public _bootread0 ; bootwrite (int dev, void far * buf) return 0 or ErrorCode _bootwrite proc near push bp mov bp,sp ; word ptr [bp+4] - argument 1 ; word ptr [bp+6] - argument 2 ... push bx push cx push dx push ES mov dx,word ptr [bp+4] mov bx,word ptr [bp+6] mov ES,word ptr [bp+8] mov cx,1 mov dh,0 mov ax,0301h ; Fn=03, Write 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _bootwrite endp public _bootwrite _ReadPhysSec proc ; int ReadPhysSec (unsigned char drive, unsigned char sec, unsigned char head, ; unsigned char trk /* or cyl */, char *Buffer); ; /* ; 2 bytes are combined to a word similar to INT 13: ; ; 76543210 1st byte (sector) ; Sector offset within cylinder ; High order bits of cylinder # ; ; 76543210 2nd byte (cylinder) ; Low order bits of cylinder # ; */ ; ALL REGS SAVED push bp mov bp,sp push bx push cx push dx push ES push DS pop ES mov dl,byte ptr [bp+ 4] ; drive mov cl,byte ptr [bp+ 6] ; sec mov dh,byte ptr [bp+ 8] ; head mov ch,byte ptr [bp+10] ; trk mov bx,word ptr [bp+12] ; Buffer mov ax,0201h; Fn=02, Read 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: ; mov ax,-1 @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _ReadPhysSec endp public _ReadPhysSec _WritePhysSec proc ; int WritePhysSec (unsigned char drive, unsigned char sec, unsigned char head, ; unsigned char trk, char *Buffer); ; ALL REGS SAVED push bp mov bp,sp push bx push cx push dx push ES push DS pop ES mov dl,byte ptr [bp+ 4] ; drive mov cl,byte ptr [bp+ 6] ; sec mov dh,byte ptr [bp+ 8] ; head mov ch,byte ptr [bp+10] ; trk mov bx,word ptr [bp+12] ; Buffer mov ax,0301h; Fn=03, Write 1 sector int 13h jc @@err xor ax,ax jmp @@ret @@err: ; mov ax,-1 @@ret: pop ES pop dx pop cx pop bx ; mov sp,bp pop bp ret _WritePhysSec endp public _WritePhysSec _TEXT ends end src/boot/makefile0100664000076500007650000000663407007540144013553 0ustar prool2prool2# OS Proolix. Boot record makefile. # Use Turbo C 2.0 make.exe for make Proolix kernel TasmFlags = /i..\..\..\proc /q /t /w2 /ml /z /m3 /l LinkFlag = /c/t/d/m/s/x # LinkFlag = /c/t/d/x TCFlag = -N- -K -C -mt -I..\include -DKERNEL # TCFlag = -K -C -mt -I..\include -DKERNEL -g1 -j1 # TCFlag = -K -C -O- -G- -Z- -d- -mt -r- -u+ -v- -y- CPPFlag = -I..\include TC = \tc # Proc = \usr\prool\proc Commands = ..\command Include = ..\include Kernel = ..\kernel .c.obj: tcc -c $(TCFlag) $& .asm.obj: tasm $(TasmFlags) $& .c.asm: tcc -c -S $(TCFlag) $& .c.i: cpp $(CPPFlag) $& all: bp.com boots.bin booth12.bin booth16.bin boots.bin: boots.obj tlink $(LinkFlag) boots,boots.bin booth12: booth12.bin bp.com bp -d4 -i -y booth12.bin booth16: booth16.bin bp.com bp -d4 -i -y booth16.bin boot: boots.bin bp.com bp -d0 -i -y boots.bin booth12.bin: booth12.obj tlink $(LinkFlag) booth12,booth12.bin booth16.bin: booth16.obj tlink $(LinkFlag) booth16,booth16.bin boots.obj: boots.asm booth12.obj: booth.asm fat12.asm tasm $(TasmFlags) /dFAT12 booth,booth12,booth12 booth16.obj: booth.asm fat16.asm tasm $(TasmFlags) /dFAT16 booth,booth16,booth16 bootrw.obj: bootrw.asm bp.com: bp.c $(Include)\struct.h $(Include)\limits.h bootrw.obj \ $(Kernel)\out_os.c $(Kernel)\out_mbr.c tcc -mt -lt bp.c bootrw.obj copy bp.com \bin herccomp: msherc.com msherc.bin comp msherc.bin msherc.com msherc.com: msherc.asm tasm $(TasmFlags) $& tlink /t/x msherc boot_p.bin: boot_p.obj tlink $(LinkFlag) boot_p,boot_p.bin csipboot: bootd.bin bp.com bp -da -i -y bootd.bin bootd.bin: bootd.obj tlink $(LinkFlag) bootd,bootd.bin i install: boot mbr.obj: mbr.asm mbr.com: mbr.obj bootcomp: mbr.com comp mbr.bin mbr.com boot360k.2nd: boot360k.asm tasm $(TasmFlag) -i\etc\sr boot360k tlink $(LinkFlag) boot360k,boot360k.2nd arh arj: pix_boot.arj arj f -jm pix_boot makefile arj f -r -t1g pix_boot *.c arj f -r -jm pix_boot save: a:\pix_boot.arj a:\proolix.arj a:\pix_boot.arj: pix_boot.arj copy pix_boot.arj a:\pix_boot.arj a:\proolix.arj: ..\proolix.arj copy ..\proolix.arj a:\proolix.arj ..\proolix.arj: pix_boot.arj arj f -r -jm -xfile_id.diz ..\proolix bak: del *.bak del *.map del *.tmp del *.lst del *.i del norton.ini clean: bak del *.obj del delete: clean pix_boot.arj arj f -jm pix_boot makefile arj f -r -jm -d -xmakefile pix_boot del tcpick.tcp test disktest: arj t a:\pix_boot.arj arj t a:\proolix.arj normalboot: boot360k bp -r -da boot360k reboot: hboot src/boot/boots.asm0100664000076500007650000003310506465111330013672 0ustar prool2prool2 PAGE ,79 jumps ; FDD Boot sector ver. 0.0.4.0 20-Apr-96 from Proolix operating system ; Copyright (C) Serge Pustovoitoff, 1993-1996 ; ⫠ 뢠 ᫥ 砭, ; ᤥ 猪 ਩ 檨 (bela@padco.kharkov.ua) ; History in stack order ; 0.0.4.0 20-Apr-96 㦠 䠩 /boot ᦠ pklite' ; 0.0.3.1 24-Mar-96 replace chr1 '.' -> char1 176 ; 0.0.3.1 12-Mar-96 PSPSeg = 3050h ; 0.0.3.0 25-Feb-96 PSPSeg = 1050h ; 0.0.3.0 10-Jan-96 - 㦠 /kernel, /boot (. 䠩 history, ; 0.0.1.4 10-Jan-96 ; 0.0.2.3 16-Sep-95 ; 0.0.2.2 15-Sep-95 - ࠧ⢫ FDD HDD ᥪ ; 0.0.2.1 25-Feb-95 - ⮣ ... (. ⠪ ; 䠩 kernel/history.doc ; 饭, 易 ⥬, ६ 樨 ; ᮬ 砫  100h, ६ ; 믮 7c00h off equ 7c00h-100h Drive equ 0 ; 㧮 A: (FDD 0) PSPSeg equ 3050h ; , 㤠 㤥 ; 㦥 /boot (筥, PSP) FATaddr equ Buff ; . 뢮 ᨬ १ ROM BIOS. chr1 macro sym ; Not worked in graph mode (registr bl - background color!) ; NO SAVE REGS !!! mov ax,0e00h+sym int 10h endm chr1 sayr macro str ; NO SAVE REGS !!! ; ப, 筠 ப say. 쪮 say ᯮ 㭪 9h ; , sayr - 㭪 ROM BIOS (㭪 0eh 뢠 10h) ; ᪨ ० ࠡ⠥ mov si,offset str call sayr_proc endm sayr locals .model tiny .code org 100h Begin: jmp short start ; ࠬ஢ ᪠ db 90h ; NOP ; '12345678' OEM db 'Proolix ' SectSiz dw 512 ClustSiz db 2 ResSecs dw 1 FatCnt db 2 RootSiz dw 112 TotSecs dw 720 Media db 0fdh FatSize dw 2 TrkSecs dw 9 HeadCnt dw 2 HidnSec dd 0 BigNo dd 0 ; Big total no of sectors db 0 ; Head No db 0h ; Physical drive no db 29h ; Extended boot signature ;dd 1 ; Volume serial no ;FATaddr label word ; ! dw 0 ; ! internal vars StartClu dw 0 ; ! Lbl db 'BOOT ' ; Volume label db 'FAT12 ' ; File system ID RootSize dw ' '; use 2 last bytes of File system id OldVec dw 2 dup (0) start: ; push CS ; pop DS ; sayr OEM+off ; 祭 ॣ஢ ᫥ 㧪 boot-ᥪ ; CS:IP = 0:7C00 SS=30 SP=F6 ES=0 ; 0:0 - 0:200 - ⠡ 뢠 ; ⥪: c 30:F6 (0:3F6) 0 (0:200-0:400 - ⥪) ; ROM BIOS area 0:400-0:500 ; cli ; 䨪 diskette param table ( MSDOS 6.0) ; 㦥 ᫥饩 䨪 ES: ? lds si,dword ptr ES:[78h] ; DS:si - vector diskette param table ; diskette param tble ; Bytes: ; 0 - bit 0-3 - SRT (step rate time), 4-7 head unload time ; 1 - bit 0: 1 if DMA, 2-7 head load time ; 2 - motor wait (in 55 ms) ; 3 - sec size (0 - 128, 1 - 256, 2 - 512, 3 - 1024) ; 4 - EOT (finish sector on track) ; 5 - interval length for ReadWrite ; 6 - DTL - Data Transfer Length (maximal) ; 7 - interval length for formatting ; 8 - Filler ; 9 - head settle time (in ms) ; a - motor start time (in 1/8 s) mov byte ptr [si+9],0Fh ; head settle := f mov cx,TrkSecs+off ; TrkSecs mov [si+6],cl ; Data Transfer Length ; sti mov dl,Drive xor ax,ax int 13h ; Disk dl=drive ah=func 00h ; reset disk, al=return status jc l_err push CS pop ES push CS pop DS ; ᫥ mov al,byte ptr FatCnt+off cbw mov cx,word ptr FatSize+off mul cx ; ax*cx -> dx:ax add ax,word ptr ResSecs+off ; ax - Root Beginning Sector mov word ptr StartClu+off,ax PUSH ax mov ax,word ptr RootSiz+off mov cx,32 mul cx mov cx,word ptr SectSiz+off div cx ; dx:ax / cx -> ax; mod -> dx or dx,dx ; ᫨ ⮪ 㫥, ਡ塞 jz l_ll ; ᥪ (᫥ ᥪ root') inc ax l_ll: ; ax - Root Size in Sectors add word ptr StartClu+off,ax mov cx,ax mov word ptr RootSize+off,ax POP ax ; ax - Root Bg Sec @@loop: ; 㧪 ୥ ⠫ ᥪ୮ ᥪ ; push cx push ax mov bx,offset Buff+off mov dl,Drive push ax call SecRead jc l_err pop ax ; push ax ; chr1 'R' ; pop ax mov cx,16 ; root entryes in 1 sector @@l: push cx mov cx,11 mov di,bx mov si,offset Lbl+off rep cmpsb je l_found pop cx add bx,32 loop @@l pop ax inc ax pop cx loop @@loop ; end of load root dir ; H H l_err: ; chr1 'E' call ohw xor ah,ah int 16h int 19h ;Vis: jmp short Vis sayr_proc proc ; Ver 0.0.1 9-Dec-93 ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; NO REG SAVED !!! ; ᪨ ० ࠡ⠥ ; cld sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: ret sayr_proc endp l_found: ; H ! pop cx ; Found kernel ; bx - kernel dir record ; word ptr [bx+1ah] - 1st cluster mov ax,word ptr [bx+1ah] ; ax - 1st cluster ; 㧪 FAT PUSH ax ; save ax with 1st clu no mov ax,word ptr ResSecs+off mov bx,offset FATaddr+off mov cx,word ptr FatSize+off ; 㧪 ୮ ( 楯窥 FAT) ; 㧪 FAT @@l: mov dl,Drive push ax call SecRead jc l_err pop ax add bx,512 inc ax ; Next sector! ; push ax ; chr1 'F' ; pop ax loop @@l mov al,byte ptr ClustSiz+off cbw mov dx,word ptr SectSiz+off mul dx mov cx,ax ; Cluster Size in Bytes POP ax ; restore ax (1st clu no) mov bx,PSPSeg mov ES,bx mov bx,100h l2: mov dl,Drive call CluRead push ax chr1 176 pop ax add bx,cx call NextClu ; set ax jnc l2 ; EXEC! ; mov ax,PSPSeg ; mov DS,ax ; mov ES,ax ; cli ; mov SS,ax ; mov SP,0fffeh ; sti ; sayr OEM+off ; *(int far *)MK_FP(PSP,2)=0x9FFF; /* LZEXE */ mov ax,PSPSeg mov DS,ax cli mov SS,ax mov SP,0fffeh sti ; mov ES,ax ; mov word ptr ES:[2],9FFFh db 0eah ; JMP PSPSeg:100 dw 100h,PSPSeg NextClu proc ; Input: ax - cluster no ; Output: ax - next cluster from FAT ; cf=1 if EOF ; Use global var: ; FATaddr dw 0 ; REGS SAVED ! push bx push cx push dx push si push di mov di,ax mov bx,3 mul bx ; dx:ax := ax * bx shr ax,1 ; ax := ax /2 ; ax - addr in FAT mov si,ax mov bx,offset FATaddr+off mov ax,word ptr [bx+si] test di,1 jz @@1 mov cl,4 shr ax,cl jmp @@2 @@1: and ax,0fffh @@2: ; cmp ax,0fffh ; je @@cf ; cmp ax,0ff7h ; je @@cf cmp ax,word ptr TotSecs+off ja @@cf clc @@ret: pop di pop si pop dx pop cx pop bx ret @@cf: stc jmp @@ret NextClu endp SecRead proc ; ver 0.0.1 3-Nov-94 (for FDD boot) ; Read absolute sectors ; Input: ax - abs sec number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; DS - data segment reg ; Use global variables: ; word ptr HeadCnt+off ; word ptr TrkSecs+off ; Output: cf=1 if error ; NO ALL REGS SAVED !!! ; push ax push bx push cx push dx push si push di mov si,bx ; save bx & dx mov di,dx PUSH ax mov ax,word ptr HeadCnt+off mov cx,word ptr TrkSecs+off mul cx ; dx:ax := HeadCnt * TrkSecs mov bx,ax ; bx = HeadCnt * TrkSecs POP ax xor dx,dx ; dx:ax - Abs Sec No div bx ; ax=Track=AbsSec/(HeadCnt*TrkSecs); dx - mod (Sec on Cyl) mov bx,ax ; bx - track no mov ax,dx xor dx,dx ; dx:ax - module (Sec on Cyl) div cx ; Head=[dx:ax]/TrkSecs;ax - Head; mod (dx) - Sec on Head-1 inc dx ; dx - Sec on Head mov cx,5 l_loop: push cx mov cl,dl ; sector mov ch,bl ; track ; Warning: track < 255 !!! mov bx,si ; Restore bx - offset for buff mov dx,di ; Restore dl - drive no mov dh,al ; head mov ax,0201h; Fn=02, Read 1 sector int 13h jnc l_break pop cx loop l_loop jmp short l_ret l_break: pop cx l_ret: pop di pop si pop dx pop cx pop bx ; pop ax ret SecRead endp CluRead proc ; Read cluster ; Input: ax - cluster number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; DS - data segment reg ; Use global variables: ; StartClu dw 0 ; Number sector of 1st cluster ; ClustSiz db 2 ; SectSiz dw ; ALL REGS SAVED !!! push ax push bx push cx ; Sector = StartClu + ((Clu-2) * ClustSiz) PUSH bx PUSH dx dec ax ; ax:=ax-2 dec ax ; mov bx,ax mov al,byte ptr ClustSiz+off cbw mov cx,ax mul bx add ax,word ptr StartClu+off ; ax - sector POP dx ; Restore dl POP bx ; cx - ClustSiz @@l: push ax call SecRead jc l_err pop ax add bx,word ptr SectSiz+off inc ax loop @@l pop cx pop bx pop ax ret CluRead endp ohw proc ; 뢮 ᫮ HEX-. 室: ᫮ ax. ; ॣ ࠭. ; 뢠 ணࠬ ohb push ax ; . ࠤ al. mov al,ah call ohb pop ax ; . al. call ohb ret ohw endp ohb proc ; Procedure output hex byte Ver 0.1.1 6 Dec 93 via BIOS ; Input: AL - byte ; All regs. reserved ;) ; Not worked in graph mode. bl - bg color !!! push ax push cx push dx mov dl,al mov cl,4 shr al,cl call ohb1 mov al,dl and al,0fh call ohb1 pop dx pop cx pop ax ret ohb endp ohb1 proc ; Regs not saved !!! push ax cmp al,9 ja @@_1 ; al > 9 ; al <= 9 add al,'0' jmp @@_out @@_1: add al,'A'-10 @@_out: mov ah,0eh int 10h pop ax ret ohb1 endp Buff label byte end Begin src/boot/files.bbs0100664000076500007650000000003006451504224013626 0ustar prool2prool2BOOTRW.ASM bootread0() src/boot/fat16.asm0100664000076500007650000000145706465172730013505 0ustar prool2prool2; for FAT-16 NextClu proc ; Input: ax - cluster no ; Output: ax - next cluster from FAT ; cf=1 if EOF ; REGS SAVED ! push bx push dx push ES mov bx,2 mul bx ; dx:ax := ax * bx ; dx:ax - relative address in FAT add dx,FATseg ; dx:ax - absolute address in FAT mov ES,dx mov bx,ax mov ax,word ptr ES:[bx] ; cmp ax,0fffh ; je @@cf ; cmp ax,0ff7h ; je @@cf cmp ax,word ptr MaxClusters+off ja @@cf clc @@ret: pop ES pop dx pop bx ret @@cf: stc jmp @@ret NextClu endp src/boot/booth16.bin0100664000076500007650000000074307007540152014021 0ustar prool2prool2HProolix +2)BOOT FAT16 |&||||F|H|'|)| |"|||+)|'| |2@6|| t@)|)|ȡF|H|}QPRrQ +|tY ZXY@ָEG%||||3ۋ|rՌƃ @ | |ȡ%|`03FsP0؎мP0PSQRSHHؠ |)|'|[5ss@ZY[XSR‹&;6|wZ[PQR6|ˆB|36|C|D| QD| 6B|ʆ鲀6C|sYZYXYsrc/boot/booth.asm0100664000076500007650000002410506466160236013671 0ustar prool2prool2 PAGE ,79 jumps ; HDD Boot sector ver. 0.0.0.0 2-Feb-98 from Proolix operating system ; ⫠ 뢠 ᫥ 砭, ; ᤥ 猪 ਩ 檨, bela@interfax.kharkov.ua off equ 7C00h-100h ; 饭, 易 ⥬, ६ 樨 ; ᮬ 砫  100h, ६ ; 믮 7C00 PSPSeg equ 3050h ; , 㤠 㤥 ; 㦥 ⬥ ; (筥, PSP) FATseg equ 7E0h ; . 뢮 ᨬ १ ROM BIOS. chr macro sym ; Not worked in graph mode (registr bl - background color!) ; NO SAVED REGS !!! mov ax,0e00h+sym int 10h endm chr locals .model tiny .code org 100h Begin: jmp start ; ࠬ஢ ᪠ db 90h ; NOP ; '12345678' OEM db 'Proolix ' SectSiz dw 512 ClustSiz db 4 ResSecs dw 1 FatCnt db 2 RootSiz dw 512 TotSecs dw 0 Media db 0f8h FatSize dw 43 TrkSecs dw 50 HeadCnt dw 2 HidnSec dd 40200 BigNo dd 0 ; Big total no of sectors db 0 ; Head No FirstClu label word DriveNo_ db 80h ; Physical drive no db 29h ; Extended boot signature StartCluHi dw 0 ; dd Volume serial no StartCluLo dw 0 Lbl db 'BOOT ' ; Volume label MaxClusters label word db 'FAT16 ' ; File system ID RootSize dw ' '; use 2 last bytes of File system id OldVec dw 2 dup (0) Sector_ db 0 HeadNo db 0 TrackNo_ dw 0 RootSectLow dw 0 RootSectHi dw 0 start: ; 祭 ॣ஢ ᫥ 㧪 boot-ᥪ ; CS:IP = 0:7C00 SS=30 SP=F6 ES=0 ; 0:0 - 0:200 - ⠡ 뢠 ; ⥪: c 30:F6 (0:3F6) 0 (0:200-0:400 - ⥪) ; ROM BIOS area 0:400-0:500 ; mov dl,80h ; int 13h ; Disk dl=drive ah=func 00h ; ; reset disk, al=return status ; jc l_err loc_3: push CS pop DS push CS pop ES ; chr '0' ; ᫥ mov al,byte ptr FatCnt+off cbw mul word ptr FatSize+off ; FatCnt * FatSize -> dx:ax add ax,word ptr HidnSec+off ; low adc dx,word ptr HidnSec+2+off ; high add ax,word ptr ResSecs+off adc dx,0 ; dx:ax - Root 1st Sector mov RootSectLow+off,ax mov RootSectHi+off,dx ; ࠭塞 ; 쥬 ᥪ=(RootSiz*32)/512=RootSiz/16; mov word ptr StartCluHi+off,dx mov word ptr StartCluLo+off,ax ; MaxClusters=(unsigned int)((MaxSectors-DataStart)/CluSize+1); mov ax,word ptr BigNo+off mov dx,word ptr BigNo+2+off add ax,word ptr HidnSec+off ; low adc dx,word ptr HidnSec+2+off ; high sub ax,word ptr StartCluLo+off sbb dx,word ptr StartCluHi+off mov cl,ClustSiz+off xor ch,ch div cx inc ax mov MaxClusters+off,ax mov ax,word ptr RootSiz+off ; dx:ax - ꥬ cwd mov cx,16 div cx ; ax <- ꥬ ᥪ ; dx <- ⮪ or dx,dx ; ᫥ ᥪ jz l_zero inc ax l_zero: ; ax - ꥬ ᥪ add word ptr StartCluLo+off,ax adc word ptr StartCluLo+off,0 ; 㧪 ୥ ⠫ ᥪ୮ ᥪ ; mov cx,ax ; - ꥬ ᥪ mov ax,RootSectLow+off mov dx,RootSectHi+off l_loop_1: mov bx,offset Buff+off push cx push ax push dx call ReadSector ; read sector (dx:ax)-> ES:bx jc l_err ; ୥ mov cx,16 ; root entryes in 1 sector @@l: push cx mov cx,11 mov di,bx mov si,offset Lbl+off rep cmpsb je l_found pop cx add bx,32 loop @@l pop dx pop ax pop cx inc ax adc dx,0 loop l_loop_1 l_err: chr 'E' Vis: jmp short Vis l_found: ; H ! ; chr 'O' ; Found kernel ; bx - kernel dir record ; word ptr [bx+1ah] - 1st cluster mov ax,word ptr [bx+1ah] ; ax - 1st cluster mov FirstClu+off,ax mov ax,word ptr HidnSec+off mov dx,word ptr HidnSec+2+off add ax,word ptr ResSecs+off adc dx,0 ; dx:ax - 1st FAT sector mov bx,FATseg mov ES,bx ; ES=FATseg xor bx,bx mov cx,word ptr FatSize+off ; 㧪 ୮ ( 楯窥 FAT) ; 㧪 FAT @@l: call ReadSector ; read sec dx:ax -> ES:bx jc l_err mov si,ES add si,20h mov ES,si ; ES+=20h inc ax ; Next sector! adc dx,0 loop @@l mov al,byte ptr ClustSiz+off cbw mov dx,word ptr SectSiz+off mul dx mov cx,ax ; Cluster Size in Bytes mov ax,FirstClu+off mov bx,PSPSeg+10h mov ES,bx ; ES=PSPSeg+10h xor bx,bx l2: call CluRead ; push ax ; chr '.' ; pop ax add bx,cx call NextClu ; set ax jnc l2 ; chr 'X' ; EXEC! ; *(int far *)MK_FP(PSP,2)=0x9FFF; /* LZEXE */ mov ax,PSPSeg mov DS,ax mov ES,ax cli mov SS,ax mov SP,0fffeh sti db 0eah ; JMP PSPSeg:100 dw 100h,PSPSeg CluRead proc ; Read cluster ; Input: ax - cluster number ; ES:bx - buffer ; DS - data segment reg ; Use global variables: ; StartCluHi:StartCluLo - Number sector of 1st cluster ; ClustSiz db 2 ; SectSiz dw ; ALL REGS SAVED !!! push ax push bx push cx push dx ; Sector = StartClu + ((Clu-2) * ClustSiz) PUSH bx dec ax ; ax:=ax-2 dec ax ; mov bx,ax mov al,byte ptr ClustSiz+off cbw mov cx,ax mul bx add ax,word ptr StartCluLo+off adc dx,word ptr StartCluHi+off POP bx ; dx:ax - sector @@lll: call ReadSector jc l_err inc ax adc dx,0 add bx,512 loop @@lll pop dx pop cx pop bx pop ax ret CluRead endp ifdef FAT12 include fat12.asm else include fat16.asm endif ; ; ⠥ 1 ᥪ dx:ax es:bx. CF, ᫨ 訡. ReadSector proc near push ax push cx push dx ; ७ ६ Sector_, HeadNo TrackNo_ 祭ﬨ, ; ᮮ⢥騬 . ᥪ dx:ax. div word ptr TrkSecs+off ; dx:ax / TrkSecs -> (dx,ax) inc dl ; dl - # ᥪ mov Sector_+off,dl xor dx,dx ; dx=0 div word ptr HeadCnt+off mov HeadNo+off,dl ; # ஭ mov TrackNo_+off,ax ; # ஦ mov cx,10 @@loop: PUSH CX mov dx,TrackNo_+off ; dx=TrackNo_ mov cl,6 ; cl=6 shl dh,cl ; dh=tt000000 B or dh,Sector_+off ; dh=ttssssss B mov cx,dx ; cx=ttsssssstttttttt xchg ch,cl ; cx=ttttttttttssssss mov dl,80h ; drive mov dh,HeadNo+off mov ax,0201h int 13h ; read sectors to memory es:bx ; al=#,ch=cyl,cl=sectr,dh=head jnc @@ok POP CX loop @@loop stc @@ret: pop dx pop cx pop ax retn @@ok: POP CX jmp @@ret ReadSector endp ; Buff label byte end Begin src/boot/boot0.asm0100664000076500007650000003420006075037234013573 0ustar prool2prool2 PAGE ,79 ; Boot sector ver. 0.0.0.8 7-Nov-94 from Proolix operating system ; Copyright (C) Serge Pustovoitoff, 1993, 1994 off equ 7c00h - 100h Drive equ 0 ModifyParams equ 'Yes' PSPSeg equ 50h ; 70h LoadAddr equ (PSPSeg shl 4)+100h include macros.asm sayr macro str ; NO SAVE REGS !!! ; ப, 筠 ப say. 쪮 say ᯮ 㭪 9h ; , sayr - 㭪 BIOS (㭪 0eh 뢠 10h) ; ᪨ ० ࠡ⠥ mov si,offset str call sayr_proc endm sayr locals jumps .model tiny .code org 100h Begin: jmp short l db 90h ; '12345678' OEM db 'KERNEL',0,0 SectSiz dw 512 ClustSiz db 2 ResSecs dw 1 FatCnt db 2 RootSiz dw 112 TotSecs dw 720 Media db 0fdh FatSize dw 2 TrkSecs dw 9 HeadCnt dw 2 HidnSec dd 0 BigNo dd 0 ; Big total no of sectors dw 0 ; Physical drive no db 9 ; Extended boot signature ;dd 1 ; Volume serial no FATaddr dw 0 ; ! internal vars StartClu dw 0 ; ! Lbl db 'No_Kernel',0,0 ; Volume label db 'FAT12 ' ; File system ID RootSize dw ' '; use 2 last bytes of File system id OldVec dw 2 dup (0) l: ; Table 11 bytes - drive param cli xor ax,ax mov es,ax ifdef ModifyParams mov bx,78h ; 㤥 ⠡ 11 lds si,dword ptr es:[bx] ; ds:si - vector diskette param mov word ptr OldVec+off,si mov word ptr OldVec+off+2,ds ; push ds ; push si ; push ss ; push bx mov di,offset l+off mov cx,0Bh cld rep movsb ;11 bytes from diskette param tble to begin of pgm ; Bytes: ; 0 - bit 0-3 - SRT (step rate time), 4-7 head unload time ; 1 - bit 0: 1 if DMA, 2-7 head load time ; 2 - motor wait (in 55 ms) ; 3 - sec size (0 - 128, 1 - 256, 2 - 512, 3 - 1024) ; 4 - EOT (finish sector on track) ; 5 - interval length for ReadWrite ; 6 - DTL - Data Transfer Length (maximal) ; 7 - interval length for formatting ; 8 - Filler ; 9 - head settle time (in ms) ; a - motor start time (in 1/8 s) push es pop ds mov byte ptr [di-2],0Fh ; head settle := f mov cx,ds:TrkSecs+off ; TrkSecs mov [di-7],cl ; Data Transfer Length mov [bx+2],ax mov word ptr [bx],offset l+off ; new diskette table endif sti mov dl,Drive int 13h ; Disk dl=drive ah=func 00h ; reset disk, al=return status comment | jc l_err xor ax,ax cmp TotSecs+off,ax ; TotSecs cmp with 0 je loc_3 mov cx,TotSecs+off ; TotSecs mov word ptr BigNo+off,cx ; Big total no of sec | loc_3: sayr Ident+off mov al,byte ptr FatCnt+off cbw mov cx,word ptr FatSize+off mul cx ; ax*cx -> dx:ax add ax,word ptr ResSecs+off ; ax - Root Beginning Sector mov word ptr StartClu+off,ax PUSH ax mov ax,word ptr RootSiz+off mov cx,32 mul cx mov cx,word ptr SectSiz+off div cx ; dx:ax / cx -> ax; mod -> dx ; ax - Root Size in Sectors add word ptr StartClu+off,ax mov cx,ax mov word ptr RootSize+off,ax POP ax ; ax - Root Bg Sec @@loop: ; load root directory push cx push ax mov bx,offset Buff+off mov dl,Drive call SecRead jc l_err ; chr1 '#' mov cx,16 ; root entryes in 1 sector @@l: push cx mov cx,6 mov si,bx mov di,offset OEM+off rep cmpsb je l_found pop cx add bx,32 loop @@l pop ax inc ax pop cx loop @@loop ; end of load root dir ; inkey2 l_err: sayr Lbl+off @@ll: jmp short @@ll ; include ohb1.asm ; include ohw.asm l_found: pop cx ;sayr Ver+off ; Found kernel ; bx - kernel dir record ; word ptr [bx+1ah] - 1st cluster mov ax,word ptr [bx+1ah] ; ax - 1st cluster ;LoadFAT PUSH ax ; save ax with 1st clu no mov bx,offset Buff+off mov ax,word ptr RootSize+off mov cx,word ptr SectSiz+off mul cx ; ax - RootSize in bytes add bx,ax ; Addr buf for FAT mov word ptr FATaddr+off,bx mov ax,word ptr ResSecs+off mov cx,word ptr FatSize+off @@l: mov dl,Drive call SecRead jc l_err add bx,512 loop @@l mov al,byte ptr ClustSiz+off cbw mov dx,word ptr SectSiz+off mul dx mov cx,ax ; Cluster Size in Bytes POP ax ; restore ax (1st clu no) mov bx,LoadAddr l2: mov dl,Drive call CluRead add bx,cx cmp bx,off jae l3 call NextClu ; set ax jnc l2 ; EXEC! ; mov ax,PSPSeg ; mov DS,ax ; mov ES,ax ; cli ; mov SS,ax ; mov SP,0fffeh ; sti db 0eah ; JMP PSPSeg:100 dw 100h,PSPSeg l3: sayr L_err+off l4: jmp l4 ;ssize db 'SIZE',0 NextClu proc ; Input: ax - cluster no ; Output: ax - next cluster from FAT ; cf=1 if EOF ; Use global var: ; FATaddr dw 0 ; REGS SAVED ! push bx push cx push dx push si push di mov di,ax mov bx,3 mul bx ; dx:ax := ax * bx shr ax,1 ; ax := ax /2 ; ax - addr in FAT mov si,ax mov bx,word ptr FATaddr+off mov ax,word ptr [bx+si] test di,1 jz @@1 mov cl,4 shr ax,cl jmp @@2 @@1: and ax,0fffh @@2: ; cmp ax,0fffh ; je @@cf ; cmp ax,0ff7h ; je @@cf cmp ax,word ptr TotSecs+off ja @@cf clc @@ret: pop di pop si pop dx pop cx pop bx ret @@cf: stc jmp @@ret NextClu endp SecRead proc ; ver 0.0.1 3-Nov-94 (for boot) ; Read absolute sectors ; Input: ax - abs sec number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; BP - autobase register ; DS - data segment reg ; Use global variables (based on BP!): ; word ptr HeadCnt+off ; word ptr TrkSecs+off ; Output: cf=1 if error ; ALL REGS SAVED !!! push ax push cx push dx push si push di mov si,bx ; save bx & dx mov di,dx PUSH ax mov ax,word ptr HeadCnt+off mov cx,word ptr TrkSecs+off mul cx ; dx:ax := HeadCnt * TrkSecs mov bx,ax POP ax xor dx,dx ; dx:ax - Abs Sec No div bx ; ax - Trk; dx - mod mov bx,ax ; bx - track no mov ax,dx xor dx,dx ; dx:ax - module div cx ; dx:ax / TrkSecs; ax - Head; dx - Sec on Head-1 inc dx ; dx - Sec on Head mov cx,5 l_loop: push cx mov cl,dl ; sector mov ch,bl ; track ; Warning: track < 255 !!! mov bx,si ; Restore dl - drive no mov dx,di ; Restore bx - offset for buff mov dh,al ; head mov ax,0201h; Fn=02, Read 1 sector int 13h jnc l_break pop cx loop l_loop jmp short l_ret l_break: pop cx l_ret: pop di pop si pop dx pop cx pop ax ret SecRead endp CluRead proc ; Read cluster ; Input: ax - cluster number ; dl - drive (for int 13h Fn=2) ; ES:bx - buffer ; BP - autobase register ; DS - data segment reg ; Use global variables (based on BP!): ; StartClu dw 0 ; Number sector of 1st cluster ; ClustSiz db 2 ; SectSiz dw ; ALL REGS SAVED !!! push ax push bx push cx push bx mov bl,1 chr1 '#' pop bx ; Sector = StartClu + ((Clu-2) * ClustSiz) PUSH bx PUSH dx sub ax,2 mov bx,ax mov al,byte ptr ClustSiz+off cbw mov cx,ax mul bx add ax,word ptr StartClu+off ; ax - sector POP dx ; Restore dl POP bx ; cx - ClustSiz @@l: call SecRead jc l_err add bx,word ptr SectSiz+off inc ax loop @@l pop cx pop bx pop ax ret CluRead endp comment | reada1 proc ; Regs no save !!! xor ax,ax xor dl,dl mov bx,offset Buff+off call SecRead jc l_err sayr Buff-base+3[bp] ret reada1 endp | comment | reada proc ; Reg no save !!! mov ah,2 ; Fn read mov al,1 ; num sec mov dl,Drive ; drive mov dh,0 ; head mov cx,1 ; cyl/sec mov bx,offset Buff+off int 13h jc l_err sayr Buff-base+3[bp] ret reada endp | comment | saycsip proc ; REG SAVED push ax sayr s0+off push CS pop ax call ohw chr1 ':' mov ax,Begin+off call ohw ; sayr s_ax+off ; pop ax ; push ax ; call ohw ; sayr s_bx+off ; mov ax,bx ; call ohw ; sayr s_cx+off ; mov ax,cx ; call ohw ; sayr s_dx+off ; mov ax,dx ; call ohw ; sayr s_si+off ; mov ax,si ; call ohw ; sayr s_di+off ; mov ax,di ; call ohw sayr s_ss+off mov ax,SS call ohw sayr s_sp+off mov ax,SP call ohw sayr s_ds+off mov ax,DS call ohw sayr s_es+off mov ax,ES call ohw ; sayr s_bp+off ; mov ax,BP ; call ohw pop ax ret s0 db 13,10,"Bg CS:IP=",0 ;s_ax db ' ax=',0 ;s_bx db ' bx=',0 ;s_cx db ' cx=',0 ;s_dx db ' dx=',0 ;s_si db ' si=',0 ;s_di db ' di=',0 s_SS db ' SS=',0 s_SP db ' SP=',0 s_DS db ' DS=',0 s_ES db ' ES=',0 ;s_bp db ' BP=',0 saycsip endp | comment | ints proc ; Reg no saved !!! sayr s1+off mov cx,0ffh mov bp,0 l1: mov al,0ffh sub al,cl call ohb chr1 ' ' mov ax,[bp+2] call ohw chr1 ':' mov ax,[bp] call ohw chr1 13 chr1 10 add bp,4 test cx,0fh jnz l3 inkey2 l3: loop l1 ret s1 db 13,10,"ints",13,10,0 ints endp | comment | Int21 proc sayr Ver+off iret Int21 endp | comment | dump proc mov cx,520 xor si,si @@l: mov ax,byte ptr Begin-base[bp+si] call ohb inc si loop @@l ret dump endp | sayr_proc proc ; Ver 0.0.1 9-Dec-93 ; 楤 뢮 ப 㭪権 BIOS ; 室: DS:SI - ASCIIZ ப. ; NO REG SAVED !!! ; ᪨ ० ࠡ⠥ ; cld sayr_l1: lodsb or al,al jz sayr_ret mov ah,0eh int 10h jmp short sayr_l1 sayr_ret: ret sayr_proc endp Ident db 'PILO',0 ;Ident db 'Proolix by Prool. Load ',0 L_err db 'Error',0 Buff label byte ; for 512 byte space end Begin  src/boot/bp.com0100664000076500007650000004006407007540166013153 0ustar prool2prool2.0!.,ڣ333.333>3Njع&=87u&U=u3Yu3aC&8uր̀ى33+>>s>>njFr(>>r"G;r>>t>>u;wډ+3/33+؎JW!_ҋ3.4AF+&A3!3*A636 36 3Pf.[(ALF!25!225!235!335!3 3%ʎں6!%2!%2!%3!%3!3ô@!ù2.PJU9&%3rz+F=v.)5AMYeq} 1%O11=IU{ammmmmy !---9DO{Z{ep{&4P.4P64P>4PuF4Pi~N4P]rV4PQff4PEZn4P9Nv4P-B~4P!64P*4P 4P4P4P4P4P4P4P4P4P4P4P5Py5Pm5Pav&5PUj.5PI^65P=RF5P1FN5P%:V5P.^5P "f5Pn5P 4P4Pv5P~5P^4P5P5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|Av >At3AA>AtRPAP/ u U u3A>AuAA A AAAA]ðP6 A6 A6A6APQ A6 AUFFF^FF-=w?.++++++++v A;F}Ng AF]FX>Au.>At'&AFFF@PF@PRPFPPVvJAF 9FA;F} AFFA;F}P6 A6 A6A6AP<NFN t VvF]Ud+P3PvFP[]À>$At $A%A!V>$At PY^U>$At $AF%A]UVWvvvv g u3/~+~Gvv vVRPWF F;v ~_^]UVW~+~GvvV^RPv WF F;v ~_^]Àsـ ˀ3UVWvvVvv  t v vF+FF PF +FP u3\vF FF;v}F FvF~'v +FPRPvWRPF+F@P~FF;uϸ_^]Stack overflow! $ȎغM. !UFPP3P]U.A ^FFF;F~]U>At8>Au.~t%F F FF~tF PF PFPFPF @PF P `PFPF PFPF P `PF PFPB`PFPFPFPF P F @PF PFHPFPF PF P `PF PF PF PF PS `PF PFP`PF PFPF PF Pk >AfFn N vV^] UVvƊA3FFA*ЈVfF^]U^^;t ^Š:ArƲ^]U VWljFF ;Au3F t v v \FF;Au3F t vv9FQ~tFPFPct ^&7F~tFPFP=Ɗܹ G ^ &7F FN u׷(_^] U>Au>Atv v vvvv v vvv] UAȠAЋF ;w*F;w#F ;FF;wF;w F;F3]UFHAAVJA]UVWAFN[~ v;s H~u<;trs rsrsë_^]  A+@ A+@Turbo-C - Copyright (c) 1988 Borland Intl.Divide error Abnormal program termination FFFCnone FAT-12 XENIX /XENIX uFAT-16 EXTEND LARGE HPFS/NTOS2 AIXAIX OS2 CohFAT-32 FAT32LBVFATLBAEXTENDLOPUS OS/2 Compaq WinSwapPhoton Hiden95Willow reserv NEC Theos PQMagicVENIX Linux LinuxSwOnTrackNOVEL CP/M EZ GoldenBPriam SpeedStSysV386Novell DiskSecPC/IX QNX Minix LinuxExWinNT Amoeba Phoenix386BSD NEXT BSDI CTOS DR DOS Syrinx CP/M-86DOS r/oStorageDOS secLANstepXENIX unkn %02X System ----Begin--- ----End----- Preceding sec Total sec Size,Mb head sec cyl head sec cyl (%02X) %4i %2i %4i %10lu %10lu %4i master bootBoot Processor 0.1.6 2-Nov-99 (C) 1993-1999, S.Pustovoitoff usage: bp -d [filename] [-r] [-i] [-a] [-y] -r - reverse copy (file->boot/master boot sector), DEFAULT (without '-r') - boot/master boot sector->file -i - install file to boot/master boot sector, BPB and partition table not change! -d - drive: @ - master boot record of 1st HDD Boot records: 0 - drive 0 (floppy drive A:) 1 - drive 1 (floppy drive B:) 2 - drive 2 (1st partition of 1st HDD) ... -a - set active partition (for extended partition only) -y - assume 'y' on all queries Dev Head Sec Trk/cyl Partition ------------------------------- %1i floppy drive%3i %3i (%02X) %c: FAT-12 FAT-16 no FATJump command %02X %02X %02X OEM name %-8s OEM name %02X Sector size %4i bytes Cluster size %1i sect Reserved sectors (before 1st FAT) %2i FAT counter %1i Root directory entries %4i Total sectors %7u Media descr %02X FAT size %5i sect Track size %2i sec Heads %2i Hidden sectors %7li Big Number Of Sectors %7li Physical Drive No %02X Extended Boot Signature %02X Volume Serial No %04X-%04X Volume Label (in boot) File system Id Disk size %li Mb Disk size %li Kb boot: extend boot sector read error test_devices: MBR read error Invalid switch/dev/nulDisk read error Boot image open error in file %s Boot image read error Read %i bytes or more Not enough memory in boot sector Warning! Last 1-2 bytes lost! File %s -> %s sector %i: Overwrite %s sector (y/n) ? YN File %s -> %s sector %i: ! Disk write error %s sector %i: -> file %s Boot image open/creat error in file %s Boot image write error Boot image close error ### > ??C$?B4?D?T?d?t?????????@@$@   @print scanf : floating point formats not linked (null)0123456789ABCDEF       COMPAQt*!!!!src/command/0040775000076500007650000000000007725636522012535 5ustar prool2prool2src/command/font0100664000076500007650000000050506341510760013407 0ustar prool2prool2ޭP3ء t9<u0<u7 <uߺ>GPRpE@uPY. H3PSV6EH t$;u+uݸ>G3Ҋ!6EDDø(̈́ø$&Font loader for EGA & VGA Ver 0.0 (c) 1997 G.ShepelevIncorrect videomode!Disk error!Font installed08.fnt14.fnt16.fntsrc/command/p10100664000076500007650000000071706761506564013003 0ustar prool2prool2ޭX. VWu PYY6 tPPwY3GF0u|cP]Y3GF0u|_^Pip=X:X ds=XV4^XPV9^V>^VC^VH^~VM^qVRu^dVWh^TVaX^GVfK^:X ax= bx= cx= dx= si= di= SS= SP= DS= ES= BP=PXPV t^XPQRб $ZYXP< w07Ẍ́ø̈́ø̈́fork errorsrc/command/p1.c0100664000076500007650000000073306663374046013221 0ustar prool2prool2#include #include #include void saycsip(void); void main (void) {int i=0xAAAA,j=0xBBBB; j=fork(); if (j==-1) puts("fork error"); else if (j) { /* parent */ while (1) { putch('P'); for (i=0;i<30000;i++) j++; /* L: goto L; */ } } else { /* child */ while (1) { putch('c'); for (i=0;i<30000;i++) j++; /* L1: goto L1; */ } } } src/command/banner.c0100664000076500007650000001755606312106762014146 0ustar prool2prool2/* banner - print a banner Author: Brian Wallis */ /***************************************************************** * * SYSVbanner.c * * This is a PD version of the SYS V banner program (at least I think * it is compatible to SYS V) which I wrote to use with the clock * program written by: ** DCF, Inc. ** 14623 North 49th Place ** Scottsdale, AZ 85254 * and published in the net comp.sources.misc newsgroup in early July * since the BSD banner program works quite differently. * * There is no copyright or responsibility accepted for the use * of this software. * * Brian Wallis, brw@jim.odr.oz, 4 July 1988 * *****************************************************************/ #include #include /* Make under MSDOS tcc -DMSDOS -mt -lt banner.c Serge Pustovoitoff, prool@infocom.kharkov.ua, 13-03-97. 23:29:45 */ #if defined(MSDOS) || defined (Proolix) int main (int argc, char **argv); #else _PROTOTYPE(int main, (int argc, char **argv)); #endif char *glyphs[] = { " @@@ @@ @@ @ @ @@@@@ @@ @@@ ", " @@@ @@ @@ @ @ @ @ @@@ @ @ @ @@@ ", " @@@ @ @ @@@@@@@@ @ @@ @ @@ @ ", " @ @ @ @@@@@ @ @@@ @ ", " @@@@@@@ @ @ @ @ @ @ ", " @@@ @ @ @ @ @ @ @@ @ @ ", " @@@ @ @ @@@@@ @ @@ @@@@ @ ", " @@ @@ @", " @ @ @ @ @ @ ", " @ @ @ @ @ @ ", " @ @ @@@@@@@ @@@@@ @@@ @@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@ @ @ @ ", " @@ @ @ @ @ @ @ @ @ @", " @ @ @ @ @ @ @ @ @ @ ", " @ @ @ @@@@@@ @@@ @ @@@ @ @ @ @" }; int main(argc, argv) int argc; char *argv[]; { int a, b, c, len, ind; char line[80]; for (argv++; --argc; argv++) { #ifdef Proolix len = (int) strlen(*argv); #else len = strlen(*argv); #endif if (len > 10) len = 10; for (a = 0; a < 7; a++) { for (b = 0; b < len; b++) { if ((ind = (*argv)[b] - ' ') < 0) ind = 0; for (c = 0; c < 7; c++) { line[b * 8 + c] = glyphs[(ind / 8 * 7) + a][(ind % 8 * 7) + c] == '@' ? ind + ' ' : ' '; } line[b * 8 + 7] = ' '; } for (b = len * 8 - 1; b >= 0; b--) { if (line[b] != ' ') break; line[b] = '\0'; } printf("%s\n", line); } printf("\n"); } return(0); } src/command/term0100664000076500007650000000120306421436416013410 0ustar prool2prool2/*---------------------------------------------------------------------------- T E R M I N A T O R ------------------------------------------------------------------------------ The terminal communication program for OS Proolix ------------------------------------------------------------------------------ Version 0.0.0 16-Oct-97 ------------------------------------------------------------------------------*/ #include int main (void) { int port; char str [80]; printf("terminator\n\n"); printf("Port no.? "); gets(str); scanf(str,"%i",&port); printf("port=%i\n",i); return 0; } src/command/mse0100664000076500007650000003337406661632452013247 0ustar prool2prool2ޭXc. UVW~ vL&Pvv" uZ&Pvv" tǙRPQ&PV" 9^&:uFǙRPvvV_" VQ" <\u/F<u_^]U FP!DD^F&F<$u]PSQRVWU.V4 ]_^ZY[XPSQRVWU.3ɋًR4P4#t>V4u6R46P4!3PCP]_^ZY[XPSQRVWU._&P(!]_^ZY[XPSQRVWU.g&P!n]_^ZY[XPSQRVWU.u&P ]_^ZY[XPSQRVWU.4F^NVFvFFFFF%F؀_9u >X4t#؀^:t Pp DDv DDP_ DDF=bvU .' s s s [[js {s s s s s s s s s s s s s s s s s s s s s s s s s *`gs s s s 4s w s s lCs s s s  C ^ s s L s s s s s s s s s s s s s s s s s e PFPaDDFF FPMDD ~u73 tF%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2Њӊ%[&&Wˎ“&WS& } +s2+Њӊ%[&&W } у-sЊ% } у+s2+ӊЊ%QЊŊYˊ%;u;˱&r&W%&&W&W%&&W˱&+Ћr&W%&&W&W%&&Wlpt1/dev/lptlpt2BREAK Fatal error Int29 called int %02X vec Disallow change int %02X vecParse=%Fs TSR DOS Fn 37, subfn=%02X chdir %Fs`%s' open. mode=%04X close handle 0-4 read h=%i len=%i read from stdaux !!! write h=%i len=%i write to stdprn or stdaux !!! IOCTL Fn=%02X handle=%04X IOCTL Fn=%02X IOCTL invalid Fn=%02X free %04X find first `%Fs'*.*L1. Set strategy - 1st best last ? Get strategy Not realized MSDOS Fn %02X Disallow fn %02X Program terminateKeyboard input with echoDisplay outputWait for auxiliary device inputAuxiliary outputPrinter outputDirect console I/OWait for direct console input without echoWait for console input without echoPrint stringBuffered keyboard inputCheck standard input statusClear keyboard buffer, invoke keyboard functionDisk resetSelect diskOpen file using FCBClose file using FCBSearch for first entry using FCBSearch for next entry using FCBDelete file using FCBSequential read using FCBSequential write using FCBCreate a file using FCBRename file using FCBDOS dummy function (CP/M) (not used/listed)Get current default driveSet disk transfer addressGet allocation table informationGet allocation table info for specific deviceGet pointer to default drive parameter table (undocumented)Random read using FCBRandom write using FCBGet file size using FCBSet relative record field for FCBSet interrupt vectorCreate new program segmentRandom block read using FCBRandom block write using FCBParse filename for FCBGet dateSet dateGet timeSet timeSet/reset verify switchGet disk transfer addressGet DOS version numberTerminate and stay residentGet pointer to drive parameter table (undocumented)Get/set Ctrl-Break check state & get boot driveGet address to DOS critical flag (undocumented)Get interrupt vectorGet disk free spaceGet/set switch character (undocumented)Get/set country dependent informationCreate subdirectory (mkdir)Remove subdirectory (rmdir)Change current subdirectory (chdir)Create file using handleOpen file using handleClose file using handleRead file or device using handleWrite file or device using handleDelete fileMove file pointer using handleChange file modeI/O control for devices (IOCTL)Duplicate file handleForce duplicate file handleGet current directoryAllocate memory blocksFree allocated memory blocksModify allocated memory blocksEXEC load and execute program (func 1 undocumented)Terminate process with return codeGet return code of a sub-processFind first matching fileFind next matching fileSet current process id (undocumented)Get current process id (undocumented)Get pointer to DOS 'INVARS' (undocumented)Generate drive parameter table (undocumented)Get verify settingCreate PSP (undocumented)Rename fileGet/set file date and time using handleGet/set memory allocation strategy (3.x+, undocumented)Get extended error information (3.x+)Create temporary file (3.x+)Create new file (3.x+)Lock/unlock file access (3.x+)Critical error information (undocumented 3.x+)Network services (3.1+)Network redirection (3.1+)Get fully qualified file name (undocumented 3.x+)Get address of program segment prefix (3.x+)Get system lead byte table (MSDOS 2.25 only)Set device driver look ahead (undocumented 3.3+)Get extended country information (3.3+)Get/set global code page (3.3+)Set handle count (3.3+)Flush buffer (3.3+)Get/set disk serial number (undocumented DOS 4.0+)DOS reserved (DOS 4.0+)DOS reservedExtended open/create (4.x+)OEM INT 21 handler (undocumented)unknown%02X===CASE===/karb,.-:COMSPEC=C:DSH.COM MSDOS emulator internal command: help - this help ver - version setver - set DOS version cd - print workdir cd

- change dir setpause [0|1] - set MSDOS debuggin' pause verbose [0|1] - set MSDOS debuggin' verbose mode Called CP/M entry! Bytes on last page %04X Pages in file %04X Relocations %04X Paragraphe in header %04X MinMem %04X par MaxMem %04X par SS:SP %04X:%04X CheckSum %04X CS:IP %04X:%04X Relocation table addr %04X Overlay No. %1X restos=%i Sec1=MZ.EXE file. File length=%li Image length=%li bytes execdos: no memory. (Required %04X bytes) EXEC! Start point %04X:%04X %02X Proolix MSDOS emulator v. 0.0.23 14-Feb-99 Use `help` for help C>ver%s setver=%i.%i msdos_pause=%i msdos_verbose=%i helpexitcdpwd errorCan't chdir %s setverNew version %i.%i setpauseverbose mse: not found no memory I/O error invalid error src/command/pg.c0100664000076500007650000000154405742305660013301 0ustar prool2prool2#include #include #include #include #include #include #define MAX_S 256 void main(argc, argv) int argc; char *argv[]; {FILE *fp; char s[MAX_S]; long pos, oldpos; int i; if (argc==1) {printf("usage: pg filename\n"); exit(0); } #pragma warn -sus fp=fopen(argv[1],"r"); #pragma warn +sus L0: pos=ftell(fp); for(i=0;i<24;i++) { if (fgets(s,MAX_S,fp)==NULL) break; printf("%s",s); } oldpos=pos; pos=ftell(fp); L1: prin