Merge branch 'release/1.2.0'

This commit is contained in:
Nicolas Hordé 2004-11-13 12:34:41 +00:00
commit 62bdca8c46
30 changed files with 3394 additions and 612 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,8 @@ smart
org 0100h org 0100h
include ..\include\fat.h include ..\include\fat.h
include ..\include\mem.h
include ..\include\divers.h
start: start:
push cs push cs
@ -16,9 +18,10 @@ start:
pop es pop es
pop fs pop fs
pop gs pop gs
mov ah,21 mov ah,21
mov cl,7 mov cl,7
int 47h int 47h
mov ah,3 mov ah,3
int 48h int 48h
mov ax,0002 mov ax,0002
@ -55,6 +58,7 @@ noret:
waitchar: waitchar:
mov ax,0 mov ax,0
int 16h int 16h
call convertfr
cmp ah,59 cmp ah,59
jne norr jne norr
cmp bp,0 cmp bp,0
@ -69,8 +73,14 @@ waitchar:
add di,cx add di,cx
jmp waitchar jmp waitchar
norr: norr:
cmp al,0Dh cmp al,0Dh ;entrée
je entere je entere
cmp al,08h ;backspace
je backspace
cmp al,27 ;echap
je escape
cmp al,' '
jb waitchar
cmp di,offset buffer+256 cmp di,offset buffer+256
je waitchar je waitchar
mov [di],al mov [di],al
@ -79,6 +89,36 @@ norr:
mov ah,7 mov ah,7
int 47h int 47h
jmp waitchar jmp waitchar
escape:
cmp di,offset buffer
je waitchar
mov ah,18h
int 47h
mov dx,offset buffer
mov cx,di
sub cx,dx
js waitchar
je waitchar
sub bh,cl
mov ah,19h
int 47h
mov di,offset buffer
mov byte ptr [di],0
backspace:
cmp di,offset buffer
je waitchar
mov ah,18h
int 47h
dec bh
mov dl,' '
mov ah,0Eh
int 47h
mov ah,19h
int 47h
dec di
mov byte ptr [di],0
jmp waitchar
entere: entere:
mov byte ptr [di],0 mov byte ptr [di],0
mov si,offset buffer mov si,offset buffer
@ -141,48 +181,12 @@ error:
call concat0 call concat0
noaddext: noaddext:
mov si,offset buffer mov si,offset buffer
push cs mov ah,18
mov ax,offset arrive
push ax
mov di,offset vga
mov ah,40
int 47h
mov ax,9000h
mov es,ax
push ax
mov di,0100h
push di
mov ah,4
int 48h int 48h
jc reallyerror jc reallyerror
push es
push es
push es
pop ds
pop fs
pop gs
push 7202h
popf
db 0CBh
arrive:
push cs
push cs
push cs
push cs
pop ds
pop es
pop fs
pop gs
mov si,offset vga
mov ah,41
int 47h
xor bp,bp xor bp,bp
jmp replay jmp replay
reallyerror: reallyerror:
pop ax
pop ax
pop ax
pop ax
mov ah,13 mov ah,13
mov si,offset Error_Syntax mov si,offset Error_Syntax
int 47h int 47h
@ -206,7 +210,7 @@ Code_Version:
int 47h int 47h
ret ret
Version_Text db 'Cos 2000 version 3.0.2Fr par Nico',0 Version_Text db 'Cos 2000 version 1.2Fr par Nico',0
Code_Cls: Code_Cls:
mov ah,2 mov ah,2
@ -393,7 +397,185 @@ int 47h
ret ret
errorrefreshing db 'Impossible de lire le support',0 errorrefreshing db 'Impossible de lire le support',0
extcom db '.EXE',0 extcom db '.COM',0
Code_Mem:
mov si,offset msgs
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov si,offset menu
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,18h
int 47h
xor cx,cx
listmcb:
mov ah,4
int 49h
jc fino
inc cx
mov ah,18h
int 47h
push gs
pop ds
mov bh,0
mov si,MB.Names
mov ah,14h
int 47h
mov bh,15
xor edx,edx
mov dx,ds:[MB.Sizes]
shl edx,4
mov ah,0Fh
int 47h
mov bh,24
cmp ds:[MB.IsResident],true
push cs
pop ds
jne notresident
mov si,offset resident
mov ah,14h
int 47h
jmp suitelistmcb
notresident:
mov si,offset nonresident
mov ah,14h
int 47h
suitelistmcb:
mov bh,30
cmp gs:[MB.Reference],0
je next
cmp gs:[MB.Reference],1000h
jb next
mov ax,gs:[MB.Reference]
dec ax
dec ax
mov ds,ax
mov si,MB.Names
mov ah,14h
int 47h
next:
mov bh,46
xor edx,edx
mov dx,gs
inc dx
inc dx
push cx
mov cx,16
mov ah,11h
int 47h
mov ah,6h
int 47h
pop cx
jmp listmcb
fino:
ret
resident db 'oui',0
nonresident db 'non',0
msgs db 'Plan de la memoire',0
menu db 'Nom Taille Res Parent Mem',0
;converti le jeux scancode/ascii en fr ax->ax
convertfr:
push dx si
mov si,offset fr
searchtouch:
mov dx,cs:[si]
cmp dx,0
je endofconv
add si,4
cmp dx,ax
jne searchtouch
mov ax,cs:[si-2]
endofconv:
pop dx si
ret
fr: db '1', 02, '&', 02
db '!', 02, '1', 02
db '2', 03, '', 03
db '@', 03, '2', 03
db '3', 04, '"', 04
db '#', 04, '3', 04
db '4', 05, 39, 05
db '$', 05, '4', 05
db '5', 06, '(', 06
db '%', 06, '5', 06
db '6', 07, '-', 07
db '^', 07, '6', 07
db '7', 08, 'Š', 08
db '&', 08, '7', 08
db '8', 09, '_', 09
db '*', 09, '8', 09
db '9', 10, '‡', 10
db '(', 10, '9', 10
db '0', 11, '…', 11
db ')', 11, '0', 11
db '-', 12, ')', 12
db '_', 12, 'ø', 12
db 'Q', 16, 'A', 16
db 'q', 16, 'a', 16
db 'W', 17, 'Z', 17
db 'w', 17, 'z', 17
db '{', 26, '‰', 26
db '[', 26, 'ˆ', 26
db ']', 27, '$', 27
db '}', 27, 'œ', 27
db 'A', 30, 'Q', 30
db 'a', 30, 'q', 30
db ':', 39, 'M', 39
db ';', 39, 'm', 39
db 39, 40, '—', 40
db '"', 40, '%', 40
db 00, 40, '%', 40
db '\', 43, '*', 43
db '|', 43, 'æ', 43
db 'Z', 44, 'W', 44
db 'z', 44, 'w', 44
db 'm', 50, ',', 50
db 'M', 50, '?', 50
db ',', 51, ';', 51
db '<', 51, '.', 51
db '.', 52, ':', 52
db '>', 52, '/', 52
db '?', 53, 'õ', 53
db '/', 53, '!', 53
db '\', 86, '<', 86
db '|', 86, '>', 86
db 00, 79h, '~', 03
db 00, 7Ah, '#', 04
db 00, 7Bh, '{', 05
db 00, 7Ch, '[', 06
db 00, 7Dh, '|', 07
db 00, 7Eh, '`', 08
db 00, 7Fh, '\', 09
db 00, 80h, '^', 10
db 00, 81h, '@', 11
db 00, 82h, ']', 12
db 00, 83h, '}', 13
db 00, 00, 00, 00
commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit
dw Str_Version,Code_Version,Syn_Version,Help_Version dw Str_Version,Code_Version,Syn_Version,Help_Version
@ -404,17 +586,19 @@ commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit
dw Str_Dir ,Code_Dir ,Syn_Dir ,Help_Dir dw Str_Dir ,Code_Dir ,Syn_Dir ,Help_Dir
dw Str_refresh ,Code_refresh ,Syn_refresh ,Help_refresh dw Str_refresh ,Code_refresh ,Syn_refresh ,Help_refresh
dw Str_cd ,Code_cd ,Syn_cd ,Help_cd dw Str_cd ,Code_cd ,Syn_cd ,Help_cd
dw Str_Mem ,Code_Mem ,Syn_Mem ,Help_Mem
dw 0 dw 0
Str_Exit db 'QUIT',0 Str_Exit db 'QUIT',0
Str_Version db 'VERS',0 Str_Version db 'VERS',0
Str_Cls db 'EFFAC',0 Str_Cls db 'CLEAR',0
Str_Reboot db 'REDEM',0 Str_Reboot db 'REBOOT',0
Str_Command db 'CMDS',0 Str_Command db 'CMDS',0
Str_Mode db 'MODE',0 Str_Mode db 'MODE',0
Str_Dir db 'VOIR',0 Str_Dir db 'DIR',0
Str_refresh db 'LIRE',0 Str_refresh db 'DISK',0
Str_cd db 'CH',0 Str_cd db 'CD',0
Str_Mem db 'MEM',0
Syn_Exit db 0 Syn_Exit db 0
Syn_Version db 0 Syn_Version db 0
Syn_Cls db 0 Syn_Cls db 0
@ -424,6 +608,7 @@ Syn_Mode db 'FFH',0
Syn_Dir db 0 Syn_Dir db 0
Syn_refresh db 0 Syn_refresh db 0
Syn_cd db '@',0 Syn_cd db '@',0
Syn_Mem db 0
Help_Exit db 0 Help_Exit db 0
Help_Version db 0 Help_Version db 0
Help_Cls db 0 Help_Cls db 0
@ -432,18 +617,18 @@ Help_Command db 0
Help_Mode db 0 Help_Mode db 0
Help_Dir db 0 Help_Dir db 0
Help_refresh db 0 Help_refresh db 0
Help_cd db 0 Help_cd db 0
Help_Mem db 0
derror db 'Erreur de Syntaxe !',0 derror db 'Erreur de Syntaxe !',0
Error_Syntax db 'La commande ou l''executable n''existe pas ! F1 pour ',0 Error_Syntax db 'La commande ou l''executable n''existe pas ! F1 pour ',0
prompt db '>',0 prompt db '>',0
msg db 'Interpreteur de commande COS V1.1',0 msg db 'Interpreteur de commande COS V1.8',0
include str0.asm include str0.asm
dir equ $ dir db 32 dup (0)
buffer equ $+128 buffer db 256 dup (0)
buffer2 equ $+128+512 buffer2 db 256 dup (0)
vga equ $+128+512+512
end start end start

View File

@ -2,15 +2,15 @@ lnk_boot = tlink /x
asm= tasm /t/m5/zi asm= tasm /t/m5/zi
lnk= tlink /x/t lnk= tlink /x/t
all: ex-tasm.exe ex-nasm.exe all: ex-tasm.com ex-nasm.com
ex-tasm.exe: ex-tasm.asm ex-tasm.com: ex-tasm.asm
$(asm) ex-tasm $(asm) ex-tasm
$(lnk) ex-tasm $(lnk) ex-tasm
ren ex-tasm.com ex-tasm.exe ren ex-tasm.com ex-tasm.com
ex-nasm.exe: ex-nasm.asm ex-nasm.com: ex-nasm.asm
nasm ex-nasm.asm -o ex-nasm.exe nasm ex-nasm.asm -o ex-nasm.com
clean: clean:
del *.obj del *.obj

BIN
doc_origine.pdf Normal file

Binary file not shown.

2
include/divers.h Normal file
View File

@ -0,0 +1,2 @@
True equ 1
False equ 0

11
include/mem.h Normal file
View File

@ -0,0 +1,11 @@
MB struc
Check dw 'NH'
IsNotLast db 0
IsResident db 0
Reference dw 0
Sizes dw 0
Names db 24 dup (0)
MB ends
Free equ 0
memorystart equ 1000h

View File

@ -10,7 +10,7 @@ ent equ 32h
start: start:
jmp CopyCOS jmp CopyCOS
Message db 0Dh,0Ah,'COS 2000 V3.02Fr programme d''installation',0Dh,0AH,'Inserez une disquette formatee et appuyez sur entre...',0Dh,0AH,'Attention le contenu de celle ci peut etre altere !!!',0Dh,0AH,'$' Message db 0Dh,0Ah,'COS 2000 V1.2Fr programme d''installation',0Dh,0AH,'Inserez une disquette formatee et appuyez sur entre...',0Dh,0AH,'Attention le contenu de celle ci peut etre altere !!!',0Dh,0AH,'$'
Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$' Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
Message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$' Message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$'
Errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$' Errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'

BIN
install/setup.sh Executable file

Binary file not shown.

4
install/winNT/setup.bpf Normal file
View File

@ -0,0 +1,4 @@
This file is used by the project manager only and should be treated like the project file
main

120
install/winNT/setup.bpr Normal file
View File

@ -0,0 +1,120 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="setup.exe"/>
<OBJFILES value="Unit1.obj"/>
<RESFILES value="Setup.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value=""/>
<LIBRARIES value=""/>
<SPARELIBS value=""/>
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
vcldbx.bpi ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi
teedb.bpi tee.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
indy.bpi bcb2kaxserver.bpi pop.bpi IcsBcb50.bpi bcbshlctrls.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value=""/>
<SYSDEFINES value="NO_STRICT;_NO_VCL;_RTLDLL"/>
<MAINSOURCE value="Setup.bpf"/>
<INCLUDEPATH value="&quot;..\Nouveau dossier (2)&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="&quot;..\Nouveau dossier (2)&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-I&quot;..\Nouveau dossier (2)&quot; -I$(BCB)\include -I$(BCB)\include\vcl
-src_suffix cpp -boa"/>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -tWC -tWM- -c"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zn"/>
<LFLAGS value="-D&quot;&quot; -ap -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0x32.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32i.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="Setup.res" FORMNAME="" UNITNAME="Setup.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Setup.bpf" FORMNAME="" UNITNAME="Setup" CONTAINERID="BPF" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Language]
ActiveLang=
ProjectLang=
RootDir=
</IDEOPTIONS>
</PROJECT>

BIN
install/winNT/setup.res Normal file

Binary file not shown.

BIN
install/winNT/setup.tds Normal file

Binary file not shown.

135
install/winNT/unit1.cpp Normal file
View File

@ -0,0 +1,135 @@
//---------------------------------------------------------------------------
#include <windows.h>
#include <winbase.h>
#include <winioctl.h>
#include <io.h>
#include <stdio.h>
#include <fcntl.h>
#include <dir.h>
#pragma hdrstop
//---------------------------------------------------------------------------
char * GetLastErrorString(void)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL);
return (char *)lpMsgBuf;
}
#pragma argsused
int main(int argc, char* argv[])
{
DWORD dwNotUsed;
DWORD error=0;
HANDLE hDrive;
DISK_GEOMETRY dg_flop_geom;
char lecteur[4]="a:\0";
char device[7]="\\\\.\\a:\0";
int fdboot;
DWORD dwBsWritten;
char * buffer;
char bootfile[14]="data/boot.bin\0";
struct ffblk files;
int done;
int number=0;
char src[80];
char dest[80];
printf("Installation de COS2000\nInserez une disquette et appuyer sur une touche...\n");
getchar();
hDrive = CreateFile(device, GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);
printf("Ouverture du peripherique %s\n",lecteur);
if (hDrive == INVALID_HANDLE_VALUE) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if(error!=1&&printf("Determination de la geometrie \n")&&DeviceIoControl(hDrive, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL,0, &dg_flop_geom, sizeof(dg_flop_geom),&dwNotUsed, NULL) == FALSE) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if(error!=1&&(dg_flop_geom.MediaType==FixedMedia||dg_flop_geom.MediaType==RemovableMedia||dg_flop_geom.MediaType==Unknown))
{
printf("Erreur : Ceci n'est pas une disquette !\n");
error=1;
}
if (error!=1&&printf("Positionnement sur le secteur 0\n")&&SetFilePointer(hDrive, 0, NULL, FILE_BEGIN) == -1) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if (error!=1)
{
printf("Pistes :%u Secteurs:%u Tetes:%u Taille:%u\n",dg_flop_geom.Cylinders.LowPart,dg_flop_geom.SectorsPerTrack,dg_flop_geom.TracksPerCylinder,dg_flop_geom.BytesPerSector);
}
else
{
CloseHandle(hDrive);
}
if (hDrive == NULL||dg_flop_geom.TracksPerCylinder>2||dg_flop_geom.TracksPerCylinder==0)
{
printf("Aucun support valide detecte !");
error=1;
}
if (error!=1)
{
printf("Allocation de memoire\n");
buffer = (char *)malloc(dg_flop_geom.BytesPerSector);
printf("Ouverture et installation du fichier de boot %s\n",bootfile);
}
if (error!=1&&(fdboot = _rtl_open(bootfile,O_RDONLY | O_BINARY)) == -1 )
{
printf("Erreur : Fichier de boot introuvable\n");
error=1;
}
if (error!=1&&_read(fdboot, buffer, dg_flop_geom.BytesPerSector)!= dg_flop_geom.BytesPerSector)
{
printf("Erreur : Fichier de boot de taille incorrecte !\n");
error=1;
}
if (error!=1&&WriteFile(hDrive, buffer, dg_flop_geom.BytesPerSector, &dwBsWritten, NULL) == 0)
{
printf("Ecriture impossible sur le secteur de boot !\n");
error=1;
}
if (error!=1)
{
_rtl_close(fdboot);
printf("Determination des fichiers a copier\n\n");
done = findfirst("data\\*.*",&files,0);
while (!done)
{
number++;
done = findnext(&files);
}
printf("Copie des fichiers de cos2000\n");
done = findfirst("data\\*.*",&files,0);
while (!done)
{
printf("%s\n",files.ff_name);
sprintf(src, "data\\%s",files.ff_name);
sprintf(dest, "%s\\%s",lecteur,files.ff_name);
if (!CopyFile(src,dest,false))
{
printf("Erreur : fichier impossible a copier %s\n",GetLastErrorString());
error=1;
break;
}
done = findnext(&files);
}
if (!error)
{
printf("Installation terminee !\nVeuillez redemarrer votre PC afin de charger le systeme");
}
else
{
printf("Installation echoué !");
}
free(buffer);
}
getchar();
return 0;
}
//---------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@ lnk_boot = tlink /x
asm= tasm /t/m5/zi asm= tasm /t/m5/zi
lnk= tlink /x/t lnk= tlink /x/t
all: boot.bin clavier.sys 8259a.sys disque.sys heure.sys horloge.sys manette.sys port.sys souris.sys systeme.sys video.sys all: boot.bin clavier.sys 8259a.sys disque.sys heure.sys horloge.sys manette.sys port.sys souris.sys systeme.sys video.sys mcb.sys
boot.bin: boot.asm boot.bin: boot.asm
$(asm) boot $(asm) boot
@ -59,6 +59,11 @@ video.sys: video.asm
$(lnk) video $(lnk) video
ren video.com video.sys ren video.com video.sys
mcb.sys: mcb.asm
$(asm) mcb
$(lnk) mcb
ren mcb.com mcb.sys
clean: clean:
del *.obj del *.obj
del *.exe del *.exe

View File

@ -15,35 +15,40 @@ tsr:
db 2eh,0ffh,1eh db 2eh,0ffh,1eh
dw offsets dw offsets
cli cli
mov cs:feax,eax add dword ptr cs:popes,1
in al,60h
cmp cs:isstate,1 cmp cs:isstate,1
jne nostate je endofforce
cmp al,57 mov cs:isstate,1
jne endof mov cs:eaxr,eax
mov cs:isstate,0 in al,60h
jmp endof
nostate:
cmp al,68 cmp al,68
je F10 je F10
cmp al,87 cmp al,87
je F11 je F11
cmp al,88 cmp al,88
je F12 je F12
endof: endof:
mov eax,cs:feax mov cs:isstate,0
mov eax,cs:eaxr
endofforce:
sti sti
iret iret
isstate db 0 isstate db 0
infos db 40 dup (0) infos db 40 dup (0)
feax dd 0
F10: F10:
mov ax,6000h push cs
push ax pop ds
mov di,0100h mov si,offset com
push di mov ah,5
sti int 49h
db 0CBh mov cs:isstate,0
push gs
push 0100h
db 0CBh
com db 'COMMANDE.EXE',0
F11: F11:
push ax di es push ax di es
@ -65,154 +70,230 @@ notabove:
f12: f12:
mov cs:isstate,1
pop word ptr cs:fip
pop word ptr cs:fcs
pop dword ptr cs:ffl
mov cs:fesp,esp
push ds es
pusha
push word ptr cs:fip
push gs
push fs
push ss
push es
push ds
push word ptr cs:fcs
push dword ptr cs:fesp
push ebp
push edi
push esi
push edx
push ecx
push ebx
push eax
push dword ptr cs:ffl
push cs
push cs
pop es
pop ds
mov ah,26
int 47h
mov ah,2
int 47h
mov ah,21
mov cl,4
int 47h
mov ah,13
mov si,offset reg
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,7
int 47h
mov ah,13
mov si,offset fla
int 47h
pop edx
mov cx,32
mov ah,11
int 47h
mov ah,5
int 47h
mov ah,10
int 47h
mov si,offset regs
mov bx,8+7
mov ah,21
mov cl,6
int 47h
showallREG:
mov ah,6
int 47h
cmp bx,8
jb nodr
pop edx
mov cx,32
jmp popo
nodr:
mov ah,21
mov cl,1
int 47h
xor edx,edx
pop dx
mov cx,16
popo:
mov ah,13
int 47h
mov ah,10
int 47h
mov ah,5
int 47h
push si
mov si,offset gr
mov ah,13
int 47h
mov ah,8
int 47h
mov si,offset dr
mov ah,13
int 47h
pop si
add si,5
dec bx
jnz showallreg
mov ah,34
mov di,offset infos
int 47h
mov ah,25
mov bl,cs:infos
xor bh,bh
dec bl
int 47h
mov si,offset app
mov ah,13
int 47h
mov ah,32
mov bl,cs:infos
xor bh,bh
mov di,ax
dec di
mov cl,116
int 47h
pop es ds
sti
waitt:
cmp cs:isstate,0
jne waitt
mov ah,27
int 47h
popa
pop es ds
push dword ptr cs:ffl
push word ptr cs:fcs
push word ptr cs:fip
jmp endof
reg db ' Etats des registres',0 showreg:
fla db 'Eflags:',0 pushf
regs db 'EAX:',0 pushad
db 'EBX:',0 mov bp,sp
db 'ECX:',0 mov ax,ss:[bp+28h]
db 'EDX:',0 mov cs:[csr],ax
db 'ESI:',0 mov ax,ss:[bp+26h]
db 'EDI:',0 mov cs:[ipr],ax
db 'EBP:',0 mov ax,ss:[bp+2Ah]
db 'ESP:',0 mov cs:[flr],ax
db ' CS:',0 mov cs:[ebxr],ebx
db ' DS:',0 mov cs:[ecxr],ecx
db ' ES:',0 mov cs:[edxr],edx
db ' FS:',0 mov cs:[esir],esi
db ' GS:',0 mov cs:[edir],edi
db ' SS:',0 mov cs:[espr],esp
db ' IP:',0 mov cs:[ebpr],ebp
gr db '(',0 mov cs:[dsr],ds
dr db ')',0 mov cs:[esr],es
app db 'Appuyez sur espace pour quitter...',0 mov cs:[fsr],fs
ffl dd 0 mov cs:[gsr],gs
fcs dw 0 mov cs:[ssr],ss
fip dw 0 push ds
fesp dd 0 pop fs
feax dd 0 push cs
pop ds
mov ah,28h
int 47h
mov ax,0002
int 47H
mov ah,2
int 47h
mov si,offset etat
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov si,offset reg
mov di,offset regdata
mov bx,7
showregs:
cmp byte ptr cs:[si+4],":"
jne endshowregs
mov ah,13
int 47h
cmp byte ptr cs:[si+3],"g"
je segsss
cmp byte ptr cs:[si+2]," "
je segsss
mov edx,cs:[di]
mov cx,32
mov ah,0Ah
int 47h
add di,4
jmp showmax
segsss:
xor edx,edx
mov dx,cs:[di]
mov cx,16
mov ah,0Ah
int 47h
push si
mov ah,13
mov si,offset blank
int 47h
pop si
add di,2
showmax:
add si,7
mov ebp,edx
push si
mov si,offset beginds
mov ah,13
int 47h
pop si
mov cx,8
mov al,0
mov bx,bp
letshow:
mov dl,fs:[bx]
inc bx
mov ah,0Ah
int 47h
inc al
cmp al,10
jb letshow
push si
mov si,offset ende
mov ah,13
int 47h
mov si,offset begines
mov ah,13
int 47h
pop si
mov bx,bp
mov cx,8
mov al,0
letshow2:
mov dl,es:[bx]
inc bx
mov ah,0Ah
int 47h
inc al
cmp al,10
jb letshow2
push si
mov si,offset ende
mov ah,13
int 47h
mov si,offset beginint
mov ah,13
int 47h
pop si
mov edx,ebp
mov ah,8
int 47h
push si
mov si,offset endint
mov ah,13
int 47h
pop si
mov ah,6
int 47h
jmp showregs
endshowregs:
mov ah,6
int 47h
mov si,offset pile
mov ah,13
int 47h
mov ah,6
int 47h
mov bp,sp
mov di,0ffffh
sub di,bp
xor si,si
showstack:
mov dl,'+'
mov ah,07h
int 47h
mov ah,0Ah
mov cx,8
mov dx,si
int 47h
mov dl,':'
mov ah,07h
int 47h
mov dx,ss:[bp+si]
mov ah,0Ah
mov cx,16
int 47h
mov ah,06
int 47h
inc si
inc si
cmp si,di
jb showstack
mov ah,0ah
mov edx,cs:popes
mov cx,32
int 47h
xor ax,ax
int 16h
mov ah,29h
int 47h
popad
popf
jmp endof
popes dd 0
regdata:
eaxr dd 0
ebxr dd 0
ecxr dd 0
edxr dd 0
esir dd 0
edir dd 0
espr dd 0
ebpr dd 0
ipr dw 0
csr dw 0
dsr dw 0
esr dw 0
fsr dw 0
gsr dw 0
ssr dw 0
flr dw 0
etat db ' Etat des registres processeurs',0
reg db "eax : ",0
db "ebx : ",0
db "ecx : ",0
db "edx : ",0
db "esi : ",0
db "edi : ",0
db "esp : ",0
db "ebp : ",0
db "ip : ",0
db "cs : ",0
db "ds : ",0
db "es : ",0
db "fs : ",0
db "gs : ",0
db "ss : ",0
db "flag: ",0
pile db 'Stack :',0
blank db ' ',0
beginint db ' (',0
endint db ') ',0
begines db ' es[',0
beginds db ' ds[',0
ende db '] ',0
end start end start

View File

@ -68,6 +68,8 @@ tables dw readsector
dw readcluster dw readcluster
dw writecluster dw writecluster
dw getdir dw getdir
dw projfile
dw execfile
maxfunc equ 24 maxfunc equ 24
@ -95,24 +97,30 @@ AdressDirectory dw 0 ;En cluster
firstsearch dw 1 ;Premiere requete ? firstsearch dw 1 ;Premiere requete ?
getfat: getfat:
push ax bx dx si push ax bx dx si ds gs
mov dx,cs
push cs
pop ds
mov si,offset datafat
mov ah,9
int 49h
mov ax,cx mov ax,cx
mov bx,ax mov bx,ax
and bx,0000000000000001b and bx,0000000000000001b
shr ax,1 shr ax,1
mov cx,3 mov cx,3
mul cx mul cx
mov si,offset bufferfat xor si,si
add si,ax add si,ax
cmp bx,0h cmp bx,0h
jnz evenfat jnz evenfat
oddfat: oddfat:
mov dx,cs:[si] mov dx,gs:[si]
and dx,0FFFh and dx,0FFFh
mov cx,dx mov cx,dx
jmp endfat jmp endfat
evenfat: evenfat:
mov dx,cs:[si+1] mov dx,gs:[si+1]
and dx,0FFF0h and dx,0FFF0h
shr dx,4 shr dx,4
mov cx,dx mov cx,dx
@ -120,11 +128,11 @@ endfat:
cmp dx,0FF0h cmp dx,0FF0h
jbe nocarry jbe nocarry
stc stc
pop si dx bx ax pop gs ds si dx bx ax
ret ret
nocarry: nocarry:
clc clc
pop si dx bx ax pop gs ds si dx bx ax
ret ret
;============loadfile (Fonction 4)=============== ;============loadfile (Fonction 4)===============
@ -155,6 +163,100 @@ errorload:
mov ecx,0 mov ecx,0
pop di bx eax pop di bx eax
ret ret
;============execfile (Fonction 18)===============
;Execute le fichier ds:si
;-> AH=18
;<- Flag Carry si erreur
;=====================================================
execfile:
pushf
push bp dx
mov bp,sp
mov dx,ss:[bp+10]
pushad
push ds es fs gs
call projfile
jc reallyerror
push es
pop gs
mov ah,6
int 49h
push es
push cs
mov ax,offset arrive
push ax
push es
push 0100h
push es
push es
push es
pop ds
pop fs
pop gs
push 7202h
popf
sti
db 0CBh
arrive:
cli
pop gs
mov ah,01
int 49h
pop gs fs es ds
popad
pop dx bp
popf
ret
reallyerror:
pop gs fs es ds
popad
pop dx bp
popf
stc
ret
;============projfile (Fonction 17)===============
;Charge le fichier ds:si sur un bloc mémoire -> ecx taille -> es bloc
;-> AH=17
;<- Flag Carry si erreur
;=====================================================
projfile:
push eax bx di ds gs
push cs
pop es
call uppercase
mov ah,5
int 49h
jnc errorload2
mov di,offset tempfit
call searchfile
jne errorload2
jc errorload2
mov eax,cs:tempfit.FileSize
mov ecx,eax
add ecx,100h
push eax
mov ah,2
int 49h
pop eax
jc errorload2
push gs
pop es
mov cx,cs:tempfit.FileGroup
mov di,100h
call loadway
jc errorload2
clc
mov ecx,eax
pop gs ds di bx eax
ret
errorload2:
stc
mov ecx,0
pop gs ds di bx eax
ret
tempfit db 32 dup (0) tempfit db 32 dup (0)
@ -211,7 +313,6 @@ errorsearch:
;Transforme la chaine ds:si en maj ;Transforme la chaine ds:si en maj
uppercase: uppercase:
push si ax push si ax
mov di,si
uppercaser: uppercaser:
mov al,ds:[si] mov al,ds:[si]
cmp al,0 cmp al,0
@ -292,6 +393,7 @@ AdjustLast:
mov cx,dx mov cx,dx
push cs push cs
pop ds pop ds
cld
rep movsb rep movsb
zeroload: zeroload:
clc clc
@ -308,7 +410,7 @@ noway:
;<- Flag Carry si erreur ;<- Flag Carry si erreur
;===================================================== ;=====================================================
InitDrive: InitDrive:
push eax bx cx edx di ds es push eax bx cx edx di ds es gs
push cs push cs
pop ds pop ds
push cs push cs
@ -327,9 +429,9 @@ againtry:
dec di dec di
jnz againtry jnz againtry
oknoagaintry: oknoagaintry:
mov cs:lastseg,0 mov lastseg,0
mov cs:lastoff,0 mov lastoff,0
mov cs:LastRead,0 mov LastRead,0
mov ax,myboot.sectorsize mov ax,myboot.sectorsize
mov bl,myboot.SectorsPerCluster mov bl,myboot.SectorsPerCluster
xor bh,bh xor bh,bh
@ -370,9 +472,28 @@ oknoagaintry:
mov adressdirectory,0 mov adressdirectory,0
mov firstsearch,1 mov firstsearch,1
mov currentdirstr,0 mov currentdirstr,0
mov di,offset bufferfat xor eax,eax
mov ax,myboot.SectorsPerFat
mul myboot.SectorSize
shl edx,16
add edx,eax
mov ecx,edx
mov dx,cs
mov si,offset datafat
mov ah,9
int 49h
jnc hadafatbloc
mov si,offset datafat
mov ah,2
int 49h
mov ah,3
int 49h
hadafatbloc:
xor di,di
mov dx,myboot.SectorsPerFat mov dx,myboot.SectorsPerFat
mov cx,AdressFat mov cx,AdressFat
push gs
pop es
SeeFat: SeeFat:
call readsector call readsector
jc ErrorInit jc ErrorInit
@ -381,12 +502,14 @@ SeeFat:
dec dx dec dx
jnz seefat jnz seefat
clc clc
pop es ds di edx cx bx eax pop gs es ds di edx cx bx eax
ret ret
ErrorInit: ErrorInit:
stc stc
pop es ds di edx cx bx eax pop gs es ds di edx cx bx eax
ret ret
datafat db '/fat',0
;=============FindFirstFile (Fonction 7)============== ;=============FindFirstFile (Fonction 7)==============
;Renvois dans ES:DI un bloc d'info ;Renvois dans ES:DI un bloc d'info
@ -648,10 +771,9 @@ lastoff dw 0
;===================================================== ;=====================================================
WriteSector: WriteSector:
push ax bx cx dx si es push ax bx cx dx si es
cmp cs:Lastread,cx mov cs:lastseg,0
jne nodestruct mov cs:lastoff,0
mov cs:Lastread,0ffffh mov cs:LastRead,0FFFFh
nodestruct:
push ds push ds
pop es pop es
mov ax,cx mov ax,cx
@ -667,7 +789,7 @@ nodestruct:
xchg cl,ch xchg cl,ch
shl cl,6 shl cl,6
or cl, bl or cl, bl
mov bx,si mov bx,si
mov SI, 4 mov SI, 4
mov AL,1 mov AL,1
TryAgains: TryAgains:
@ -716,25 +838,30 @@ getserial:
;<- Flag Carry si erreur, Flag Equal si secteurs égaux ;<- Flag Carry si erreur, Flag Equal si secteurs égaux
;===================================================== ;=====================================================
VerifySector: VerifySector:
push bx cx si di ds es push ecx si di ds es
push cs push cs
pop es pop es
push cs push cs
pop ds pop ds
mov bx,offset bufferread mov di,offset bufferread
call ReadSector call ReadSector
jc errorverify mov si,offset bufferread
call inverse call inverse
call WriteSector call WriteSector
jc errorverify jc errorverify
mov bx,offset bufferwrite
call ReadSector mov di,offset bufferwrite
call ReadSector
mov si,offset bufferwrite
call inverse call inverse
jc errorverify jc errorverify
mov bx,offset bufferread
mov si,offset bufferread
call inverse call inverse
call WriteSector call WriteSector
jc errorverify jc errorverify
xor ecx,ecx
mov cx,cs:myboot.SectorSize mov cx,cs:myboot.SectorSize
shr cx,2 shr cx,2
mov si,offset bufferread mov si,offset bufferread
@ -742,18 +869,19 @@ VerifySector:
cld cld
rep cmpsd rep cmpsd
errorverify: errorverify:
pop es ds di si cx bx pop es ds di si ecx
ret ret
Inverse: Inverse:
mov si,cs:myboot.sectorsize push si cx
shr si,2 xor cx,cx
invert: invert:
shl si,2 not dword ptr [si]
not dword ptr [bx+si-4] add si,4
shr si,2 add cx,4
dec si cmp cx,cs:myboot.sectorsize
jnz invert jb invert
pop cx si
ret ret
VerifySector2: VerifySector2:
@ -788,6 +916,7 @@ decompression:
mov cl,ah mov cl,ah
xor ah,ah xor ah,ah
xor ch,ch xor ch,ch
cld
rep stosb rep stosb
add si,5 add si,5
sub dx,5 sub dx,5
@ -954,11 +1083,9 @@ getdir:
pop es ds di si cx ax pop es ds di si cx ax
clc clc
ret ret
bufferread db 512 dup (0)
bufferread equ $ bufferwrite db 512 dup (0)
bufferwrite equ $+2048 bufferentry db 512 dup (0)
bufferentry equ $+2048+2048
bufferFat equ $+2048+2048+2048
end start end start

View File

@ -1,18 +1,147 @@
.model tiny
.486
smart
.code
org 0100h
include ..\include\mem.h
include ..\include\divers.h
start:
maxfunc equ 10
jmp tsr ;Saute à la routine résidente
nameed db 'MB' ;Nom drivers
id dw 1234h ;Identifiant drivers
Tsr:
cli ;Désactive interruptions logiciellement
cmp ax,cs:ID ;Compare si test de chargement
jne nomore ;Si pas test alors on continu
rol ax,3*4 ;Rotation de 3 chiffre de l'ID pour montrer que le drivers est chargé
jmp itsok ;On termine l'int avec notre code d'ID preuve du bon chargement de VIDEO
nomore:
cmp ah,maxfunc
jbe noerrorint
stc
jmp itsok
noerrorint:
clc
push bx
mov bl,ah ;On calcule d'aprés le n° de fonction
xor bh,bh ;quel sera l'entrée dans la table indexée
shl bx,1 ;des adresses fonctions.
mov bx,cs:[bx+tables] ;On récupère cette adresse depuis la table
mov cs:current,bx ;On la stocke temporairement pour obtenir les registres d'origine
pop bx
clc
call cs:current ;Puis on execute la fonction
itsok:
push bp
mov bp,sp ;On prend sp dans bp pour adresser la pile
jnc noerror ;La fonction appelée a renvoyer une erreur : Flag CARRY ?
or byte ptr [bp+6],1b;Si oui on le retranscrit sur le registre FLAG qui sera dépilé lors du IRET
;xor eax,eax
;mov ax,cs ;On récupère le segment et l'offset puis en renvoie l'adresse physique
;shl eax,4 ;de l'erreur.
;add ax,cs:current
jmp endofint ;on termine l'int
noerror:
and byte ptr [bp+6],0FEh;Si pas d'erreur on efface le Bit CARRY du FLAG qui sera dépilé lors du IRET
endofint:
pop bp
sti ;On réactive les interruptions logiciellement
iret ;Puis on retourne au programme appelant.
current dw 0 ;Mot temporaire qui contient l'adresse de la fonction appelée
tables dw MBinit ;Table qui contient les adresses de toutes les fonctions de VIDEO (WORD)
dw MBFree
dw MBCreate
dw MBresident
dw MBGet
dw MBFind
dw MBChown
dw MBAlloc
dw MBclean
dw MBfindsb
FirstMB dw 0 FirstMB dw 0
;Initialise les blocs de mémoire ;Mise a nivo de la mémoire (jonction de blocs libre)
MBclean:
push ax bx dx es gs
mov bx,cs:firstmb
dec bx
dec bx
xor ax,ax
xor dx,dx
searchfree3:
mov gs,bx
cmp gs:[MB.Check],'NH'
jne erroronsearch
inc bx
inc bx
add bx,gs:[MB.Sizes]
cmp word ptr gs:[MB.Sizes],0
je erroronsearch
cmp gs:[MB.Reference],Free
jne notfreeatall
cmp ax,0
je notmeetafree
add dx,gs:[MB.Sizes]
mov word ptr gs:[MB.Check],0
mov dword ptr gs:[MB.Names],0
mov dword ptr gs:[MB.Names+4],0
inc dx
inc dx
jmp nottrigered
notmeetafree:
xor dx,dx
mov ax,gs
jmp nottrigered
notfreeatall:
cmp ax,0
je nottrigered
mov es,ax
add es:[MB.Sizes],dx
xor ax,ax
nottrigered:
cmp gs:[MB.IsNotLast],true
je searchfree3
cmp ax,0
je reallyfinish
mov es,ax
add es:[MB.Sizes],dx
mov es:[MB.IsNotLast],False
reallyfinish:
clc
pop gs es dx bx ax
ret
erroronsearch:
stc
pop gs es dx bx ax
ret
;Initialise les blocs de mémoire en prenant memorystart pour segment de base
MBinit: MBinit:
push ax cx es push ax cx es
mov ax,gs cmp cs:FirstMB,0
mov cs:Firstmb,ax jne notforfree
mov ax,memorystart
mov cs:Firstmb,ax
mov cx,0A000h
sub cx,ax
dec ax
dec ax dec ax
mov es,ax mov es,ax
mov cx,0A000h cmp es:[MB.Check],'NH'
sub cx,ax je notforfree
dec cx mov es:[MB.Reference],Free
mov es:[MB.Reference],Free mov es:[MB.Sizes],cx
mov es:[MB.Sizes],cx mov es:[MB.Check],'NH'
mov es:[MB.Check],'NH' mov dword ptr es:[MB.Names],'eerF'
mov dword ptr es:[MB.Names+4],0
mov es:[MB.IsNotLast],False mov es:[MB.IsNotLast],False
clc clc
pop es cx ax pop es cx ax
@ -24,51 +153,235 @@ notforfree:
;Libère le bloc de mémoire GS ;Libère le bloc de mémoire GS
MBFree: MBFree:
push bx es push ax bx es
mov bx,gs mov bx,gs
dec bx mov ax,bx
dec bx
dec bx
mov es,bx mov es,bx
cmp es:[MB.Check],'NH' cmp es:[MB.Reference],Free
je notforfree je wasfree
mov es:[MB.IsResident],0 cmp es:[MB.IsResident],true
je wasfree
mov es:[MB.IsResident],false
mov es:[MB.Reference],Free mov es:[MB.Reference],Free
mov dword ptr es:[MB.Names],'eerF' mov dword ptr es:[MB.Names],'eerF'
mov dword ptr es:[MB.Names+4],0 mov dword ptr es:[MB.Names+4],0
mov bx,cs:firstmb
dec bx
dec bx
searchtofree:
mov gs,bx
cmp gs:[MB.Check],'NH'
jne wasfree
inc bx
inc bx
add bx,gs:[MB.Sizes]
cmp word ptr gs:[MB.Sizes],0
je wasfree
cmp ax,gs:[MB.Reference]
jne nottofree
mov gs:[MB.IsResident],false
mov gs:[MB.Reference],Free
mov dword ptr gs:[MB.Names],'eerF'
mov dword ptr gs:[MB.Names+4],0
nottofree:
cmp gs:[MB.IsNotLast],true
je searchtofree
call MBclean
pop es bx ax
ret
wasfree:
stc
pop es bx ax
ret
;Change le proprietaire de GS a dx
MBChown:
push bx es
mov bx,gs
dec bx
dec bx
mov es,bx
cmp es:[MB.Reference],Free
je wasfree2
mov es:[MB.Reference],dx
pop es bx pop es bx
ret ret
wasfree2:
stc
pop es bx
ret
;Alloue un bloc de CX caractere pour le process visé -> GS
MBAlloc:
push dx si bp ds
mov bp,sp
mov dx,ss:[bp+12]
push cs
pop ds
mov si,offset data
call MBCreate
call MBChown
pop ds bp si dx
ret
data db '/Data',0
;Creér un bloc de nom ds:si de taille cx (octets) -> n°segement dans GS ;Renvoie en GS le MB n° cx carry quand terminé
MBGet:
push bx dx
mov bx,cs:firstmb
dec bx
dec bx
xor dx,dx
searchfree2:
mov gs,bx
cmp gs:[MB.Check],'NH'
jne itsend
inc bx
inc bx
add bx,gs:[MB.Sizes]
cmp word ptr gs:[MB.Sizes],0
je itsend
cmp dx,cx
je foundmcb
ja itsend
inc dx
cmp gs:[MB.IsNotLast],true
je searchfree2
itsend:
stc
pop dx bx
ret
foundmcb:
clc
pop dx bx
ret
;Renvoie en GS le MCB qui correspond a ds:si
MBFind:
push ax bx si di
mov bx,cs:firstmb
dec bx
dec bx
mov di,MB.Names
search:
mov gs,bx
cmp gs:[MB.Check],'NH'
jne itsend2
inc bx
inc bx
add bx,gs:[MB.Sizes]
cmp word ptr gs:[MB.Sizes],0
je itsend2
push si di
cmpnames:
mov al,gs:[di]
cmp al,ds:[si]
jne ok
cmp al,0
je ok
inc si
inc di
jmp cmpnames
ok:
pop di si
je foundmcb2
cmp gs:[MB.IsNotLast],true
je search
itsend2:
stc
pop di si bx ax
ret
foundmcb2:
mov bx,gs
inc bx
inc bx
mov gs,bx
clc
pop di si bx ax
ret
;Renvoie en GS le sous mcb qui correspond a ds:si et qui appartien a dx
MBFindsb:
push ax bx si di
mov bx,cs:firstmb
dec bx
dec bx
mov di,MB.Names
search2:
mov gs,bx
cmp gs:[MB.Check],'NH'
jne itsend3
inc bx
inc bx
add bx,gs:[MB.Sizes]
cmp word ptr gs:[MB.Sizes],0
je itsend3
push si di
cmpnames2:
mov al,gs:[di]
cmp al,ds:[si]
jne ok2
cmp al,0
je ok2
inc si
inc di
jmp cmpnames2
ok2:
pop di si
jne notfoundmcb2
cmp gs:[MB.Reference],dx
je foundmcb3
notfoundmcb2:
cmp gs:[MB.IsNotLast],true
je search2
itsend3:
stc
pop di si bx ax
ret
foundmcb3:
mov bx,gs
inc bx
inc bx
mov gs,bx
clc
pop di si bx ax
ret
;Creér un bloc de nom ds:si de taille cx (octets) -> n°segment dans GS
MBCreate: MBCreate:
push bp
mov bp,sp
mov gs,ss:[bp+6]
push ax bx cx dx si di es push ax bx cx dx si di es
shr cx,4 shr cx,4
inc cx inc cx
mov bx,cs:firstmb mov bx,cs:firstmb
dec bx dec bx
dec bx
mov dl,1
searchfree: searchfree:
cmp dl,False
je wasntgood
mov es,bx mov es,bx
cmp es:[MB.Check],'NH' cmp es:[MB.Check],'NH'
jne wasntgood jne wasntgood
cmp es:[MB.IsNotLast],True cmp es:[MB.IsNotLast],True
sete dl sete dl
cmp es:[MB.Reference],Free cmp es:[MB.Reference],Free
je weregood jne notsogood
cmp dl,False
je wasntgood
notsogood:
inc bx
add bx,es:[MB.Sizes]
jmp searchfree
weregood:
mov ax,es:[MB.Sizes] mov ax,es:[MB.Sizes]
cmp cx,ax cmp cx,ax
ja notsogood ja notsogood
mov es:[MB.IsNotLast],True mov word ptr es:[MB.Check],'NH'
mov es:[MB.Reference],cs mov es:[MB.IsNotLast],True
mov es:[MB.Reference],gs
mov es:[MB.IsResident],False mov es:[MB.IsResident],False
mov es:[MB.Sizes],cx mov di,MB.Names
mov di,MB.Names
push ax cx push ax cx
mov cx,8 mov cx,32
loops: loops:
mov dh,[si] mov dh,[si]
inc si inc si
@ -84,14 +397,16 @@ endofloops:
mov al,0 mov al,0
rep stosb rep stosb
pop cx ax pop cx ax
mov word ptr es:[MB.Check],'NH' inc bx
sub ax,cx inc bx
sub ax,cx
dec ax dec ax
js nofree dec ax
inc bx cmp ax,0
mov gs,bx je nofree
add bx,cx mov es:[MB.Sizes],cx
mov es,bx add cx,bx
mov es,cx
mov es:[MB.IsNotLast],dl mov es:[MB.IsNotLast],dl
mov es:[MB.IsResident],False mov es:[MB.IsResident],False
mov es:[MB.Reference],Free mov es:[MB.Reference],Free
@ -100,20 +415,31 @@ endofloops:
mov dword ptr es:[MB.Names+4],0 mov dword ptr es:[MB.Names+4],0
mov es:[MB.Check],'NH' mov es:[MB.Check],'NH'
nofree: nofree:
mov gs,bx
clc clc
pop es di si dx cx bx ax pop es di si dx cx bx ax
pop bp
ret ret
wasntgood: wasntgood:
stc stc
pop es di si dx cx bx ax pop es di si dx cx bx ax
pop bp
ret ret
notsogood:
inc bx
inc bx
add bx,es:[MB.Sizes]
jmp searchfree
;Rend le segment GS résident ;Rend le segment GS résident
MBresident: MBresident:
push bx es push bx es
mov bx,gs mov bx,gs
dec bx dec bx
dec bx
mov es,bx mov es,bx
mov es:[MB.IsResident],True mov es:[MB.IsResident],True
pop es bx pop es bx
ret ret
end start

View File

@ -6,6 +6,7 @@ smart
org 0100h org 0100h
include ..\include\fat.h include ..\include\fat.h
include ..\include\mem.h
start: start:
push cs push cs
@ -16,39 +17,17 @@ pop ds
pop es pop es
pop fs pop fs
pop gs pop gs
;xor ax,ax xor ax,ax
;mov ds,ax mov ds,ax
;mov si,7C00h mov si,7C00h
mov si,offset eepop
mov di,offset myboot mov di,offset myboot
mov cx,type bootsector mov cx,type bootsector
push cs push cs
pop es pop es
rep movsb rep movsb
push cs
pop ds
jmp noone jmp noone
eepop db 0,0,0
bootdb db 'COS2000A' ;Fabricant + n°série Formatage
sizec dw 512 ;octet/secteur
db 1 ;secteur/cluster
reserv dw 1 ;secteur reserv
nbfat db 2 ;nb de copie de la FAT
nbfit dw 224 ;taille rep racine
allclu dw 2880 ;nb secteur du volume si < 32 még
db 0F0h ;Descripteur de média
fatsize dw 9 ;secteur/FAT
nbtrack dw 18 ;secteur/piste
head dw 2 ;nb de tˆteb de lecture/écriture
hidden dd 0 ;nombre de secteur cachs
dd 0 ;si nbsecteur = 0 nbsect ; the number of sectors
bootdrv db 0 ;Lecteur de dmarrage
bootsig db 0 ;NA
db 29h ;boot signature 29h
bootsig2 dd 01020304h ;no de serie
pope db 'COS2000 ' ;nom de volume
db 'FAT12 ' ;FAT
xor ax,ax xor ax,ax
mov es,ax mov es,ax
mov di,1Eh*4 mov di,1Eh*4
@ -70,11 +49,17 @@ noone:
pop es pop es
pop fs pop fs
pop gs pop gs
mov si,offset present
mov bl,4
call showstr
mov si,offset premice2
mov bl,7
call showstr
call MBinit
jc nomem1
call InitDrive call InitDrive
mov si,offset premice mov si,offset premice
mov bx,7 mov bl,7
call showstr call showstr
mov si,offset next mov si,offset next
call showstr call showstr
@ -87,30 +72,19 @@ noone:
mov di,offset loadinglist mov di,offset loadinglist
call loadfile call loadfile
jc noconfread jc noconfread
mov si,offset debut mov si,offset debut
mov bx,7 mov bl,7
call showstr call showstr
mov bx,500h
xor cx,cx xor cx,cx
mov si,offset loadinglist mov si,offset loadinglist
suiteloading: suiteloading:
call readline call readline
jc noconfload jc noconfload
push bx si
mov bl,7 mov bl,7
push si
mov si,offset next mov si,offset next
call showstr call showstr
pop si bx pop si
call showstr
mov dx,bx
push bx si
mov bx,7
mov si,offset address
call showstr
mov cx,16
call showhex
mov si,offset addressend
call showstr call showstr
xor bp,bp xor bp,bp
mov dx,ax mov dx,ax
@ -129,14 +103,15 @@ noadder:
mov bp,1 mov bp,1
sub dx,68h sub dx,68h
haveirq: haveirq:
push si
mov si,offset irqs mov si,offset irqs
call showstr call showstr
mov cx,4 mov cx,4
call showhex call showhex
mov si,offset irqsend mov si,offset irqsend
call showstr call showstr
pop si
noadd: noadd:
pop si bx
cmp bp,1 cmp bp,1
jne install jne install
call replacehandler call replacehandler
@ -145,11 +120,24 @@ install:
call installhandler call installhandler
suites: suites:
jc nohandlerload jc nohandlerload
add bx,0F00h mov dx,es
mov bl,7
push si
mov si,offset address
call showstr
mov cx,16
call showhex
mov si,offset addressend
call showstr
inc cx inc cx
pop si
call nextline call nextline
jnz suiteloading jnz suiteloading
;initialisation des MCBs
mov ah,0
int 49h
mov si,offset fini mov si,offset fini
mov bl,7 mov bl,7
call showstr call showstr
@ -157,13 +145,10 @@ suites:
call showstr call showstr
mov si,offset prompt mov si,offset prompt
call showstr call showstr
mov ax,6000h call projfile
mov es,ax
push ax
mov di,0100h
push di
call loadfile
jc nopromptload jc nopromptload
push es
push 0100h
push 7202h push 7202h
popf popf
push es push es
@ -191,6 +176,19 @@ noconfread:
mov bl,4 mov bl,4
call showstr call showstr
jmp erroron jmp erroron
nomem1:
mov si,offset premice2e
mov bl,4
call showstr
jmp erroron
nomem2:
mov si,offset premice3e
mov bl,4
call showstr
jmp erroron
noconfload: noconfload:
mov di,si mov di,si
@ -235,28 +233,35 @@ confe db 0Dh,0Ah,'Erreur dans le fichier de configuration a la ligne ',0
confee db 0Dh,0Ah,'Erreur de lecture du fichier de configuration',0 confee db 0Dh,0Ah,'Erreur de lecture du fichier de configuration',0
confe2 db ' caractere ',0 confe2 db ' caractere ',0
erreur db 0Dh,0Ah,'Pressez une touche pour redemarrer...',0 erreur db 0Dh,0Ah,'Pressez une touche pour redemarrer...',0
present db 0Dh,0Ah,'COS2000 Version 1.2',0
premice2 db 0Dh,0Ah,'Initialisation de la memoire',0
premice2e db 0Dh,0Ah,'Erreur lors de l''initialisation memoire',0
premice3e db 0Dh,0Ah,'Erreur lors de la reservation memoire',0
;==positionne si sur l'entrée suivante de la loading liste jusqu'a equal ;==positionne si sur l'entrée suivante de la loading liste jusqu'a equal
nextline: nextline:
push ax cx di push ax cx di
push cs
pop es
mov di,si mov di,si
mov al,0Ah mov al,0Ah
mov cx,20 mov cx,20
cld
repnz scasb repnz scasb
mov si,di mov si,di
cmp byte ptr [di],0 cmp byte ptr [di],0
pop di cx ax pop di cx ax
ret ret
;==Lit la loading list et initialise SI(Fichier) BX(adresse) AX(interruption) ;==Lit la loading list et initialise SI(Fichier) AX(interruption)
readline: readline:
push cx dx di es push cx dx di es
push ds push cs
pop es pop es
;Voir taille de la ligne -> DX ;Voir taille de la ligne -> DX
mov di,si mov di,si
mov al,0Dh mov al,0Dh
mov cx,20 mov cx,20
cld
repne scasb repne scasb
sub cx,20 sub cx,20
neg cx neg cx
@ -334,14 +339,23 @@ ShowHex:
neg cx neg cx
shl edx,cl shl edx,cl
shr di,2 shr di,2
mov ah,0Eh mov ah,09h
and bx,1111b and bx,1111b
Hexaize: Hexaize:
rol edx,4 rol edx,4
mov si,dx mov si,dx
and si,1111b and si,1111b
mov al,[si+offset tab] mov al,[si+offset tab]
int 10h push cx
mov cx,1
cmp al,32
jb control2
mov ah,09h
int 10h
control2:
mov ah,0Eh
int 10h
pop cx
dec di dec di
jnz Hexaize jnz Hexaize
pop di si edx cx bx ax pop di si edx cx bx ax
@ -350,29 +364,298 @@ Tab db '0123456789ABCDEF'
;==============================Affiche une chaine DS:SI de couleur BL============== ;==============================Affiche une chaine DS:SI de couleur BL==============
showstr: showstr:
push ax bx si push ax bx cx si
mov cx,1
again: again:
lodsb lodsb
or al,al or al,al
jz fin jz fin
and bx,0111b
cmp al,32
jb control
mov ah,09h
int 10h
control:
mov ah,0Eh mov ah,0Eh
and bx,1111b
int 10h int 10h
jmp again jmp again
fin: fin:
pop si bx ax pop si cx bx ax
ret ret
;================================================
;Routine de débogage
;================================================
regdata:
eaxr dd 0
ebxr dd 0
ecxr dd 0
edxr dd 0
esir dd 0
edir dd 0
espr dd 0
ebpr dd 0
csr dw 0
dsr dw 0
esr dw 0
fsr dw 0
gsr dw 0
ssr dw 0
reg db 0Dh,0Ah,"eax : ",0
db 0Dh,0Ah,"ebx : ",0
db 0Dh,0Ah,"ecx : ",0
db 0Dh,0Ah,"edx : ",0
db 0Dh,0Ah,"esi : ",0
db 0Dh,0Ah,"edi : ",0
db 0Dh,0Ah,"esp : ",0
db 0Dh,0Ah,"ebp : ",0
db 0Dh,0Ah,"cs : ",0
db 0Dh,0Ah,"ds : ",0
db 0Dh,0Ah,"es : ",0
db 0Dh,0Ah,"fs : ",0
db 0Dh,0Ah,"gs : ",0
db 0Dh,0Ah,"ss : ",0
showreg:
pushad
pushf
push ds
mov cs:[eaxr],eax
mov cs:[ebxr],ebx
mov cs:[ecxr],ecx
mov cs:[edxr],edx
mov cs:[esir],esi
mov cs:[edir],edi
mov cs:[espr],esp
mov cs:[ebpr],ebp
mov cs:[csr],cs
mov cs:[dsr],ds
mov cs:[esr],es
mov cs:[fsr],fs
mov cs:[gsr],gs
mov cs:[ssr],ss
push cs
pop ds
mov si,offset poppp
call Showstr
mov si,offset reg
mov di,offset regdata
mov bx,7
showregs:
cmp byte ptr cs:[si+6],":"
jne endshowregs
call Showstr
cmp byte ptr cs:[si+4]," "
je segsss
mov edx,cs:[di]
mov cx,32
call Showhex
add di,4
jmp showmax
segsss:
mov dx,cs:[di]
mov cx,16
call Showhex
add di,2
showmax:
add si,9
mov bp,dx
push si
mov si,offset beginds
call showstr
mov si,bp
mov cx,8
mov al,0
letshow:
mov dl,ds:[si]
inc si
call showhex
inc al
cmp al,10
jb letshow
mov si,offset ende
call showstr
mov si,offset begines
call showstr
mov si,bp
mov cx,8
mov al,0
letshow2:
mov dl,es:[si]
inc si
call showhex
inc al
cmp al,10
jb letshow2
mov si,offset ende
call showstr
pop si
jmp showregs
endshowregs:
mov si,offset poppp
call Showstr
xor ax,ax
int 16h
pop ds
popf
popad
ret
begines db ' es[',0
beginds db ' ds[',0
ende db '] ',0
;vide ES pour 200 octets (pour test)
showmem:
pushad
pushf
mov si,offset poppp
mov bx,7
call Showstr
mov dx,es
mov cx,16
mov bx,7
call ShowHex
mov si,offset poppp
mov bx,7
call Showstr
xor si,si
loopererr:
mov dx,es:[si]
mov cx,8
mov bx,7
call ShowHex
inc si
cmp si,200
jb loopererr
mov si,offset poppp
mov bx,7
call Showstr
xor ax,ax
int 16h
popf
popad
ret
poppp db 0Ah,0Dh,'*********',0Ah,0Dh,0
;================================================
;Routine de gestion de la mémoire
;================================================
include ..\include\mem.h
FirstMB dw 0
;Initialise les blocs de mémoire en prenant GS pour segment de base
MBinit:
push ax cx es
mov ax,memorystart
mov cs:Firstmb,ax
mov cx,0A000h
sub cx,ax
dec ax
dec ax
mov es,ax
mov es:[MB.Reference],Free
mov es:[MB.Sizes],cx
mov es:[MB.Check],'NH'
mov dword ptr es:[MB.Names],'eerF'
mov dword ptr es:[MB.Names+4],0
mov es:[MB.IsNotLast],False
clc
pop es cx ax
ret
notforfree:
stc
pop es cx ax
ret
;Creér un bloc de nom ds:si de taille cx (octets) -> n°segment dans GS
MBCreate:
push ax bx cx dx si di es
shr cx,4
inc cx
mov bx,cs:firstmb
dec bx
dec bx
mov dl,1
searchfree:
cmp dl,False
je wasntgood
mov es,bx
cmp es:[MB.Check],'NH'
jne wasntgood
cmp es:[MB.IsNotLast],True
sete dl
cmp es:[MB.Reference],Free
jne notsogood
mov ax,es:[MB.Sizes]
cmp cx,ax
ja notsogood
mov word ptr es:[MB.Check],'NH'
mov es:[MB.IsNotLast],True
mov es:[MB.Reference],cs
mov es:[MB.IsResident],True
mov es:[MB.Sizes],cx
mov di,MB.Names
push ax cx
mov cx,32
loops:
mov dh,[si]
inc si
dec cx
jz endofloops
cmp dh,0
je endofloops
mov es:[di],dh
inc di
jmp loops
endofloops:
inc cx
mov al,0
rep stosb
pop cx ax
sub ax,cx
dec ax
dec ax
;js nofree
inc bx
inc bx
mov gs,bx
add bx,cx
mov es,bx
mov es:[MB.IsNotLast],dl
mov es:[MB.IsResident],False
mov es:[MB.Reference],Free
mov es:[MB.Sizes],ax
mov dword ptr es:[MB.Names],'eerF'
mov dword ptr es:[MB.Names+4],0
mov es:[MB.Check],'NH'
nofree:
clc
pop es di si dx cx bx ax
ret
wasntgood:
stc
pop es di si dx cx bx ax
ret
notsogood:
inc bx
inc bx
add bx,es:[MB.Sizes]
jmp searchfree
;================================================ ;================================================
;Routine de gestion de handler ;Routine de gestion de handler
;================================================ ;================================================
;remplace le handler pointer par ds:si en bx:100h interruption ax ;remplace le handler pointer par ds:si en bloc:100h interruption ax
replacehandler: replacehandler:
push ax bx cx si di ds es push ax bx cx si di ds
mov es,bx call projfile
mov di,0100h
call loadfile
jc reph jc reph
mov bx,ax mov bx,ax
call getint call getint
@ -380,36 +663,34 @@ mov es:[102h],si
mov es:[104h],ds mov es:[104h],ds
call setint call setint
reph: reph:
pop es ds di si cx bx ax pop ds di si cx bx ax
ret ret
;install le handler pointer par ds:si en bx:100h interruption ax ;install le handler pointer par ds:si en bloc:100h interruption ax -> es
installhandler: installhandler:
push bx cx di es push bx cx
mov es,bx call projfile
mov di,100h
call loadfile
jc insh jc insh
mov bx,ax mov bx,ax
call setint call setint
insh: insh:
pop es di cx bx pop cx bx
ret ret
;met es:di le handle de l'int bx ;met es:100h le handle de l'int bx
setint: setint:
push ax bx ds push ax bx ds
cli cli
shl bx,2 shl bx,2
xor ax,ax xor ax,ax
mov ds,ax mov ds,ax
mov ds:[bx],di mov word ptr ds:[bx],0100h
mov ds:[bx+2],es mov ds:[bx+2],es
pop ds bx ax pop ds bx ax
sti sti
ret ret
;met ds:si le handle de l'int bx ;met dans ds:si le handle de l'int bx
getint: getint:
push ax bx es push ax bx es
shl bx,2 shl bx,2
@ -480,6 +761,41 @@ nocarry:
pop si dx bx ax pop si dx bx ax
ret ret
;============projfile (Fonction 17)===============
;Charge le fichier ds:si sur un bloc mémoire -> ecx taille -> es bloc
;-> AH=17
;<- Flag Carry si erreur
;=====================================================
projfile:
push eax bx di gs
push cs
pop es
call uppercase
mov di,offset tempfit
call searchfile
jne errorload
jc errorload
mov eax,cs:tempfit.FileSize
mov ecx,eax
add ecx,100h
call MBCreate
jc errorload
push gs
pop es
mov cx,cs:tempfit.FileGroup
mov di,100h
call loadway
jc errorload
clc
mov ecx,eax
pop gs di bx eax
ret
errorload:
stc
mov ecx,0
pop gs di bx eax
ret
;============loadfile (Fonction 4)=============== ;============loadfile (Fonction 4)===============
;Charge le fichier ds:si en es:di ->ecx taille ;Charge le fichier ds:si en es:di ->ecx taille
;-> AH=4 ;-> AH=4
@ -498,12 +814,12 @@ loadfile:
mov cx,cs:tempfit.FileGroup mov cx,cs:tempfit.FileGroup
mov eax,cs:tempfit.FileSize mov eax,cs:tempfit.FileSize
call loadway call loadway
jc errorload jc errorload2
clc clc
;mov ecx,eax ;mov ecx,eax
pop di bx eax pop di bx eax
ret ret
errorload: errorload2:
stc stc
mov ecx,0 mov ecx,0
pop di bx eax pop di bx eax
@ -652,7 +968,7 @@ zeroload:
ret ret
noway: noway:
stc stc
pop es ds ebp di si dx bx eax pop es ds ecx di si dx bx eax
ret ret
;=============INITDRIVE (Fonction 04H)=============== ;=============INITDRIVE (Fonction 04H)===============

View File

@ -1,7 +1,9 @@
mcb.sys(49)
video.sys(47) video.sys(47)
horloge.sys(8) horloge.sys(8)
8259a.sys(50) 8259a.sys(50)
disque.sys(48) disque.sys(48)
souris.sys(74) souris.sys(74)
heure.sys(8)
clavier.sys(9) clavier.sys(9)
heure.sys(8) port.sys(D)

View File

@ -100,6 +100,7 @@ tables dw setvideomode ;Table qui contient les adresses de toutes les fonctions
dw showname dw showname
dw showattr dw showattr
dw showsize dw showsize
dw getchar
;================================Table des modes videos (64 BYTES) ============================================ ;================================Table des modes videos (64 BYTES) ============================================
;40*25 16 couleurs ;40*25 16 couleurs
@ -226,7 +227,7 @@ Attribs equ 03C0h
graphics equ 03CEh graphics equ 03CEh
statut equ 03DAh statut equ 03DAh
maxfunc equ 48 maxfunc equ 39h
maxmode equ 9 maxmode equ 9
planesize equ 64000 planesize equ 64000
;============================================Fonctions de l'int VIDEO=========================================== ;============================================Fonctions de l'int VIDEO===========================================
@ -1274,6 +1275,20 @@ getxy:
;===================================== ;=====================================
setxy: setxy:
push ax bx cx dx push ax bx cx dx
; xor ax,ax
; int 16h
; mov cl,cs:lines
; dec cl
; sub cl,bl
; neg cl
; js zero
; xor ch,ch
; inc cl
; jmp nozero
;zero:
; mov cx,0
;nozero:
; call scrolldown
mov cs:x,bh mov cs:x,bh
mov cs:y,bl mov cs:y,bl
mov al,bl mov al,bl
@ -1298,6 +1313,7 @@ setxy:
oktext: oktext:
mov ax,0B800h mov ax,0B800h
mov es,ax mov es,ax
call setcursor
endofsetxy: endofsetxy:
pop dx cx bx ax pop dx cx bx ax
ret ret
@ -1507,12 +1523,59 @@ waitr:
pop dx ax pop dx ax
ret ret
;Renvoie le caractère sur le curseur en dl
getchar:
push ax di es
mov ax,0B800h
mov es,ax
mov di,cs:xy
mov dl,es:[di]
pop es di ax
ret
;Ecrit le caractère ASCII CL attribut CH aprés le curseur, en le mettant à jours ;Ecrit le caractère ASCII CL attribut CH aprés le curseur, en le mettant à jours
charout: charout:
push ax bx cx dx di es push ax bx cx dx di es
cmp byte ptr cs:graphics,1 cmp byte ptr cs:graphics,1
jne textaccess jne textaccess
mov dx,cx call emulatechar
jmp adjusttext
textaccess:
mov ax,0B800h
mov es,ax
mov di,cs:xy
mov es:[di],cx
add cs:xy,2
adjusttext:
inc cs:x
mov cl,cs:columns
cmp cs:x,cl
jb noadjusted
call showline
noadjusted:
call setcursor
pop es di dx cx bx ax
ret
setcursor:
push ax cx dx
mov dx,CCRT
mov al,0Eh
mov cx,cs:xy
shr cx,1
mov ah,ch
out dx,ax
mov ah,cl
inc al
out dx,ax
pop dx cx ax
ret
;Ecrit le caractère ASCII CL attribut CH aprés le curseur graphique, en le mettant à jours en mode graphique
emulatechar:
push ax bx cx dx di
mov dx,cx
mov di,dx mov di,dx
and di,11111111b and di,11111111b
shl di,3 shl di,3
@ -1548,198 +1611,315 @@ transparent:
mov cx,cs:linesize mov cx,cs:linesize
shl cx,2 shl cx,2
cmp cs:xg,cx cmp cs:xg,cx
jb adjusttext jb ended
mov cs:xg,0 mov cs:xg,0
add cs:yg,8 add cs:yg,8
jmp adjusttext ended:
textaccess: pop di dx cx bx ax
mov ax,0B800h
mov es,ax
mov di,cs:xy
mov es:[di],cx
add cs:xy,2
adjusttext:
inc cs:x
mov cl,cs:columns
cmp cs:x,cl
jb noadjusted
call showline
noadjusted:
;mov dx,3D4h
;mov al,0Eh
;mov di,offset xy
;mov ah,cs:[di]
;out dx,ax
;mov ah,cs:[di+1]
;dec al
;out dx,ax
pop es di dx cx bx ax
ret
;===================================sauve l'ecran rapidement================
SaveScreen:
push cx si di ds es
mov cx,0B800H
mov ds,cx
push cs
pop es
mov cx,cs:pagesize
shr cx,2
xor si,si
mov di,offset Copy2
cld
rep movsd
pop es ds di si cx
ret ret
;sauve l'ecran dans un bloc de mémoire
savescreen:
push ax cx dx si di bp ds es gs
mov bp,sp
mov dx,ss:[bp+22]
mov ah,2
mov cx,cs:pagesize
push cs
pop ds
mov si,offset data3
int 49h
mov ah,6
int 49h
push gs
pop es
xor di,di
call savescreento
pop gs es ds bp di si dx cx ax
ret
data3 db '/vgascreen',0
;===================================sauve l'ecran rapidement en es:di================ ;===================================sauve l'ecran rapidement en es:di================
SaveScreento: SaveScreento:
push cx si di ds push cx si di ds
mov cx,0B800H mov cx,0B800h
mov ds,cx mov ds,cx
xor ecx,ecx
mov cx,cs:pagesize mov cx,cs:pagesize
shr cx,2 shr cx,2
xor si,si xor si,si
cld cld
rep movsd rep movsd
pop ds di si cx pop ds di si cx
ret
;===================================sauve l'ecran rapidement================
Savepage1:
push cx si di ds es
mov cx,0B800H
mov ds,cx
push cs
pop es
mov cx,cs:pagesize
shr cx,2
xor si,si
mov di,offset Copy
cld
rep movsd
pop es ds di si cx
ret ret
;===================================sauve l'ecran rapidement================ ;===================================sauve les parametres en es:di================
RestoreScreen: Saveparamto:
push cx si di ds es push ecx si di ds
mov cx,0B800H
mov es,cx
push cs push cs
pop ds pop ds
xor ecx,ecx
mov cx,datablocksize
mov si,offset datablock
cld
rep movsb
pop ds di si ecx
ret
;===================================restore les parametres depuis en ds:si================
Restoreparamfrom:
push ecx si di es
push cs
pop es
xor ecx,ecx
mov cx,datablocksize
mov di,offset datablock
cld
rep movsb
pop es di si ecx
ret
;sauve la page1 dans un bloc de mémoire
Savepage1:
push ax cx dx si di bp ds es gs
mov bp,sp
mov dx,ss:[bp+22]
mov ah,2
mov cx,cs:pagesize
push cs
pop ds
mov si,offset data4
int 49h
mov ah,6
int 49h
push gs
pop es
xor di,di
call Savepage1to
pop gs es ds bp di si dx cx ax
ret
data4 db '/vgapage1',0
;===================================sauve l'ecran rapidement================
Savepage1to:
push ecx si di ds
mov cx,0B800H
mov ds,cx
xor ecx,ecx
mov cx,cs:pagesize mov cx,cs:pagesize
shr cx,2 shr cx,2
mov si,offset Copy2 mov si,cs:pagesize
xor di,di
cld cld
rep movsd rep movsd
pop es ds di si cx pop ds di si ecx
ret ret
;RcupŠre l'ecran de la carte depuis son bloc mémoire
RestoreScreen:
push ax dx si bp ds gs
mov bp,sp
mov dx,ss:[bp+16]
push cs
pop ds
mov si,offset data3
mov ah,9
int 49h
push gs
pop ds
xor si,si
call restorescreenfrom
pop gs ds bp si dx ax
ret
;===================================restore l'ecran rapidement de ds:si================ ;===================================restore l'ecran rapidement de ds:si================
RestoreScreenfrom: RestoreScreenfrom:
push cx si di ds es push ecx si di ds es
mov cx,0B800H mov cx,0B800H
mov es,cx mov es,cx
xor ecx,ecx
mov cx,cs:pagesize mov cx,cs:pagesize
shr cx,2 shr cx,2
xor di,di xor di,di
cld cld
rep movsd rep movsd
pop es ds di si cx pop es ds di si ecx
ret ret
;===============================Page2to1============================ ;===============================Page2to1============================
Page2to1: Page2to1:
push cx si di ds es push ecx si di ds es
mov cx,0B800H mov cx,0B800H
mov es,cx mov es,cx
mov ds,cx mov ds,cx
xor ecx,ecx
mov cx,cs:pagesize mov cx,cs:pagesize
shr cx,2 shr cx,2
mov si,4000 mov si,cs:pagesize
xor di,di xor di,di
cld cld
rep movsd rep movsd
pop es ds di si cx pop es ds di si ecx
ret ret
;===============================Page1to2============================ ;===============================Page1to2============================
Page1to2: Page1to2:
push cx si di ds es push ecx si di ds es
mov cx,0B800H mov cx,0B800H
mov es,cx mov es,cx
mov ds,cx mov ds,cx
xor ecx,ecx
mov cx,cs:pagesize mov cx,cs:pagesize
shr cx,2 shr cx,2
mov di,4000 mov di,cs:pagesize
xor si,si xor si,si
cld cld
rep movsd rep movsd
pop ds es di si cx pop ds es di si ecx
ret ret
;===============================xchgPages============================ ;===============================xchgPages============================
xchgPages: xchgPages:
push cx si di ds es push ax cx dx si di bp ds es gs
call savepage1 mov bp,sp
call page2to1 mov dx,ss:[bp+22]
mov cx,0B800H mov ah,2
mov es,cx mov cx,datablocksize
push cs add cx,cs:pagesize
pop ds add cx,3*256
mov cx,cs:pagesize push cs
shr cx,2 pop ds
mov si,offset Copy mov si,offset data4
mov di,4000 int 49h
rep movsd mov ah,6
pop es ds di si cx int 49h
ret push gs
pop es
;Sauve l'tat de la carte en es:di xor di,di
savestate: call savescreento
push cx si di ds call Page2to1
push cs push gs
pop ds pop ds
mov cx,datablocksize xor si,si
mov si,offset lines mov cx,0B800H
mov es,cx
mov di,cs:pagesize
xor ecx,ecx
mov cx,cs:pagesize
shr cx,2
cld cld
rep movsb rep movsd
call savescreento mov ah,01h
pop ds di si cx int 49h
pop gs es ds bp di si dx cx ax
ret ret
;RcupŠre l'tat de la carte en ds:si
restorestate:
push ax cx si di es
mov al,[si+7]
cmp cs:mode,al
je nochangemode
mov ah,0
call setvideomode
nochangemode:
push cs
pop es
mov cx,datablocksize
mov di,offset lines
cld
rep movsb
call restorescreenfrom
pop es di si cx ax
ret
;sauve le DAC ;Sauve l'tat de la carte dans un bloc mémoire
savestate:
push ax cx dx si di bp ds es gs
mov bp,sp
mov dx,ss:[bp+22]
mov ah,2
mov cx,datablocksize
add cx,cs:pagesize
add cx,3*256
push cs
pop ds
mov si,offset data
int 49h
mov ah,6
int 49h
push gs
pop es
xor di,di
call saveparamto
add di,datablocksize
call savescreento
add di,cs:pagesize
call savedacto
pop gs es ds bp di si dx cx ax
ret
data db '/vga',0
;RcupŠre l'tat de la carte depuis son bloc mémoire
restorestate:
push ax dx si bp ds gs
mov bp,sp
mov dx,ss:[bp+16]
push cs
pop ds
mov si,offset data
mov ah,9
int 49h
push gs
pop ds
mov al,ds:[7]
cmp cs:mode,al
je nochangemode
mov ah,0
call setvideomode
nochangemode:
xor si,si
call restoreparamfrom
add si,datablocksize
call restorescreenfrom
add si,cs:pagesize
call restoredacfrom
pop gs ds bp si dx ax
ret
;sauve le DAC dans un bloc de mémoire
savedac: savedac:
push ax cx dx si di bp ds es gs
mov bp,sp
mov dx,ss:[bp+22]
mov ah,2
mov cx,3*256
push cs
pop ds
mov si,offset data2
int 49h
mov ah,6
int 49h
push gs
pop es
xor di,di
call savedacto
pop gs es ds bp di si dx cx ax
ret
data2 db '/vgadac',0
;RcupŠre le dac depuis son bloc mémoire
restoredac:
push ax dx si bp ds gs
mov bp,sp
mov dx,ss:[bp+16]
push cs
pop ds
mov si,offset data2
mov ah,9
int 49h
push gs
pop ds
xor si,si
call restoredacfrom
pop gs ds bp si dx ax
ret
;sauve le DAC en es:di
savedacto:
push ax cx dx di push ax cx dx di
mov dx,3C7h mov dx,3C7h
mov cx,256 mov cx,256
mov di,offset dac
save: save:
mov al,cl mov al,cl
dec al dec al
@ -1747,13 +1927,13 @@ out dx,al
inc dx inc dx
inc dx inc dx
in al,dx in al,dx
mov cs:[di],al mov es:[di],al
inc di inc di
in al,dx in al,dx
mov cs:[di],al mov es:[di],al
inc di inc di
in al,dx in al,dx
mov cs:[di],al mov es:[di],al
inc di inc di
dec dx dec dx
dec dx dec dx
@ -1762,25 +1942,24 @@ jne save
pop di dx cx ax pop di dx cx ax
ret ret
;restore le DAC ;restore le DAC depuis ds:si
restoredac: restoredacfrom:
push ax cx dx si push ax cx dx si
xor ax,ax xor ax,ax
mov dx,3C8h mov dx,3C8h
mov cx,256 mov cx,256
mov si,offset dac
save2: save2:
mov al,cl mov al,cl
dec al dec al
out dx,al out dx,al
inc dx inc dx
mov al,cs:[si] mov al,ds:[si]
inc si inc si
out dx,al out dx,al
mov al,cs:[si] mov al,ds:[si]
inc si inc si
out dx,al out dx,al
mov al,cs:[si] mov al,ds:[si]
inc si inc si
out dx,al out dx,al
dec dx dec dx
@ -1814,8 +1993,5 @@ include ..\include\pol8x8.inc
font8x16: font8x16:
include ..\include\pol8x16.inc include ..\include\pol8x16.inc
copy equ $
copy2 equ $+8192
dac equ $+8192+8192
end start end start

View File

@ -2,56 +2,61 @@ lnk_boot = tlink /x
asm= tasm /t/m5/zi asm= tasm /t/m5/zi
lnk= tlink /x/t lnk= tlink /x/t
all: detect.exe editeur.exe gestion.exe logo.exe pmode.exe souris.exe test.exe verifier.exe volume.exe all: detect.com editeur.com gestion.com logo.com pmode.com souris.com test.com verifier.com volume.com memoire.com
detect.exe: detect.asm memoire.com: memoire.asm
$(asm) memoire
$(lnk) memoire
ren memoire.com memoire.com
detect.com: detect.asm
$(asm) detect $(asm) detect
$(lnk) detect $(lnk) detect
ren detect.com detect.exe ren detect.com detect.com
editeur.exe: editeur.asm editeur.com: editeur.asm
$(asm) editeur $(asm) editeur
$(lnk) editeur $(lnk) editeur
ren editeur.com editeur.exe ren editeur.com editeur.com
gestion.exe: gestion.asm gestion.com: gestion.asm
$(asm) gestion $(asm) gestion
$(lnk) gestion $(lnk) gestion
ren gestion.com gestion.exe ren gestion.com gestion.com
logo.exe: logo.asm logo.com: logo.asm
$(asm) logo $(asm) logo
$(lnk) logo $(lnk) logo
ren logo.com logo.exe ren logo.com logo.com
pmode.exe: pmode.asm pmode.com: pmode.asm
$(asm) pmode $(asm) pmode
$(lnk) pmode $(lnk) pmode
ren pmode.com pmode.exe ren pmode.com pmode.com
souris.exe: souris.asm souris.com: souris.asm
$(asm) souris $(asm) souris
$(lnk) souris $(lnk) souris
ren souris.com souris.exe ren souris.com souris.com
test.exe: test.asm test.com: test.asm
$(asm) test $(asm) test
$(lnk) test $(lnk) test
ren test.com test.exe ren test.com test.com
verifier.exe: verifier.asm verifier.com: verifier.asm
$(asm) verifier $(asm) verifier
$(lnk) verifier $(lnk) verifier
ren verifier.com verifier.exe ren verifier.com verifier.com
volume.exe: volume.asm volume.com: volume.asm
$(asm) volume $(asm) volume
$(lnk) volume $(lnk) volume
ren volume.com volume.exe ren volume.com volume.com
clean: clean:
del *.obj del *.obj
del *.exe del *.com
del *.com del *.com
del *.sys del *.sys
del *.err del *.err

View File

@ -157,15 +157,13 @@ xor cl,cl
inc al inc al
cmp al,16 cmp al,16
jbe search jbe search
xor ax,ax
int 16h
db 0CBh db 0CBh
msg3 db ' Classe :',0 msg3 db ' Classe :',0
msg1 db 'Peripherique :',0 msg1 db 'Peripherique :',0
msg2 db ' Constructeur :',0 msg2 db ' Constructeur :',0
msg4 db ' iD :',0 msg4 db ' iD :',0
msg db 'COS2000 hardware detecteur V1.1',0 msg db 'COS2000 hardware detecteur V1.6',0
pcivers db 'BIOS PCI version ',0 pcivers db 'BIOS PCI version ',0
pcivers2 db ' a ete detecte !',0 pcivers2 db ' a ete detecte !',0
nbbuses db 'Nombre de bus : ',0 nbbuses db 'Nombre de bus : ',0

View File

@ -8,6 +8,8 @@ start:
mov ax,0305h mov ax,0305h
mov bx,0008h mov bx,0008h
int 16h int 16h
mov ah,28h
int 47h
mov ax,0002 mov ax,0002
int 47H int 47H
mov ah,2 mov ah,2
@ -285,7 +287,7 @@ cursor:
suit7: suit7:
cmp ax,4200h cmp ax,4200h
jne adres jne adres
mov ah,27 mov ah,29h
int 47h int 47h
db 0CBH ; +++++++ db 0CBH ; +++++++
ret ret

View File

@ -161,6 +161,9 @@ tre3:
tre4: tre4:
cmp ah,67 cmp ah,67
jne endof jne endof
mov ah,15h
mov cl,7
int 47h
db 0CBh db 0CBh
;selectionne la ligne xx ;selectionne la ligne xx
@ -184,11 +187,11 @@ ret
xx dw 1 xx dw 1
xxold dw 0 xxold dw 0
menu db '[F1] Lire disque [F9] Quitter ',0 menu db '[F1] Lire disque [F9] Quitter ',0
msg1 db ' Gestionnaire de fichier Version 1.0 ',0 msg1 db ' Gestionnaire de fichier Version 1.5 ',0
msg2 db 'Programme en cours de chargement',0 msg2 db 'Programme en cours de chargement',0
prompt db '--------------------------------------------------------------------------------',0 prompt db '--------------------------------------------------------------------------------',0
infos db 'Nom Ext. Date creation Date modification Taille Attributs',0 infos db 'Nom Ext. Date creation Date modification Taille Attributs',0
bufferentry equ $ bufferentry db 512 dup (0)
end start end start

View File

@ -5,18 +5,27 @@ org 0100h
start: start:
mov ah,7
mov cx,65535
int 49h
jc problem3
push gs
pop es
mov ah,7
mov cx,65535
int 49h
jc problem3
mov si,offset logo mov si,offset logo
mov ah,4 mov ah,4
xor di,di xor di,di
mov bx,8000h
mov es,bx
int 48h int 48h
jc problem jc problem
push es push es
pop ds pop ds
mov bx,7000h push gs
mov es,bx pop es
xor si,si xor si,si
xor di,di xor di,di
mov ah,6 mov ah,6
@ -27,9 +36,9 @@ push es
pop ds pop ds
xor si,si xor si,si
mov ax,0008h mov ah,28h
int 47h int 47h
mov ah,38 mov ax,0008h
int 47h int 47h
mov ah,2 mov ah,2
int 47h int 47h
@ -47,10 +56,8 @@ mov si,offset poper
int 47h int 47h
mov ax,0 mov ax,0
int 16h int 16h
mov ah,39 mov ah,29h
int 47h int 47h
mov ax,0004
int 47h
db 0CBH db 0CBH
problem: problem:
@ -73,10 +80,21 @@ mov ax,0
int 16h int 16h
db 0CBh db 0CBh
problem3:
push cs
pop ds
mov ah,13
mov si,offset error3
int 47h
mov ax,0
int 16h
db 0CBh
poper db 'COS2000 en mode graphique',0 poper db 'COS2000 en mode graphique',0
logo db 'cos.rip',0 logo db 'cos.rip',0
ok1 db 'Chargement de l''image OK',0 ok1 db 'Chargement de l''image OK',0
ok2 db 'Decompression de l''image OK',0 ok2 db 'Decompression de l''image OK',0
error3 db 'Une erreur est apparue lors de l''allocation de mémoire',0
error db 'Une erreur est apparue lors du chargement de l''image',0 error db 'Une erreur est apparue lors du chargement de l''image',0
error2 db 'Une erreur est apparue lors de la decompression de l''image',0 error2 db 'Une erreur est apparue lors de la decompression de l''image',0
end start end start

89
programs/memoire.asm Normal file
View File

@ -0,0 +1,89 @@
.model tiny
.486
smart
.code
org 0100h
include ..\include\mem.h
include ..\include\divers.h
start:
mov si,offset msg
mov ah,13
int 47h
mov ah,6
int 47h
mov si,offset menu
mov ah,13
int 47h
mov ah,6
int 47h
xor cx,cx
listmcb:
mov ah,4
int 49h
jc fino
inc cx
mov ah,18h
int 47h
push gs
pop ds
mov bh,0
mov si,MB.Names
mov ah,14h
int 47h
mov bh,15
xor edx,edx
mov dx,ds:[MB.Sizes]
shl edx,4
mov ah,0Fh
int 47h
mov bh,24
cmp ds:[MB.IsResident],true
push cs
pop ds
jne notresident
mov si,offset resident
mov ah,14h
int 47h
jmp suitelistmcb
notresident:
mov si,offset nonresident
mov ah,14h
int 47h
suitelistmcb:
mov bh,30
cmp gs:[MB.Reference],0
je next
cmp gs:[MB.Reference],1000h
jb next
mov ax,gs:[MB.Reference]
dec ax
dec ax
mov ds,ax
mov si,MB.Names
mov ah,14h
int 47h
next:
mov bh,46
xor edx,edx
mov dx,gs
inc dx
inc dx
push cx
mov cx,16
mov ah,11h
int 47h
pop cx
mov ah,6h
int 47h
jmp listmcb
fino:
db 0CBh
resident db 'oui',0
nonresident db 'non',0
msg db 'Memory manager V1.5',0
menu db 'Nom | Taille | Res | Parent | Mem',0
end start

View File

@ -6,8 +6,12 @@ smart
org 0100h org 0100h
start: start:
mov si,offset message
mov ah,13
int 47h
mov ah,2 mov ah,2
int 74h int 74h
db 0CBh db 0CBh
message db 'Activation de la souris',0
end start end start

View File

@ -6,7 +6,7 @@ org 0100h
start: start:
mov ah,26 mov ah,28h
int 47h int 47h
mov ax,0001 mov ax,0001
int 47h int 47h
@ -19,7 +19,6 @@ int 47h
mov ah,6 mov ah,6
int 47h int 47h
int 47h int 47h
mov ah,21 mov ah,21
mov cl,3 mov cl,3
int 47h int 47h
@ -38,7 +37,6 @@ mov ah,8
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,4 mov cl,4
int 47h int 47h
@ -59,7 +57,6 @@ mov ah,9
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,5 mov cl,5
int 47h int 47h
@ -80,7 +77,6 @@ mov cx,32
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,6 mov cl,6
int 47h int 47h
@ -101,7 +97,6 @@ mov cx,16
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,7 mov cl,7
int 47h int 47h
@ -120,7 +115,6 @@ mov ah,7
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,8 mov cl,8
int 47h int 47h
@ -139,7 +133,6 @@ mov ah,13
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,21 mov ah,21
mov cl,9 mov cl,9
int 47h int 47h
@ -158,7 +151,6 @@ mov ah,44
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ah,13 mov ah,13
mov si,offset text72 mov si,offset text72
int 47h int 47h
@ -174,19 +166,17 @@ mov ah,45
int 47h int 47h
mov ah,6 mov ah,6
int 47h int 47h
mov ax,0 mov ax,0
int 16h int 16h
mov ah,2 mov ah,2
int 47h int 47h
mov ah,30 mov ah,30
int 47h int 47h
mov ah,2 mov ah,2
int 47h int 47h
mov ah,21 mov ah,21
mov cl,5 mov cl,5
int 47h int 47h
@ -294,14 +284,14 @@ mov ah,33
int 47h int 47h
dec bp dec bp
jnz go4 jnz go4
mov ah,27 mov ah,14h
int 47h
xor bx,bx xor bx,bx
mov si,offset texte3 mov si,offset texte3
mov ah,20
int 47h int 47h
mov ax,0 mov ax,0
int 16h int 16h
mov ah,29h
int 47h
db 0CBh db 0CBh
put: put:

View File

@ -5,10 +5,10 @@ org 0100h
start: start:
mov ah,28h
int 47H
mov ax,0002 mov ax,0002
int 47H int 47H
mov ah,26
int 47H
replay: replay:
mov ah,2 mov ah,2
int 47h int 47h
@ -25,12 +25,16 @@ int 47h
mov bx,0231h mov bx,0231h
mov si,offset msgapp mov si,offset msgapp
int 47h int 47h
mov bp,1000h
VerifAll: VerifAll:
mov ah,1 mov ah,1
int 16h int 16h
cmp al,32 jz nokey
cmp al,' '
je enend je enend
nokey:
mov ax,cx mov ax,cx
inc ax
mov si,100 mov si,100
mul si mul si
mov si,2880 mov si,2880
@ -43,8 +47,9 @@ VerifAll:
mov ah,13 mov ah,13
mov si,offset po mov si,offset po
int 47h int 47h
mov ah,15 mov ah,15
mov dx,cx mov dx,cx
inc dx
mov bx,0A10h mov bx,0A10h
int 47h int 47h
mov ah,13 mov ah,13
@ -83,8 +88,8 @@ int 47h
someof: someof:
mov ah,0 mov ah,0
int 16h int 16h
mov ah,27 mov ah,29h
int 47h int 47H
db 0CBH db 0CBH
errors: errors:
mov ah,21 mov ah,21
@ -96,7 +101,9 @@ mov si,offset errore
int 47h int 47h
mov ah,0 mov ah,0
int 16h int 16h
jmp replay mov ah,29h
int 47H
db 0CBH
@ -106,7 +113,7 @@ error2 db 'Le disque est defectueux, appuyez sur une touche pour quitter',0
po db ' %',0 po db ' %',0
msgapp db '<Pressez espace pour quitter>',0 msgapp db '<Pressez espace pour quitter>',0
msg db '- Test de surface du disque -',0 msg db '- Test de surface du disque -',0
msg2 db ' cluster tested. ',0 msg2 db ' cluster testes. ',0
msg3 db ' cluster defectueux. ',0 msg3 db ' cluster defectueux. ',0
;->Increment CX ;->Increment CX
gauge: gauge:

View File

@ -8,6 +8,8 @@ start:
mov ax,0305h mov ax,0305h
mov bx,0008h mov bx,0008h
int 16h int 16h
mov ah,28h
int 47H
mov ax,0002 mov ax,0002
int 47H int 47H
mov ah,2 mov ah,2
@ -15,6 +17,10 @@ start:
mov ah,43 mov ah,43
int 47h int 47h
xor bp,bp xor bp,bp
push cs
push cs
pop es
pop ds
Adres: Adres:
mov di,offset infos mov di,offset infos
mov ah,34 mov ah,34
@ -24,7 +30,7 @@ Adres:
pop es pop es
mov cx,sect mov cx,sect
mov di,offset buffer mov di,offset buffer
mov ax,0001h mov ah,0h
int 48h int 48h
jnc noerror jnc noerror
errtr: errtr:
@ -203,9 +209,9 @@ waitst:
jne tre jne tre
mov dword ptr [pope],'WEIV' mov dword ptr [pope],'WEIV'
push cs push cs
pop es pop ds
mov cx,sect mov cx,sect
mov bx,offset buffer mov si,offset buffer
mov ah,1 mov ah,1
int 48h int 48h
jnc adres jnc adres
@ -282,6 +288,8 @@ cursor:
suit7: suit7:
cmp ax,4200h cmp ax,4200h
jne adres2 jne adres2
mov ah,29h
int 47H
db 0CBH db 0CBH
ret ret
@ -292,7 +300,7 @@ calc1:
shl ax,2 shl ax,2
shl dx,1 shl dx,1
add ax,dx add ax,dx
add ax,25 add ax,27
mov bx,YY mov bx,YY
mov dx,yy mov dx,yy
shl bx,5 shl bx,5
@ -315,6 +323,7 @@ calc2:
shl si,5 shl si,5
shl dx,7 shl dx,7
add si,dx add si,dx
add si,2
mov dx,xx mov dx,xx
shl dx,1 shl dx,1
add si,dx add si,dx
@ -374,7 +383,7 @@ spaces db '
showbuffer db 35 dup (0FFh) showbuffer db 35 dup (0FFh)
oldmode db 0 oldmode db 0
infos db 40 dup (0) infos db 40 dup (0)
buffer equ $ buffer db 2048 dup (0)
end start end start