Compare commits

...

127 Commits

Author SHA1 Message Date
b411d9963f Merge branch 'hotfix/1.3.1' 2007-03-13 20:49:51 +00:00
040ea3a030 docs: mise a jour de la documentation en utilisant la description stdcall 2007-03-14 08:45:38 +00:00
c803d5fa41 Merge branch 'release/1.3.0' 2007-03-13 20:41:27 +00:00
89b122da16 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-13 20:56:55 +00:00
12b9aa9f58 feat: mise à jour du code pour compilation sur LZASM en stdcall Changement radical avec ajout d'un système multisection au format PE et detection de peripheriques 2007-03-13 20:55:40 +00:00
2591259b6f feat: librairie permettant la detection du CPU, des périphériques PCI et de VMWARE 2007-03-13 20:49:51 +00:00
dcae05febe feat: rajout d'une structure pour le passage en mode FLAT 2007-03-13 20:44:48 +00:00
8ac538cc0e feat: ajout d'une structure décrivant les processeurs 2007-03-13 20:41:27 +00:00
7334a55e1d feat: ajouts pour la détection avancée de périphérique PCI 2007-03-13 20:36:31 +00:00
8ec203c774 feat: version initiale - contient les différentes structures et déclarations pour les éléments graphiques 2007-03-13 20:34:15 +00:00
264586b6c3 feat: mise à jour du code pour compilation sur LZASM en stdcall 2007-03-13 20:31:51 +00:00
2e67065bd9 docs: un copie d'écran de la version 1.3.1fr au boot 2005-12-05 20:29:48 +00:00
1ede6ca979 feat: gestion du PNP et de l'ISA/EISA 2005-12-05 08:17:18 +00:00
8db2a163d4 feat: passage a la convention d'appel stdcall
BREAKING CHANGE: attention modification majeure du code
2005-12-05 08:16:09 +00:00
8c1701b5af build: suppression du renomage des fichiers 2005-12-05 08:09:17 +00:00
a5c9fa4dd7 feat: mise a jour des classes et sous classes PCI 2005-12-05 08:04:42 +00:00
5e1fa958fe build: changement du repertoire binaire 2005-12-05 08:03:34 +00:00
84a816919f fix: correction de bogue et optimisation des fonctions 2005-12-05 08:02:33 +00:00
b552531179 feat: suppression des fonctions de haut niveau et des fonctions obsolètes pour usage en appel stdcall 2005-12-05 08:01:34 +00:00
d7c5923ca8 build: destruction des .bin 2005-12-05 08:00:07 +00:00
1fbe390e3e feat: ajout de la commande kill Utilisation de la bibliotheque video.lib plutot que l'int 47h Ajout de l'aide aux commandes Colorisation des commandes internes 2004-11-30 19:30:30 +00:00
8025aca688 feat: bibliotheque gerant les fichier BMP 2004-11-30 19:28:32 +00:00
306c0ed771 feat: utilisation de la librairie bmp.lib plutot que l'int 47h 2004-11-30 19:27:59 +00:00
1b835928d9 feat: passage d'un certain nombre de fonctions vers video.lib 2004-11-30 19:27:29 +00:00
ad3b0fe9e4 feat: prise en charge du format CE pour F10 (reprise commande) Changement du fonctionnement de F12 en utilisant pas la librairie video ni le pilote video 2004-11-30 19:26:47 +00:00
c8330e5e86 feat: reprogrammation en utilisant la librairie video 2004-11-29 22:41:00 +00:00
a3008f75fe feat: utilisation de la fonction exec pour le chargement de commande.ce Initialisation du pilote disque 2004-11-29 22:40:48 +00:00
0070bf3d5d feat: reprogrammation en utilisant la librairie video 2004-11-28 22:55:03 +00:00
708590c85e fix: correction de divers bogue dans la fonction print 2004-11-25 00:04:50 +00:00
b0835bc5a7 fix: modification couleur lors du comptage: erreur dans le codage des couleur qui etait en decimal 2004-11-25 00:04:04 +00:00
85f66f34d5 feat: reprogrammation en utilisant la librairie video 2004-11-25 00:04:02 +00:00
ca530927a7 feat: mise a jour de l'exemple pour delocalisation fonction dans la librairie video.lib 2004-11-23 20:42:54 +00:00
c461ede7f1 feat: reprogrammation en utilisant la librairie video 2004-11-23 20:38:58 +00:00
2dbdb9c4c8 fix: correction d'un bogue dans la fonction verifysector et prise en compte du flag equal a la sortie du pilote 2004-11-23 20:37:41 +00:00
4a8effdfde feat: fonction showcorrectionedint renomé en showintl Ajout a l'export des fonction showintl et showintr 2004-11-23 00:52:49 +00:00
263a874d76 feat: reprogrammation en utilisant la librairie video 2004-11-23 00:43:29 +00:00
ccf990b896 fix: correction d'un bogue dans le passage de parametre avec \ dans print Ajout des fonction d'affichage d'entier dans print Ajout de gestion de pointeur long pour les chaines 2004-11-23 00:38:12 +00:00
5a26295438 fix: rajout du commutateur \ dans la fonction print et correction d'un bogue lors du passage d'un unique parametre a cette fonction 2004-11-22 20:53:22 +00:00
309de1fa7b feat: version initiale de la librairie dynamique video.lib (non testé) 2004-11-21 20:38:49 +00:00
323e995c10 feat: librairie d'exemple 2004-11-19 22:13:24 +00:00
b3a5f09040 feat: exemple de programme au format CE qui exploite une librairie par importation 2004-11-19 22:13:10 +00:00
ee67bb4ce2 feat: changement du premier bloc mémoire pour astuce du systeme 2004-11-19 21:57:11 +00:00
08af9a9788 feat: astuce pour recuperer de la mémoire 2004-11-19 21:56:38 +00:00
0348ef59a4 fix: correction d'un bogue dans la fonction execfile concernant l'execution de fichier CE 2004-11-19 19:57:43 +00:00
9c770034e7 fix: correction temporaire pour permettre l'execution d'application non CE 2004-11-19 19:57:06 +00:00
cac7a678dd fix: correction d'un oubli, les structures CE commencent en 0h, changement des fonctions MBsearchfunc et MBloadfuncs 2004-11-19 18:58:30 +00:00
8da7e5072a fix: correction d'un bogue dans cmpnames : derniere caractère du nom ignoré pendant la comparaison et extension de taille correctione 2004-11-19 18:57:45 +00:00
cea1463506 feat: ajout des definitions CE (compatible executable) 2004-11-19 18:54:51 +00:00
42725ead9a feat: passage au format CE, offset a 0 2004-11-19 17:23:06 +00:00
bd0268505f feat: passage au format CE, offset a 0 Changement de la coloration pour les executables 2004-11-19 17:22:13 +00:00
876db618e0 fix: passage au format CE, offset a 0 correction d'un bogue utilisation de la constante graphics plutot que l'emplacement mémoire graphic 2004-11-19 17:21:20 +00:00
3b37ee93a8 feat: passage au format CE, offset a 0 Chargement des pilotes et residents en 0 Chargement de commande.ce plutot que commande.com Ajout de qlq octets pour obtenir 512 octets pile 2004-11-19 17:20:43 +00:00
20d5374674 fix: passage au format CE, offset a 0 Ajout de la fonction MBSearchfunc qui recherche une fonction dans la mémoire et MBLoadfuncs qui permet de resoudre les dependance du format CE correction d'un bogue dans MBcreate lors de l'utilisation d'un bloc de meme taille que le libre 2004-11-19 17:19:05 +00:00
4da7f7f656 feat: passage au format CE, offset a 0 Chargement, Projection et execution en offset 0 2004-11-19 17:14:57 +00:00
df0e3a0014 feat: passage au format CE, chargement en offset 0 du systeme.sys 2004-11-19 17:14:08 +00:00
d23d5db024 feat: passage au format CE, offset a 0 Modification du format executable par defaut
BREAKING CHANGE: attention modification majeure du code
2004-11-19 17:12:30 +00:00
beae20414c Merge tag '1.2.0' into develop
Merge avec master 1.2.0
2004-11-13 12:43:14 +00:00
fbde72ecb8 build: compilation en *.com 2004-11-13 14:34:29 +00:00
46f6725d5f feat: programme d'installation en mode graphique 2004-11-13 13:29:52 +00:00
6813e58212 feat: logiciel d'installation pour Windows NT/2000/XP 2004-11-13 12:43:14 +00:00
62bdca8c46 Merge branch 'release/1.2.0' 2004-11-13 12:34:41 +00:00
8f9680b946 feat: nouvelle version de l'installation sous windows 2004-11-13 14:34:29 +00:00
b6c921d0a8 feat: installation sous linux (non terminé) 2004-11-13 12:34:41 +00:00
49df44d565 feat: mise a jour des numéro de version dans le source. 2004-11-13 09:27:58 +00:00
badad86be2 feat: rajout du pilote de clavier. 2004-11-13 09:22:57 +00:00
82503fa5c9 feat: mise a jour des numéro de version dans le source. 2004-11-13 09:20:52 +00:00
65add82338 feat: ajout d'un commentaire lors de l'activation de la souris 2004-11-13 09:05:35 +00:00
051a6e57e9 build: compilation des programmes en .com plutot que .exe 2004-11-13 08:59:13 +00:00
d6d3e21484 feat: mise a jour des numéro de version dans le source. 2004-11-13 08:58:42 +00:00
056d43ea68 docs: mise a jour avec description des API 2004-11-11 19:47:25 +00:00
20303cbb4f feat: modification pour prise en charge clavier français 2004-11-11 17:03:41 +00:00
bf1420d4b6 fix: correction d'un bogue d'affichage et d'un bogue de sauvegarde. 2004-11-11 16:21:04 +00:00
29b1abf0ca feat: execution des programme en COM plutot que exe 2004-11-11 16:20:02 +00:00
6be56b4cce feat: préparation au remagnage de la librairie video 2004-11-11 16:19:18 +00:00
9465b99c3f fix: f10 correction de l'arret du programme vers commande.exe. Changement de focntionnement sur F12 mais pas encore terminé 2004-11-11 16:18:54 +00:00
d5a9a53cd6 feat: evite la creation d'un nouveau bloc memoire fat a chaque appel de la fonction initdrive 2004-11-10 19:30:08 +00:00
4f63f21906 fix: correction de la mauvaise declaration du buffer 2004-11-10 19:25:24 +00:00
4ae827bc47 fix: correction d'un bogue lors de l'affichage d'erreur lecteur 2004-11-10 19:25:00 +00:00
da960fb5fc fix: correction d'un bogue dans la fonction verifysector. 2004-11-10 19:24:14 +00:00
628a422717 fix: correction sur le bogue lors du depassement de l'ecran dans la commande interne mem 2004-11-10 16:50:43 +00:00
b85f27177b fix: correction sur le bogue lors du depassement de l'ecran 2004-11-10 16:50:24 +00:00
a4b0815f42 fix: correction d'un bogue dans MBresident. 2004-11-10 12:26:45 +00:00
c7dcde1d6e feat: modification du programme afin qu'il soit compatible avec les blocs mémoires BIS 2004-11-10 12:06:48 +00:00
dc30bfd8f1 fix: chargement des fichiers systeme a leur taille réelle et correction d'un bogue dans l'affichage de leur occupation mémoire 2004-11-10 12:01:56 +00:00
a5e57c63c3 fix: correction d'un bogue lors de l'allocation mémoire dans mbcreate 2004-11-10 12:00:49 +00:00
537fa9d76d feat: usage de bloc de mémoire pour loger la FAT.correction permettant le chargement des fichier a leur taille réelle et correction des buffers pour eviter le debordement de blocs mémoire. 2004-11-10 12:00:08 +00:00
2dc6857104 fix: correction concernant les buffers pour evité les debordements de blocs mémoire.correction concernant la saisie de commande (caractères étendus).Ajout de la commande mem donnant le contenu de la mémoire 2004-11-10 11:54:51 +00:00
9408661e06 build: ajout de la compilation du fichier memoire.exe 2004-11-05 01:15:50 +00:00
5f1418ebc1 build: ajout de la compilation de mcb.sys 2004-11-05 01:06:44 +00:00
5b13a5616b feat: modification du programme afin qu'il soit compatible avec les blocs mémoires et les fonctions de restauration d'écran 2004-11-05 01:01:37 +00:00
1eff431dd6 fix: modification du programme afin qu'il soit compatible avec les blocs mémoires et correction d'un bogue de couleur a la sortie du programme 2004-11-05 01:00:15 +00:00
2d79e0a541 feat: modification du programme afin qu'il soit compatible avec les blocs mémoires 2004-11-05 00:59:48 +00:00
4a5372aa9d feat: modification de toutes les fonctions utilisant de la mémoire afin qu'il utilisent les mecanismes de réservation de blocs mémoire. 2004-11-05 00:58:45 +00:00
f47656fd88 fix: modification de la fonction verifsector qui présentait de nombreux bogues 2004-11-05 00:57:03 +00:00
d7590a4589 feat: ajout d'une recherche de sous bloc (mbfindsb) et correction d'un but concernant la commande de recherche de bloc mbfind. 2004-11-03 22:30:09 +00:00
1572c0277e feat: modification du programme qui utilise des blocs de mémoires pour le stockage et la decompression du BMP 2004-11-03 00:33:59 +00:00
7dbba04017 feat: rajout de la fonction mbclean permettant de fusionner les espaces libres et cela de maniere systematique lors d'une liberation de mémoire. 2004-11-03 00:32:19 +00:00
d5a9d98391 feat: rajout de la fonction mballoc qui permet a un programme utilisateur de reservé un bloc mémoire de data. Modification de la commande mbfree afin de libérer les sous blocs associés. 2004-11-02 21:54:19 +00:00
76e8687269 feat: suppression des fonction de gestion de blocs de mémoire inutile et mise en résident systématique des blocs mémoire système 2004-10-31 12:24:36 +00:00
c3c97b251b fix: ajout de la gestion des blocs de mémoire résident et correction des bogues 2004-10-31 12:23:52 +00:00
056902c2cf feat: mise a nivo pour la gestion des blocs parent 2004-10-31 11:46:47 +00:00
fee0c5a333 feat: plus d'attente aprés une touche a la fin du programme 2004-10-31 11:46:21 +00:00
3cd3469cb0 feat: finalisation de la fonction mbfind Ajout de la fonction mbchown qui permet de changer le parent d'un bloc mémoire 2004-10-31 11:45:46 +00:00
753debd849 feat: finalisation de la verification d'unicité des processus Ajout de la gestion des parents dans la fonction execfile 2004-10-31 11:44:57 +00:00
0af23ddb31 fix: correction de bogues dans la fonction MBCreate : le segment reservé n'etait pas correctement renvoyé si l'espace mémoire etait pile. 2004-10-31 09:31:20 +00:00
f94e485267 feat: rajout de la liberation de la mémoire via la fonction MBFREE dans la fonction exec. 2004-10-31 09:30:14 +00:00
0a0e9cc723 fix: correction de bogues (sauts et flag carry) lors de l'echec de la projection en mémoire dans la fonction execfile 2004-10-30 20:36:00 +00:00
4b570f7995 feat: ajout de la fonction fileexec permetant l'execution directe d'un fichier. La liberation de la mémoire n'est pas encore prise en compte. 2004-10-30 19:55:45 +00:00
8a5dcd0172 feat: utilisation de la fonction fileexec plutot que la fonction de projection en bloc mémoire 2004-10-30 19:54:49 +00:00
a4b18960f3 feat: utilisation de la projection en bloque mémoire pour le lancement d'application 2004-10-30 19:26:33 +00:00
0a8f8d59b4 feat: ajout de l'initialisation des pilote de bloc mémoire 2004-10-30 19:26:04 +00:00
4d989b0e3e feat: intégration de la commande projfile de projection en bloc mémoire 2004-10-30 19:25:45 +00:00
df90101e7f fix: correctione du fonctionnement des blocs de mémoire. rajout d'une fonction de projection en bloc mémoire. utilisation de la fonction projfile pour le chargement des pilotes et de l'interpreteur. ajout de fonctions de déboguage temporaire 2004-10-30 18:51:59 +00:00
819d3e819c feat: petit programme de gestion de la mémoire, pour l'instant en visualisation seulement 2004-10-29 18:24:09 +00:00
09f8882cb8 fix: correction de bogue multiple permettant a ce pilote de fonctionner et ajout d'une fonction de listage des blocs 2004-10-29 18:22:55 +00:00
829f9b4721 fix: correction du nom de gestionnaire de mémoire vers mcb.sys 2004-10-29 17:20:55 +00:00
2cc7825eb2 feat: ajout des pilotes de gestion de la mémoire 2004-10-29 16:39:58 +00:00
7e4d39175e feat: ajout des declaration pour la gestion des blocs de mémoire 2004-10-29 16:39:12 +00:00
6a4fba7f9a feat: ajout de declarations diverses 2004-10-29 16:38:22 +00:00
0190b45438 feat: prise en charge des blocs de mémoire dans le noyau 2004-10-29 16:35:08 +00:00
22f45183fd feat: prise en charge des blocs de mémoire dans le chargement 2004-10-29 16:32:48 +00:00
ef5df22a06 feat: ajout du pilote lpt.sys 2004-10-28 15:48:48 +00:00
54d2f01f90 Merge branch 'hotfix/1.0.1' 2004-06-12 22:13:38 +00:00
f4f42eea75 fix: correction du bogue concernant la detection des ressources PCI : affiche uniquement les sous fonction lorsqu'il en existe Rajout de l'identifiant PCI 2004-10-28 15:47:34 +00:00
0b373cda0d fix: correction d'un bogue lors de l'écriture du secteur de boot 2004-06-12 22:58:25 +00:00
7e71c486c1 Merge tag '1.0.1' into develop
Merge avec develop 1.0.1
2004-06-12 21:34:04 +00:00
465eb632df Merge tag '1.0.0' into develop
Merge avec master 1.0.0
2004-06-12 21:47:49 +00:00
62 changed files with 7888 additions and 4558 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,5 @@
all: all:
cd commande cd lib
make
cd ..
cd programs
make make
cd .. cd ..
@ -11,31 +7,16 @@ all:
make make
cd .. cd ..
cd contribs
make
cd ..
cd install cd install
make make
cd .. cd ..
copy: copy:
make all make all
copy commande\*.exe ..\data
copy programs\*.exe ..\data
copy programs\*.rip ..\data
copy noyau\*.sys ..\data
rem copy noyau\*.bin ..\data
copy contribs\*.exe ..\data
copy install\*.com ..\
make clean
clean: clean:
cd commande cd lib
make clean
cd ..
cd programs
make clean make clean
cd .. cd ..
@ -43,10 +24,6 @@ clean:
make clean make clean
cd .. cd ..
cd contribs
make clean
cd ..
cd install cd install
make clean make clean
cd .. cd ..

View File

@ -1,6 +1,7 @@
![logo](https://github.com/dahut87/cos2000v1/raw/master/Graphisme/logo.png) ![logo](https://github.com/dahut87/cos2000v1/raw/master/Graphisme/logo.png)
## Copies d'écran de COS2000 ## Copies d'écran de COS2000
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/bootnew.jpg)
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/chargement.jpg) ![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/chargement.jpg)
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/dir.jpg) ![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/dir.jpg)
![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/editeur.jpg) ![screen](https://github.com/dahut87/cos2000v1/raw/develop/Graphisme/screenshots/editeur.jpg)

View File

@ -1,39 +1,20 @@
.model tiny .model tiny
.486 .486
smart smart
.code .code
org 0100h org 0h
include ..\include\fat.h include ..\include\fat.h
include ..\include\mem.h
include ..\include\divers.h
start: start:
push cs header exe <,1,0,,,offset imports,,>
push cs
push cs realstart:
push cs push offset msginit
pop ds call [print]
pop es
pop fs
pop gs
mov ah,21
mov cl,7
int 47h
mov ah,3
int 48h
mov ax,0002
int 47h
mov ah,2
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov ah,42
int 47h
mov ah,13
mov si,offset msg
int 47h
xor bp,bp xor bp,bp
mov dl,' ' mov dl,' '
call setdelimiter0 call setdelimiter0
@ -43,42 +24,75 @@ replay:
noret: noret:
mov ah,6 mov ah,6
int 47h int 47h
mov ah,16 mov ah,16
mov di,offset dir mov di,offset dir
int 48h int 48h
mov si,di push offset prompt
mov ah,13 call [print]
int 47h
mov si,offset prompt
int 47h
mov di,offset buffer mov di,offset buffer
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
je waitchar je waitchar
mov ah,13 push word ptr cs: [bp-8]
mov si,cs:[bp-8] call [print]
int 47h
push cs push cs
pop es pop es
call copy0 call copy0
call getlength0 call getlength0
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
inc di inc di
mov dl,al push ax
mov ah,7 call [showchar]
int 47h
jmp waitchar jmp waitchar
escape:
cmp di,offset buffer
je waitchar
mov ah,24
int 47h
mov dx,offset buffer
mov cx,di
sub cx,dx
js waitchar
je waitchar
sub bh,cl
mov ah,25
int 47h
mov di,offset buffer
mov byte ptr [di],0
backspace:
cmp di,offset buffer
je waitchar
mov ah,24
int 47h
dec bh
mov ah,25
int 47h
push ' '
call [showchar]
mov ah,25
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
@ -101,13 +115,13 @@ tre:
cmp di,0 cmp di,0
je error je error
push cs push cs
pop es pop es
call evalue0 call evalue0
cmp dx,bp cmp dx,bp
jb noadd jb noadd
mov bp,dx mov bp,dx
mov ax,bx mov ax,bx
noadd: noadd:
call cmpstr0 call cmpstr0
jne tre jne tre
mov si,offset buffer mov si,offset buffer
@ -132,7 +146,7 @@ nopod:
error: error:
mov bp,ax mov bp,ax
push cs push cs
pop es pop es
mov dl,'.' mov dl,'.'
call searchchar0 call searchchar0
je noaddext je noaddext
@ -141,99 +155,64 @@ 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 push offset error_syntax
pop ax call [print]
pop ax push word ptr cs: [bp-8]
pop ax call [print]
mov ah,13
mov si,offset Error_Syntax
int 47h
mov ah,13
mov si,cs:[bp-8]
int 47h
jmp replay jmp replay
errorprec: errorprec:
mov ah,13 push offset derror
mov si,offset derror call [print]
int 47h
jmp replay jmp replay
Code_Exit: code_exit:
pop ax pop ax
db 0CBh retf
Code_Version: code_version:
mov ah,13 push offset version_text
mov si,offset Version_Text call [print]
int 47h
ret ret
Version_Text db 'Cos 2000 version 3.0.2Fr par Nico',0 version_text db 'Cos 2000 version 1.4Fr par \c04MrNop',0
Code_Cls: code_cls:
mov ah,2 mov ah,2
int 47h int 47h
ret ret
Code_Reboot: code_reboot:
push 0FFFFh push 0ffffh
push 00000h push 00000h
db 0CBH retf
Code_Command: code_command:
push offset def
call [print]
mov bx,offset commands mov bx,offset commands
showalls: showalls:
mov si,[bx]
add bx,8 add bx,8
cmp si,0 cmp word ptr [bx],0
je endoff je endoff
mov ah,13 push word ptr [bx+4]
int 47h push word ptr [bx+6]
mov ah,6 push word ptr [bx]
int 47h push offset commandes
call [print]
jmp showalls jmp showalls
endoff: endoff:
ret ret
Code_Mode: def db 'Liste des commandes internes\l\l',0
commandes db '%0 \h10:\h12%0 \h70%0\l',0
code_mode:
mov cx,0 mov cx,0
call gettypeditem0 call gettypeditem0
mov ah,0 mov ah,0
@ -244,206 +223,320 @@ Code_Mode:
int 47h int 47h
ret ret
present db 'Le volume insere est nomme ',0 code_dir:
present2 db ', Numero de serie : ',0 mov ah,12
nomdisque db 13 dup (0) int 48h
Code_Dir: push edx
mov si,offset present mov ah,11
mov ah,13 mov di,offset nomdisque
int 47h int 48h
mov ah,11 push di
mov di,offset nomdisque push offset present
int 48h call [print]
mov si,di xor bp,bp
mov ah,13 mov di,offset bufferentry
int 47h mov ah,7
mov si,offset present2 int 48h
mov ah,13 jc nofiles
int 47h
mov ah,12
int 48h
mov ah,10
mov cx,32
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
xor ebp,ebp
mov di,offset bufferentry
mov si,di
mov ah,7
int 48h
jc nofiles
go: go:
mov ah,46 push word ptr [di+entries.fileattr]
int 47h push dword ptr [di+entries.filesize]
mov ah,05 push word ptr [di+entries.filetime]
int 47h push word ptr [di+entries.filedate]
int 47h push word ptr [di+entries.filetimecrea]
int 47h push word ptr [di+entries.filedatecrea]
mov ah,44 push di
mov dx,[si+Entries.FileDateCrea] push offset line
int 47h call [print]
mov ah,05 inc bp
int 47h mov ah,8
int 47h int 48h
int 47h jnc go
mov ah,45
mov dx,[si+Entries.FileTimeCrea]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,44
mov dx,[si+Entries.FileDate]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,45
mov dx,[si+Entries.FileTime]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,48
mov edx,[si+Entries.FileSize]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,47
mov dl,[si+Entries.FileAttr]
int 47h
mov ah,6
int 47h
inc bp
mov ah,8
int 48h
jnc go
nofiles: nofiles:
mov edx,ebp push ebp
mov ah,6 push offset filess
int 47h call [print]
mov ah,8 ret
int 47h
mov si,offset filess nomdisque db 13 dup (0)
mov ah,13 bufferentry db 512 dup (0)
int 47h present db '\c02Le volume insere est nomme %0, Numero de serie : %hD\l\l',0
ret
bufferentry db 32 dup (0) line db '\c07%n %d %t %d %t %z %a\l',0
filess db ' Fichier(s) au total',0 filess db '\l\l\c02%u Fichier(s) au total\l',0
changing db 'Changement de repertoire vers ',0
code_cd: code_cd:
mov cx,0 mov cx,0
call gettypeditem0 call gettypeditem0
push si push di
mov si,offset changing push offset changing
mov ah,13 call [print]
int 47h mov si,di
pop si mov ah,13
int 47h int 48h
mov ah,6 jnc okchange
int 47h push offset errorchanging
mov si,di call [print]
mov ah,13
int 48h
jnc okchange
mov si,offset errorchanging
mov ah,13
int 47h
okchange: okchange:
ret ret
errorchanging db 'Impossible d''atteindre ce dossier',0
changing db 'Changement de repertoire vers %0\l',0
errorchanging db '\c04Impossible d''atteindre ce dossier',0
code_kill:
mov cx,0
call gettypeditem0
push di
push offset killing
call [print]
mov si,di
mov ah,5
int 49h
jc nochanged
mov ah,1
int 49h
jnc okchanged
nochanged:
push offset errorkilling
call [print]
okchanged:
ret
killing db 'Fermeture du processus %0\l',0
errorkilling db '\c04Impossible de fermer ce processus',0
code_refresh: code_refresh:
mov ah,3 mov ah,3
int 48h int 48h
jnc okrefresh jnc okrefresh
mov si,offset errorrefreshing push offset errorrefreshing
mov ah,13 call [print]
int 47h ret
ret
okrefresh: okrefresh:
mov si,offset present mov ah,12
mov ah,13 int 48h
int 47h push edx
mov ah,11 mov ah,11
mov di,offset nomdisque mov di,offset nomdisque
int 48h int 48h
mov si,di push di
mov ah,13 push offset present
int 47h call [print]
mov si,offset present2 ret
mov ah,13
int 47h
mov ah,12
int 48h
mov ah,10
mov cx,32
int 47h
mov ah,6
int 47h
ret
errorrefreshing db 'Impossible de lire le support',0
extcom db '.EXE',0
commands dw Str_Exit ,Code_Exit ,Syn_Exit ,Help_Exit errorrefreshing db '\c04Impossible de lire le support',0
dw Str_Version,Code_Version,Syn_Version,Help_Version extcom db '.CE',0
dw Str_Cls ,Code_Cls ,Syn_Cls ,Help_Cls
dw Str_Reboot ,Code_Reboot ,Syn_Reboot ,Help_Reboot
dw Str_Command,Code_Command,Syn_Command,Help_Command
dw Str_Mode ,Code_Mode ,Syn_Mode ,Help_Mode
dw Str_Dir ,Code_Dir ,Syn_Dir ,Help_Dir
dw Str_refresh ,Code_refresh ,Syn_refresh ,Help_refresh
dw Str_cd ,Code_cd ,Syn_cd ,Help_cd
dw 0
Str_Exit db 'QUIT',0
Str_Version db 'VERS',0
Str_Cls db 'EFFAC',0
Str_Reboot db 'REDEM',0
Str_Command db 'CMDS',0
Str_Mode db 'MODE',0
Str_Dir db 'VOIR',0
Str_refresh db 'LIRE',0
Str_cd db 'CH',0
Syn_Exit db 0
Syn_Version db 0
Syn_Cls db 0
Syn_Reboot db 0
Syn_Command db 0
Syn_Mode db 'FFH',0
Syn_Dir db 0
Syn_refresh db 0
Syn_cd db '@',0
Help_Exit db 0
Help_Version db 0
Help_Cls db 0
Help_Reboot db 0
Help_Command db 0
Help_Mode db 0
Help_Dir db 0
Help_refresh db 0
Help_cd db 0
derror db 'Erreur de Syntaxe !',0
Error_Syntax db 'La commande ou l''executable n''existe pas ! F1 pour ',0
prompt db '>',0
msg db 'Interpreteur de commande COS V1.1',0
include str0.asm code_mem:
push offset msg
dir equ $ call [print]
buffer equ $+128 xor ebx,ebx
buffer2 equ $+128+512 xor cx,cx
vga equ $+128+512+512 listmcb:
mov ah,4
int 49h
jc fino
inc cx
;placement mémoire
mov dx,gs
inc dx
inc dx
push edx
;parent
cmp gs: [mb.reference],0
jne next
push cs
push offset none
add bx,gs:[mb.sizes]
jmp suitemn
next:
mov dx,gs: [mb.reference]
dec dx
dec dx
push dx
push offset mb.names
suitemn:
;Resident
cmp gs: [mb.isresident],true
jne notresident
push offset resident
jmp suitelistmcb
notresident:
push offset nonresident
suitelistmcb:
;taille memoire
xor edx,edx
mov dx,gs: [mb.sizes]
shl edx,4
push 6
push edx
;nom
push gs
push offset mb.names
push offset line2
call [print]
jmp listmcb
fino:
shl ebx,4
push ebx
push offset fin
call [print]
ret
resident db "oui",0
nonresident db "non",0
line2 db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0
fin db "\l\l\c02%u octets de memoire disponible\l",0
msg db "Plan de la memoire\l\lNom Taille Res Parent Mem\l",0
none db ".",0
end start ;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
dw str_version,code_version,syn_version,help_version
dw str_cls ,code_cls ,syn_cls ,help_cls
dw str_reboot ,code_reboot ,syn_reboot ,help_reboot
dw str_command,code_command,syn_command,help_command
dw str_mode ,code_mode ,syn_mode ,help_mode
dw str_dir ,code_dir ,syn_dir ,help_dir
dw str_refresh ,code_refresh ,syn_refresh ,help_refresh
dw str_cd ,code_cd ,syn_cd ,help_cd
dw str_mem ,code_mem ,syn_mem ,help_mem
dw str_kill ,code_kill ,syn_kill ,help_kill
dw 0
str_exit db 'QUIT',0
str_version db 'VERS',0
str_cls db 'CLEAR',0
str_reboot db 'REBOOT',0
str_command db 'CMDS',0
str_mode db 'MODE',0
str_dir db 'DIR',0
str_refresh db 'DISK',0
str_cd db 'CD',0
str_mem db 'MEM',0
str_kill db 'KILL',0
syn_exit db 0
syn_version db 0
syn_cls db 0
syn_reboot db 0
syn_command db 0
syn_mode db 'FFH',0
syn_dir db 0
syn_refresh db 0
syn_cd db '@',0
syn_mem db 0
syn_kill db '@',0
help_exit db 'Permet de quitter l''interpreteur',0
help_version db 'Affiche la version de COS',0
help_cls db 'Efface l''ecran',0
help_reboot db 'Redemarre l''ordinateur',0
help_command db 'Affiche le detail des commandes',0
help_mode db 'Modifie le mode video en cours',0
help_dir db 'Affiche le contenu du repertoire courant',0
help_refresh db 'Lit le support disquette insere',0
help_cd db 'Change le repertoire courant',0
help_mem db 'Affiche le plan de la memoire',0
help_kill db 'Termine le processus cible',0
derror db '\c04Erreur de Syntaxe !',0
error_syntax db '\c04La commande ou l''executable n''existe pas ! F1 pour ',0
prompt db '\c07>',0
msginit db '\m02\e\c07\l\lInterpreteur de commande COS V1.9\lSous license \c05GPL\c07 - Ecrit par \c04MrNop\l\c07Utilisez la commande CMDS pour connaitres les commandes disponibles\l',0
include str0.asm
dir db 32 dup (0)
buffer db 128 dup (0)
buffer2 db 128 dup (0)
imports:
db "VIDEO.LIB::print",0
print dd 0
db "VIDEO.LIB::showhex",0
showhex dd 0
db "VIDEO.LIB::showchar",0
showchar dd 0
dw 0
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.

20
include/cpu.h Normal file
View File

@ -0,0 +1,20 @@
struc cpu
vendor db 13 dup(0) ;Chaine 0 du fabriquant
names db 32 dup(0)
stepping db 0
models db 0
family db 0
types db 0
emodels db 0
efamily db 0
mmx db 0
mmx2 db 0
sse db 0
sse2 db 0
sse3 db 0
fpu db 0
now3d db 0
now3d2 db 0
htt db 0
apic db 0
ends cpu

2
include/divers.h Normal file
View File

@ -0,0 +1,2 @@
true equ 1
false equ 0

View File

@ -1,58 +1,52 @@
Free equ 0 struc dpt
True equ 1 steprate&headunload db 0DFh ;Vitesse de progression & monte de la tˆte
False equ 0 dmaflag&headload db 002h ;Etat Dma et temps de descente de la tˆte
delaymotoroff db 025h ;Temps avant extinction moteur
bytepersector db 002h ;Taille des secteurs
sectorpertracks db 000h ;Nombre de secteur par piste
intersectgaplength db 01Bh ;Taille du GAP3 en lecture/criture
datalength db 0FFh ;Longueur du transfert de donnes
intersectgaplengthf db 054h ;Taille du GAP3 en formatage
formatbyte db 0F6h ;Octet de formatage
headsettlingtime db 000h ;Temps de repos des tˆtes
delaymotornormspeed db 008h ;Temps de monte en vitesse du moteur
ends dpt
DPT struc struc entries
StepRate&HeadUnload db 0DFh ;Vitesse de progression & monte de la tˆte filename db 8 dup (0)
DMAFlag&HeadLoad db 002h ;Etat Dma et temps de descente de la tˆte filext db 3 dup (0)
DelayMotorOff db 025h ;Temps avant extinction moteur fileattr db 0
BytePerSector db 002h ;Taille des secteurs filereserved db 0
SectorPerTracks db 000h ;Nombre de secteur par piste filetimecreams db 0 ;(*10 ms)
InterSectGapLength db 01Bh ;Taille du GAP3 en lecture/criture filetimecrea dw 0
DataLength db 0FFh ;Longueur du transfert de donnes filedatecrea dw 0
InterSectGapLengthF db 054h ;Taille du GAP3 en formatage filedateacc dw 0
FormatByte db 0F6h ;Octet de formatage filenotused dw 0
HeadSettlingTime db 000h ;Temps de repos des tˆtes filetime dw 0
DelayMotorNormSpeed db 008h ;Temps de monte en vitesse du moteur filedate dw 0
DPT ends filegroup dw 0
filesize dd 0
ends entries
Entries Struc struc bootinfo
FileName db 8 dup (0) vendor db 'COS2000A' ;Fabricant + n°série Formatage
FilExt db 3 dup (0) sectorsize dw 512 ;octet/secteur
FileAttr db 0 sectorspercluster db 1 ;secteur/cluster
FileReserved db 0 reservedsectors dw 1 ;secteur reserv
FileTimeCreaMs db 0 ;(*10 ms) fatsperdrive db 2 ;nb de copie de la FAT
FileTimeCrea dw 0 directorysize dw 224 ;taille rep racine
FileDateCrea dw 0 sectorsperdrive dw 2880 ;nb secteur du volume si < 32 még
FileDateAcc dw 0 mediadescriptor db 0F0h ;Descripteur de média
FileNotused dw 0 sectorsperfat dw 9 ;secteur/FAT
FileTime dw 0 sectorspertrack dw 18 ;secteur/piste
FileDate dw 0 headsperdrive dw 2 ;nb de tˆteb de lecture/écriture
FileGroup dw 0 hiddensectorsh dw 0 ;nombre de secteur cachs
FileSize dd 0 hiddensectorsl dw 0 ;
Entries Ends sectorperdisk2 dd 0 ;Nombre secteur du volume si > 32 Mo+20h ; the number of sectors
bootdrive db 0 ;Lecteur de dmarrage
BootSector Struc reservedfornt db 0 ;NA
jumper db 0,0,0 bootsign db 29h ;boot signature 29h
Vendor db 'COS2000A' ;Fabricant + n°série Formatage serialnumber dd 01020304h ;no de serie
SectorSize dw 512 ;octet/secteur drivename db 'COS2000 ' ;nom de volume
SectorsPerCluster db 1 ;secteur/cluster typeoffat db 'FAT16 ' ;FAT
ReservedSectors dw 1 ;secteur reserv ends bootinfo
FatsPerDrive db 2 ;nb de copie de la FAT
DirectorySize dw 224 ;taille rep racine
SectorsPerDrive dw 2880 ;nb secteur du volume si < 32 még
MédiaDescriptor db 0F0h ;Descripteur de média
SectorsPerFat dw 9 ;secteur/FAT
SectorsPerTrack dw 18 ;secteur/piste
HeadsPerDrive dw 2 ;nb de tˆteb de lecture/écriture
HiddenSectorsH dw 0 ;nombre de secteur cachs
HiddenSectorsL dw 0 ;
SectorPerDisk2 dd 0 ;Nombre secteur du volume si > 32 Mo+20h ; the number of sectors
BootDrive db 0 ;Lecteur de dmarrage
ReservedForNT db 0 ;NA
BootSign db 29h ;boot signature 29h
SerialNumber dd 01020304h ;no de serie
DriveName db 'COS2000 ' ;nom de volume
TypeOffAt db 'FAT16 ' ;FAT
bootcode db 453 dup (0)
BootSector ends

4
include/graphic.h Normal file
View File

@ -0,0 +1,4 @@
struc point
coordx db 0
coordy db 0
ends point

32
include/mem.h Normal file
View File

@ -0,0 +1,32 @@
struc mb ;Bloc de mémoire
check db "NH" ;signature du bloc de mémoire
isnotlast db 0 ;flag indiquant le dernier bloc
isresident db 0 ;flag indiquant que le bloc est resident
reference dw 0 ;pointeur vers le bloc parent
sizes dw 0 ;taille du bloc en paragraphe de 16 octet
names db 24 dup (0) ;nom du bloc
ends mb
struc exe ;Executable COS
checks db "CE" ;signature de l'exe
major db 1 ;N° version
checksum dd 0 ;Checksum de l'exe
compressed db 0 ;a 1 si compressé par RLE
exports dw 0 ;importation de fonctions
imports dw 0 ;exportation de fonctions
sections dw 0 ;sections des blocs mémoire
starting dw 15
ends exe
struc descriptor
limit_low dw 0
base_low dw 0
base_middle db 0
dpltype db 0
limit_high db 0
base_high db 0
ends descriptor
free equ 0 ;Reference quand libre
memorystart equ 0052h ;premier bloc de la mémoire

View File

@ -1,4 +1,4 @@
pci Struc struc pcidata
vendor dw 0 ;vendor ID (read-only), FFFFh returned if requested device non-existent vendor dw 0 ;vendor ID (read-only), FFFFh returned if requested device non-existent
device dw 0 ;device ID (read-only) device dw 0 ;device ID (read-only)
command dw 0 ;command register command dw 0 ;command register
@ -6,7 +6,7 @@ status dw 0 ;status register
revision db 0 ;revision ID revision db 0 ;revision ID
interface db 0 ;programming interface interface db 0 ;programming interface
subclass db 0 ;sub-class subclass db 0 ;sub-class
class db 0 ;class code class db 0 ;class code
cache db 0 ;cache line size cache db 0 ;cache line size
timer db 0 ;latency timer timer db 0 ;latency timer
typed db 0 ;header type typed db 0 ;header type
@ -16,4 +16,19 @@ typed db 0 ;header type
;02h PCI-to-CardBus bridge ;02h PCI-to-CardBus bridge
;bit 7: multi-function device ;bit 7: multi-function device
result db 0 ;Built-In Self-Test result result db 0 ;Built-In Self-Test result
pci Ends ends pcidata
struc pciinf
version_major db 0
version_minor db 0
types db 0
maxbus db 0
ends pciinf
multifunction equ 80h
othercard equ 00h
pci2pcibridge equ 01h
pci2pcicard equ 02h
config1addr equ 0CF8h
config1data equ 0CFCh

View File

@ -1,16 +1,20 @@
lnk_boot = tlink /x asm= lzasm
asm= tasm /t/m5/zi lnk= elink
lnk= tlink /x/t
all: setup.com all: setup.com
setup.com: setup.asm setup.com: setup.obj
$(asm) setup $(lnk) setup.obj setup.com
$(lnk) setup
setup.obj:
$(asm) setup.asm
clean: clean:
del *.obj del *.obj
del *.exe del *.exe
del *.bak
del *.lib
del *.com del *.com
del *.bin
del *.sys del *.sys
del *.err del *.err

View File

@ -1,26 +1,26 @@
.model tiny model tiny,stdcall
.486 p486
smart locals
.code jumps
codeseg
option procalign:byte
org 0100h org 0100h
ent equ 32h ent equ 32h
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.3.1BetaFr 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,'$'
Ok db 0Dh,0AH,'COS2000 a été correctement installé, veuillez redemarrer votre PC',0Dh,0AH,'$' ok db 0Dh,0AH,'COS2000 a ete correctement installe, veuillez redemarrer votre PC',0Dh,0AH,'$'
files db '*.*',0 files db '*.*',0
boot db 'boot.bin',0 boot db 'boot.bin',0
dat db 'data',0 dat db 'data',0
retu db 0Dh,0AH,'$' retu db 0Dh,0AH,'$'
dta db 43 dup (0) dta db 43 dup (0)
nom db 25 dup (0)
copycos: copycos:
mov ah,9 mov ah,9
@ -54,7 +54,7 @@ copycos:
mov dx,offset message3 mov dx,offset message3
int 21h int 21h
allfile: allfile:
mov byte ptr [offset dta+43],'$' mov [byte ptr offset dta+43],'$'
mov ah,9 mov ah,9
mov dx,offset dta+30 mov dx,offset dta+30
int 21h int 21h
@ -97,13 +97,9 @@ allfile:
mov ah,3ch mov ah,3ch
push cs push cs
pop es pop es
mov si,offset dta+30-3 mov di,offset dta+30-3
mov di,offset nom mov [word ptr di],":a"
mov cx,25 mov [byte ptr di+2],"\"
rep movsb
mov di,offset nom
mov word ptr [di],":a"
mov byte ptr [di+2],"\"
xor cx,cx xor cx,cx
mov dx,di mov dx,di
int 21h int 21h
@ -123,7 +119,7 @@ allfile:
jc error jc error
mov ah,4fh mov ah,4fh
int 21h int 21h
jnc allfile jnc allfile
mov ah,09 mov ah,09
mov dx,offset message2 mov dx,offset message2
int 21h int 21h
@ -134,7 +130,7 @@ allfile:
push fs push fs
pop ds pop ds
mov ah,3fh mov ah,3fh
mov cx,000FFh mov cx,0FFFFh
xor dx,dx xor dx,dx
int 21h int 21h
push cs push cs
@ -151,7 +147,7 @@ allfile:
xor bx,bx xor bx,bx
int 13h int 13h
mov ah,09 mov ah,09
mov dx,offset Ok mov dx,offset ok
int 21h int 21h
xor ax,ax xor ax,ax
int 16h int 16h
@ -165,5 +161,4 @@ error:
xor ax,ax xor ax,ax
int 16h int 16h
ret ret
end start

BIN
install/setup.sh Executable file

Binary file not shown.

121
install/winNT gui/setup.bpr Normal file
View File

@ -0,0 +1,121 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="setup.exe"/>
<OBJFILES value="setup.obj Unit1.obj"/>
<RESFILES value="setup.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) Unit1.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="rtl.lib vcl.lib"/>
<SPARELIBS value="vcl.lib rtl.lib"/>
<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="_RTLDLL;NO_STRICT"/>
<MAINSOURCE value="setup.cpp"/>
<INCLUDEPATH value="E:\CBuilder6\Projects;&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="E:\CBuilder6\Projects;&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-IE:\CBuilder6\Projects
-I&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot; -I$(BCB)\include
-I$(BCB)\include\vcl -src_suffix cpp -boa"/>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -w- -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zn"/>
<LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj Memmgr.Lib sysinit.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="setup.res" FORMNAME="" UNITNAME="setup.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="setup.cpp" FORMNAME="" UNITNAME="setup" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="Form1" 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>

View File

@ -0,0 +1,33 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------

BIN
install/winNT gui/setup.res Normal file

Binary file not shown.

BIN
install/winNT gui/setup.tds Normal file

Binary file not shown.

166
install/winNT gui/unit1.cpp Normal file
View File

@ -0,0 +1,166 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include <winioctl.h>
#include <io.h>
#include <fcntl.h>
#include <dir.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
HANDLE hDrive;
DISK_GEOMETRY dg_flop_geom;
AnsiString lecteur="b:";
AnsiString device="\\\\.\\"+lecteur;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
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;
}
//---------------------------------------------------------------------------
ShowMessages(AnsiString msg)
{
Form1->Memo1->Lines->Add(msg);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender)
{
DWORD dwNotUsed;
DWORD error=0;
hDrive = CreateFile(device.c_str(), GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);
ShowMessages("Ouverture du peripherique "+lecteur);
if (hDrive == INVALID_HANDLE_VALUE) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if(error!=1&&ShowMessages("Determination de la geometrie ")&&DeviceIoControl(hDrive, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL,0, &dg_flop_geom, sizeof(dg_flop_geom),&dwNotUsed, NULL) == FALSE) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if(error!=1&&(dg_flop_geom.MediaType==FixedMedia||dg_flop_geom.MediaType==RemovableMedia||dg_flop_geom.MediaType==Unknown))
{
ShowMessages("Erreur : Ceci n'est pas une disquette !");
error=1;
}
if (error!=1&&ShowMessages("Positionnement sur le secteur 0")&&SetFilePointer(hDrive, 0, NULL, FILE_BEGIN) == -1) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if (error!=1)
{
drive->Caption=lecteur.UpperCase();
track->Caption=IntToStr(dg_flop_geom.Cylinders.LowPart);
sector->Caption=IntToStr(dg_flop_geom.SectorsPerTrack);
size->Caption=IntToStr(dg_flop_geom.BytesPerSector);
head->Caption=IntToStr(dg_flop_geom.TracksPerCylinder);
allsize->Caption=IntToStr(dg_flop_geom.BytesPerSector*dg_flop_geom.Cylinders.LowPart*dg_flop_geom.SectorsPerTrack*dg_flop_geom.TracksPerCylinder);
allsector->Caption=IntToStr(dg_flop_geom.Cylinders.LowPart*dg_flop_geom.SectorsPerTrack*dg_flop_geom.TracksPerCylinder);
}
else
{
CloseHandle(hDrive);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (hDrive == NULL||dg_flop_geom.TracksPerCylinder>2||dg_flop_geom.TracksPerCylinder==0)
{
ShowMessages("Aucun support valide detecté !");
}
else
{
int fdboot;
DWORD error=0;
DWORD dwBsWritten;
char * buffer;
AnsiString bootfile="data/boot.bin";
ShowMessages("Allocation de mémoire ");
buffer = (char *)malloc(dg_flop_geom.BytesPerSector);
ShowMessages("Ouverture et installation du fichier de boot "+bootfile);
if ((fdboot = _rtl_open(bootfile.c_str(),O_RDONLY | O_BINARY)) == -1 )
{
ShowMessages("Erreur : Fichier de boot introuvable");
error=1;
}
if (error!=1&&_read(fdboot, buffer, dg_flop_geom.BytesPerSector)!= dg_flop_geom.BytesPerSector)
{
ShowMessages("Erreur : Fichier de boot de taille incorrecte !");
error=1;
}
if (error!=1&&WriteFile(hDrive, buffer, dg_flop_geom.BytesPerSector, &dwBsWritten, NULL) == 0)
{
ShowMessages("Ecriture impossible sur le secteur de boot !");
error=1;
}
_rtl_close(fdboot);
if (error!=1)
{
struct ffblk files;
int done;
int number=0;
ShowMessages("Détermination des fichiers a copier");
done = findfirst("data/*.*",&files,0);
while (!done)
{
number++;
done = findnext(&files);
}
install->Max=number;
install->Min=0;
install->Position=0;
ShowMessages("Copie des fichiers de cos2000");
done = findfirst("data/*.*",&files,0);
while (!done)
{
ShowMessages(AnsiString(files.ff_name).LowerCase());
if (!CopyFile((AnsiString("data/")+AnsiString(files.ff_name)).c_str(),(lecteur+"\\"+AnsiString(files.ff_name)).c_str(),false))
{
ShowMessages("Erreur : fichier impossible a copier"+AnsiString(GetLastErrorString()));
error=1;
break;
}
done = findnext(&files);
install->Position++;
}
if (!error)
{
ShowMessages("Installation terminée !");
Button2->Visible=false;
Button1->Visible=false;
Button3->Visible=true;
}
else
ShowMessages("Installation echoué !");
}
free(buffer);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
CloseHandle(hDrive);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------

BIN
install/winNT gui/unit1.ddp Normal file

Binary file not shown.

184
install/winNT gui/unit1.dfm Normal file
View File

@ -0,0 +1,184 @@
object Form1: TForm1
Left = 418
Top = 273
Width = 599
Height = 371
Caption = 'Installation de COS2000'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 288
Top = 304
Width = 75
Height = 25
Caption = 'installer...'
TabOrder = 0
OnClick = Button1Click
end
object install: TProgressBar
Left = 16
Top = 264
Width = 553
Height = 25
Min = 0
Max = 100
TabOrder = 1
end
object Button2: TButton
Left = 208
Top = 304
Width = 75
Height = 25
Caption = 'support'
TabOrder = 2
OnClick = FormShow
end
object Memo1: TMemo
Left = 192
Top = 24
Width = 377
Height = 225
ReadOnly = True
TabOrder = 3
end
object GroupBox1: TGroupBox
Left = 16
Top = 120
Width = 161
Height = 129
Caption = 'G'#233'om'#233'trie'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 4
object track: TLabel
Left = 96
Top = 60
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label4: TLabel
Left = 24
Top = 60
Width = 34
Height = 13
Caption = 'Pistes :'
end
object Label5: TLabel
Left = 24
Top = 28
Width = 48
Height = 13
Caption = 'Secteurs :'
end
object sector: TLabel
Left = 96
Top = 28
Width = 31
Height = 13
Caption = 'Aucun'
end
object head: TLabel
Left = 96
Top = 44
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label6: TLabel
Left = 24
Top = 44
Width = 33
Height = 13
Caption = 'Tetes :'
end
object Label8: TLabel
Left = 24
Top = 84
Width = 69
Height = 13
Caption = 'Taille secteur :'
end
object size: TLabel
Left = 96
Top = 84
Width = 31
Height = 13
Caption = 'Aucun'
end
end
object GroupBox2: TGroupBox
Left = 16
Top = 16
Width = 161
Height = 97
Caption = 'Support'
TabOrder = 5
object Label1: TLabel
Left = 24
Top = 24
Width = 42
Height = 13
Caption = 'Lecteur :'
end
object drive: TLabel
Left = 88
Top = 24
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label2: TLabel
Left = 24
Top = 40
Width = 31
Height = 13
Caption = 'Taille :'
end
object allsize: TLabel
Left = 88
Top = 40
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label3: TLabel
Left = 24
Top = 56
Width = 58
Height = 13
Caption = 'N'#176'secteurs :'
end
object allsector: TLabel
Left = 88
Top = 56
Width = 31
Height = 13
Caption = 'Aucun'
end
end
object Button3: TButton
Left = 248
Top = 304
Width = 75
Height = 25
Caption = 'Quitter'
TabOrder = 6
Visible = False
OnClick = Button3Click
end
end

47
install/winNT gui/unit1.h Normal file
View File

@ -0,0 +1,47 @@
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TProgressBar *install;
TButton *Button2;
TMemo *Memo1;
TGroupBox *GroupBox1;
TLabel *track;
TLabel *Label4;
TLabel *Label5;
TLabel *sector;
TLabel *head;
TLabel *Label6;
TLabel *Label8;
TLabel *size;
TGroupBox *GroupBox2;
TLabel *Label1;
TLabel *drive;
TLabel *Label2;
TLabel *allsize;
TLabel *Label3;
TLabel *allsector;
TButton *Button3;
void __fastcall FormShow(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall Button3Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

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;
}
//---------------------------------------------------------------------------

26
lib/MAKEFILE Normal file
View File

@ -0,0 +1,26 @@
asm= lzasm
lnk= elink
all: detect.lib video.lib
detect.lib: detect.obj
$(lnk) detect.obj detect.lib
video.lib: video.obj
$(lnk) video.obj video.lib
detect.obj:
$(asm) detect.asm
video.obj:
$(asm) video.asm
clean:
del *.obj
del *.exe
del *.bak
del *.lib
del *.com
del *.bin
del *.sys
del *.err

114
lib/bmp.asm Normal file
View File

@ -0,0 +1,114 @@
.model tiny
.486
smart
locals
.code
org 0h
include ..\include\mem.h
include ..\include\bmp.h
start:
header exe <,1,0,,,,offset exports,>
exports:
db "showbmp",0
dw showbmp
db "loadbmppalet",0
dw loadbmppalet
dw 0
;==========SHOWBMP=========
;Affiche le BMP pointée par DS:%0 en %1, %2
;<- DS:%0 BMP, %1 coordonnées X, %2 coordonnées Y
;->
;==========================
showbmp PROC FAR
ARG pointer:word, x:word, y:word=taille
push bp
mov bp,sp
push ax bx cx dx si di
mov si,[pointer]
cmp word ptr [si+BMP_file.BMP_FileType],"MB"
jne @@errorshowing
mov edi,[si+BMP_BitMapOffset]
add di,si
mov ah,8
xor ebx,ebx
mov ecx,[si+offset BMP_File.BMP_height]
mov edx,[si+offset BMP_File.BMP_width]
and dx,11111100b
cmp edx,[si+offset BMP_File.BMP_width]
jae @@noadjust
add dx,4
@@noadjust:
sub dx,[si+offset BMP_File.BMP_width]
@@bouclette:
mov al,[di]
push bx cx
add bx,[x]
add cx,[y]
int 47h
pop cx bx
inc bx
inc di
cmp ebx,[si+offset BMP_File.BMP_width]
jb @@bouclette
xor bx,bx
add di,dx
dec cx
cmp cx,0
jne @@bouclette
clc
pop di si dx cx bx ax
pop bp
retf taille
@@errorshowing:
stc
pop di si cx bx ax
pop bp
retf taille
showbmp ENDP
;==========LOADBMPPALET=========
;Charge la palette du BMP pointée par DS:%0
;-> DS:%0 BMP
;<-
;===============================
loadbmppalet PROC FAR
ARG pointer:word=taille
push bp
mov bp,sp
push ax bx cx dx si
mov si,[pointer]
mov bx,0400h+36h-4
mov cx,100h
mov dx, 3c8h
paletteload:
mov al, cl
dec al
out dx, al
inc dx
mov al,[bx+si+2]
shr al,2
out dx, al
mov al,[bx+si+1]
shr al,2
out dx, al
mov al,[bx+si]
shr al,2
out dx, al
sub bx,4
dec dx
dec cl
jnz paletteload
pop si dx cx bx ax
pop bp
retf taille
loadbmppalet ENDP
end start

772
lib/detect.asm Normal file
View File

@ -0,0 +1,772 @@
model tiny,stdcall
p586
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\cpu.h"
include "..\include\pci.h"
org 0h
header exe <"CE",1,0,0,offset exports,,,>
exports:
db "cpuinfo",0
dw cpuinfo
db "setinfo",0
dw setinfo
db "pciinfo",0
dw pciinfo
db "getpciclass",0
dw getpciclass
db "getpcisubclass",0
dw getpcisubclass
db "getcardinfo",0
dw getcardinfo
db "pcireadbyte",0
dw pcireadbyte
db "pcireadword",0
dw pcireadword
db "pcireaddword",0
dw pcireaddword
db "detectvmware",0
dw detectvmware
dd 0
PROC detectvmware FAR
USES eax,ebx,ecx,edx
mov eax,564D5868h
mov ebx,12345h
mov ecx,00Ah
mov edx,5658h
in ax,dx
cmp ebx,564D5868h
ret
endp detectvmware
;renvoie un pointer dx:ax vers la classe %0
PROC getpciclass FAR
ARG @class:word
USES di
mov di,[@class]
and di,0FFh
shl di,1
mov ax,[cs:offset classes+di]
mov dx,cs
ret
endp getpciclass
;renvoie un pointer dx:ax vers la sous-classe de %1 et de classe %0
PROC getpcisubclass FAR
ARG @class:word,@subclass:word
USES di
mov di,[@class]
and di,0FFh
shl di,1
mov di,[cs:offset classesd+di]
mov dx,[@subclass]
and dx,0FFh
cmp dx,80h
jne @@suiteac
mov ax,offset divers
jmp @@found
@@suiteac:
shl dx,1
add di,dx
mov ax,[cs:di]
@@found:
mov dx,cs
ret
endp getpcisubclass
divers db 'divers',0
classes:
dw offset class0
dw offset class1
dw offset class2
dw offset class3
dw offset class4
dw offset class5
dw offset class6
dw offset class7
dw offset class8
dw offset class9
dw offset class10
dw offset class11
dw offset class12
dw offset class13
dw offset class14
dw offset class15
dw offset class16
dw offset class17
class0 db 'ancien',0
class1 db 'stockage',0
class2 db 'reseau',0
class3 db 'affichage',0
class4 db 'multimedia',0
class5 db 'memoire',0
class6 db 'pont',0
class7 db 'communication',0
class8 db 'systeme',0
class9 db 'acquisition',0
class10 db 'dock',0
class11 db 'processeur',0
class12 db 'bus serie',0
class13 db 'sans fil',0
class14 db 'intelligent',0
class15 db 'satellite',0
class16 db 'cryptage',0
class17 db 'traitement signal',0
;Classes et sous classes
classesd:
dw offset class0d
dw offset class1d
dw offset class2d
dw offset class3d
dw offset class4d
dw offset class5d
dw offset class6d
dw offset class7d
dw offset class8d
dw offset class9d
dw offset class10d
dw offset class11d
dw offset class12d
dw offset class13d
dw offset class14d
dw offset class15d
dw offset class16d
dw offset class17d
class0d:
dw offset subclass00
dw offset subclass01
subclass00 db 'divers',0
subclass01 db 'vga',0
class1d:
dw offset subclass10
dw offset subclass11
dw offset subclass12
dw offset subclass13
dw offset subclass14
subclass10 db 'scsi',0
subclass11 db 'ide',0
subclass12 db 'disquette',0
subclass13 db 'ipi',0
subclass14 db 'raid',0
class2d:
dw offset subclass20
dw offset subclass21
dw offset subclass22
dw offset subclass23
dw offset subclass24
subclass20 db 'ethernet',0
subclass21 db 'token ring',0
subclass22 db 'fddi',0
subclass23 db 'atm',0
subclass24 db 'isdn',0
class3d:
dw offset subclass30
dw offset subclass31
dw offset subclass32
subclass30 db 'vga',0
subclass31 db 'xga',0
subclass32 db '3D',0
class4d:
dw offset subclass40
dw offset subclass41
dw offset subclass42
subclass40 db 'video',0
subclass41 db 'audio',0
subclass42 db 'telephonie',0
class5d:
dw offset subclass50
dw offset subclass51
subclass50 db 'ram',0
subclass51 db 'flash',0
class6d:
dw offset subclass60
dw offset subclass61
dw offset subclass62
dw offset subclass63
dw offset subclass64
dw offset subclass65
dw offset subclass66
dw offset subclass67
dw offset subclass68
subclass60 db 'hote',0
subclass61 db 'isa',0
subclass62 db 'eisa',0
subclass63 db 'mca',0
subclass64 db 'pci',0
subclass65 db 'pcmcia',0
subclass66 db 'nubus',0
subclass67 db 'cardbus',0
subclass68 db 'RACEway',0
class7d:
dw offset subclass70
dw offset subclass71
dw offset subclass72
dw offset subclass73
subclass70 db 'serie',0
subclass71 db 'parallele',0
subclass72 db 'serie multiport',0
subclass73 db 'modem',0
class8d:
dw offset subclass80
dw offset subclass81
dw offset subclass82
dw offset subclass83
dw offset subclass84
subclass80 db 'pic',0
subclass81 db 'dma',0
subclass82 db 'timer',0
subclass83 db 'rtc',0
subclass84 db 'hotplug',0
class9d:
dw offset subclass90
dw offset subclass91
dw offset subclass92
dw offset subclass93
dw offset subclass94
subclass90 db 'clavier',0
subclass91 db 'stylo',0
subclass92 db 'souris',0
subclass93 db 'scanner',0
subclass94 db 'joystick',0
class10d:
dw offset subclass100
subclass100 db 'station',0
class11d:
dw offset subclass110
dw offset subclass111
dw offset subclass112
dw offset subclass113
dw offset subclass114
subclass110 db '386',0
subclass111 db '486',0
subclass112 db 'pentium',0
subclass113 db 'alpha',0
subclass114 db 'coprocesseur',0
class12d:
dw offset subclass120
dw offset subclass121
dw offset subclass122
dw offset subclass123
dw offset subclass124
dw offset subclass125
subclass120 db 'firewire',0
subclass121 db 'access',0
subclass122 db 'ssa',0
subclass123 db 'usb',0
subclass124 db 'fibre',0
subclass125 db 'smbus',0
class13d:
dw offset subclass130
dw offset subclass131
dw offset subclass132
subclass130 db 'irda',0
subclass131 db 'ir',0
subclass132 db 'rf',0
class14d:
dw offset subclass140
subclass140 db 'IO arch',0
class15d:
dw offset subclass150
dw offset subclass151
dw offset subclass152
dw offset subclass153
subclass150 db 'tv',0
subclass151 db 'audio',0
subclass152 db 'voix',0
subclass153 db 'donnees',0
class16d:
dw offset subclass160
dw offset subclass161
subclass160 db 'reseau',0
subclass161 db 'jeux',0
class17d:
dw offset subclass170
subclass170 db 'dpio',0
;al=bus cl=deviceid ch=func es:di
PROC getcardinfo FAR
ARG @bus:word,@device:word,@function:word,@pointer:word
USES eax,bx,di
cmp [@function],0
je @@amultiorfirst
call pcireadbyte,[@bus],[@device],0,offset (pcidata).typed
and al,multifunction
cmp al,0
jne @@amultiorfirst
mov [word ptr di],0000h
jmp @@notexist
@@amultiorfirst:
xor bx,bx
mov di,[@pointer]
@@goinfos:
call pcireadword,[@bus],[@device],[@function],bx
inc bl
inc bl
cmp bl,2
ja @@notzarb
cmp ax,0FFFFh
je @@notexist
cmp ax,00000h
je @@notexist
@@notzarb:
mov [ds:di],ax
inc di
inc di
cmp bl,40h
jbe @@goinfos
clc
ret
@@notexist:
stc
ret
endp getcardinfo
;lit un octet du bus %0 device %1 function %2 n° %3 et le met en AL
PROC pcireadbyte FAR
ARG @bus:word,@device:word,@function:word,@pointer:word
USES bx,dx
mov al,[byte ptr @bus]
mov ah,80h
shl eax,16
mov ah,[byte ptr @device]
shl ah,3
or ah,[byte ptr @function]
mov bl,[byte ptr @pointer]
mov al,bl
and al,0fch
mov dx,config1addr
out dx,eax
mov dx,config1data
and bl,3
or dl,bl
in al,dx
ret
endp pcireadbyte
;lit 2 octet du bus %0 device %1 function %2 n° %3 et le met en AX
PROC pcireadword FAR
ARG @bus:word,@device:word,@function:word,@pointer:word
USES bx,dx
mov al,[byte ptr @bus]
mov ah,80h
shl eax,16
mov ah,[byte ptr @device]
shl ah,3
or ah,[byte ptr @function]
mov bl,[byte ptr @pointer]
mov al,bl
and al,0fch
mov dx,config1addr
out dx,eax
mov dx,config1data
and bl,3
or dl,bl
in ax,dx
ret
endp pcireadword
;lit 4 octet du bus %0 device %1 function %2 n° %3 et le met en EAX
PROC pcireaddword FAR
ARG @bus:word,@device:word,@function:word,@pointer:word
USES bx,dx
mov al,[byte ptr @bus]
mov ah,80h
shl eax,16
mov ah,[byte ptr @device]
shl ah,3
or ah,[byte ptr @function]
mov bl,[byte ptr @pointer]
mov al,bl
and al,0fch
mov dx,config1addr
out dx,eax
mov dx,config1data
and bl,3
or dl,bl
in eax,dx
ret
endp pcireaddword
;Prob avec str pci
;renvoie en %0 la structure pciinf carry if error
PROC pciinfo FAR
ARG @pointer:word
USES ax,bx,cx,edx,edi
mov ax,0B101h
xor edi,edi
mov edx," PCI"
int 1Ah
jc @@errorpci
cmp dx,04350h
jne @@errorpci
cmp ah,0
jne @@errorpci
mov di,[@pointer]
mov [(pciinf di).version_major],bh
mov [(pciinf di).version_minor],bl
mov [(pciinf di).types],al
mov [(pciinf di).maxbus],cl
clc
ret
@@errorpci:
stc
ret
endp pciinfo
;retourne en DS:%1 les set supporté du processeur par rapport a la struct %0
PROC setinfo FAR
ARG @pointer:word,@set:word
USES bx,si,di
mov di,[@set]
lea si,[ds:cpu.mmx]
add si,[@pointer]
mov bx,offset @@theset
@@set:
cmp [word ptr cs:bx],0FFFFh
je @@endofset
cmp [byte ptr si],1
jne @@nextset
push bx
mov bx,[cs:bx]
@@put:
mov al,[cs:bx]
cmp al,0
je @@enofput
mov [di],al
inc bx
inc di
jmp @@put
@@enofput:
pop bx
@@nextset:
inc bx
inc bx
inc si
jmp @@set
@@endofset:
mov [byte ptr di],0
ret
@@theset dw offset @@mmx
dw offset @@mmx2
dw offset @@sse
dw offset @@sse2
dw offset @@sse3
dw offset @@fpu
dw offset @@now3d
dw offset @@now3d2
dw offset @@htt
dw offset @@apic
dw 0FFFFh
@@mmx db "MMX ",0
@@mmx2 db "MMX2 ",0
@@now3d db "3dNow! ",0
@@now3d2 db "3dNow Extended! ",0
@@htt db "HyperThreading",0
@@sse db "SSE ",0
@@sse2 db "SSE2 ",0
@@sse3 db "SSE3 ",0
@@apic db "APIC ",0
@@fpu db "FPU ",0
endp setinfo
;retourne en DS:%0 les capacités du processeur
PROC cpuinfo FAR
ARG @pointer:word
USES eax,ebx,ecx,edx,si,di,ds,es
push ds
pop es
mov di,[@pointer]
mov al,0
mov cx,size cpu
cld
rep stosb
mov di,[@pointer]
call nocpuid ;Test si cpuid est dispo
je @@nocpuidatall
xor eax,eax
cpuid ;Fonction 0 de CPUID
mov [dword ptr (cpu di).vendor],ebx ;Vendeur sur 13 octets
mov [dword ptr (cpu di+4).vendor],edx
mov [dword ptr (cpu di+8).vendor],ecx
mov [byte ptr (cpu di+12).vendor],0
cmp eax,1
jb @@nofonc1
mov eax,1
cpuid ;Fonction 1 de CPUID
mov ebx,eax ;infos de model
and ebx,1111b
mov [(cpu di).stepping],bl
shr eax,4
mov ebx,eax
and ebx,1111b
mov [(cpu di).models],bl
shr eax,4
mov ebx,eax
and ebx,1111b
mov [(cpu di).family],bl
shr eax,4
mov ebx,eax
and ebx,11b
mov [(cpu di).types],bl
shr eax,2
mov ebx,eax
and ebx,1111b
mov [(cpu di).emodels],bl
shr eax,4
mov [(cpu di).efamily],al
mov ebx,edx
and ebx,1 ;infos de jeu d'instruction
setnz [(cpu di).fpu]
mov ebx,edx
and ebx,100000000000000000000000b
setnz [(cpu di).mmx]
mov ebx,edx
and ebx,10000000000000000000000000b
setnz [(cpu di).sse]
mov ebx,edx
and ebx,100000000000000000000000000b
setnz [(cpu di).sse2]
mov ebx,ecx
and ebx,1b
setnz [(cpu di).sse3]
mov ebx,edx
and ebx,10000000000000000000000000000b
setnz [(cpu di).htt]
@@nofonc1:
mov eax,80000000h ;Fonction 80000000 de CPUID
cpuid
cmp eax,80000001h
jb @@nofonc8
mov eax,80000001h ;Fonction 80000000 de CPUID
cpuid
mov ebx,edx
and ebx,10000000000000000000000b
setnz [(cpu di).mmx2]
mov ebx,edx
and ebx,1000000000000000000000000000000b
setnz [(cpu di).now3d]
mov ebx,edx
and ebx,10000000000000000000000000000000b
setnz [(cpu di).now3d2]
mov ebx,edx
and ebx,1000000000b
setnz [(cpu di).apic]
@@nofonc8:
mov si,offset @@marks
push cs
pop ds
@@search:
mov di,[@pointer]
mov cx,12
cld
rep cmpsb
jne @@notthegood
cmp cx,0
jne @@notthegood
mov cl,[si]
inc si
mov di,[@pointer]
cld
rep movsb
mov al,0
stosb
mov di,[@pointer]
cmp [es:(cpu di).family],15
jne @@notextended
mov al,[es:(cpu di).efamily]
mov ah,[es:(cpu di).emodels]
mov di,[si+2]
jmp @@searchmodel
@@notextended:
mov al,[es:(cpu di).family]
mov ah,[es:(cpu di).models]
mov di,[si]
@@searchmodel:
cmp [di],ax
jne @@notgoodfamily
mov si,di
inc si
inc si
lea di,[es:cpu.names]
add di,[@pointer]
@@copystr:
mov al,[si]
mov [es:di],al
inc si
inc di
cmp al,0
jne @@copystr
jmp @@endofsearch
@@notgoodfamily:
inc di
@@nextelement:
inc di
cmp [byte ptr di-1],0
jne @@nextelement
jmp @@searchmodel
@@notthegood:
inc si
cmp [word ptr si],0FFFFh
jne @@notthegood
inc si
inc si
cmp [word ptr si],0FFFFh
je @@endofsearch
jmp @@search
@@endofsearch:
ret
@@nocpuidatall:
ret
;tableau avec vendeur taille + chainereelle + pointeur famille + pointeur famille etendue
@@marks db "GenuineIntel",5,"Intel"
dw @@intelfamily,@@intelfamilye
dw 0FFFFh
db "AuthenticAMD",3,"Amd"
dw @@amdfamily,@@amdfamilye
dw 0FFFFh
db "CyrixInstead",5,"Cyrix"
dw @@cyrixfamily,@@cyrixfamilye
dw 0FFFFh
dw 0FFFFh
;tableau avec famille modele et chaine 0
@@intelfamily:
db 4,0,"486 DX-25/33",0
db 4,1,"486 DX-50",0
db 4,2,"486 SX",0
db 4,3,"486 DX/2",0
db 4,4,"486 SL",0
db 4,5,"486 SX/2",0
db 4,7,"486 DX/2-WB",0
db 4,8,"486 DX/4",0
db 4,9,"486 DX/4-WB",0
db 5,0,"Pentium 60/66 A-step",0
db 5,1,"Pentium 60/66",0
db 5,2,"Pentium 75 - 200",0
db 5,3,"OverDrive PODP5V83",0
db 5,4,"Pentium MMX",0
db 5,7,"Mobile Pentium 75-200",0
db 5,8,"Mobile Pentium MMX",0
db 6,0,"Pentium Pro A-step",0
db 6,1,"Pentium Pro",0
db 6,3,"Pentium II (Klamath)",0
db 6,5,"Pentium II (Deschutes)",0
db 6,6,"Mobile Pentium II",0
db 6,7,"Pentium III (Katmai)",0
db 6,8,"Pentium III (Coppermine)",0
db 6,9,"Mobile Pentium III",0
db 6,10,"Pentium III (0.18 µm)",0
db 6,11,"Pentium III (0.13 µm)",0
db 7,0,"Itanium (IA-64)",0
db 0FFh,0FFh,"Inconnu",0
@@intelfamilye:
db 0,0,"Pentium IV (0.18 µm)",0
db 0,1,"Pentium IV (0.18 µm)",0
db 0,2,"Pentium IV (0.13 µm)",0
db 0,3,"Pentium IV (0.09 µm)",0
db 1,0,"Itanium 2 (IA-64)",0
db 0FFh,0FFh,"Inconnu",0
@@amdfamily:
db 4,3,"486 DX/2",0
db 4,7,"486 DX/2-WB",0
db 4,8,"486 DX/4",0
db 4,9,"486 DX/4-WB",0
db 4,14,"Am5x86-WT",0
db 4,15,"Am5x86-WB",0
db 5,0,"K5/SSA5",0
db 5,1,"K5 (PR120/133)",0
db 5,2,"K5 (PR166)",0
db 5,3,"K5 (PR200)",0
db 5,6,"K6 (0.30 µm)",0
db 5,7,"K6 (0.25 µm)",0
db 5,8,"K6-2",0
db 5,9,"K6-3",0
db 5,13,"K6-2+/K6-III+ (0.18 µm)",0
db 6,0,"Athlon (25 µm)",0
db 6,1,"Athlon (25 µm)",0
db 6,2,"Athlon (18 µm)",0
db 6,3,"Duron",0
db 6,4,"Athlon (Thunderbird)",0
db 6,6,"Athlon (Palamino)",0
db 6,7,"Duron (Morgan)",0
db 6,8,"Athlon (Thoroughbred)",0
db 6,10,"Athlon (Barton)",0
db 0FFh,0FFh,"Inconnu",0
@@amdfamilye:
db 0,4,"Athlon 64",0
db 0,5,"Athlon 64 FX/Opteron",0
db 0FFh,0FFh,"Inconnu",0
@@cyrixfamily:
db 4,4,"MediaGX",0
db 5,2,"6x86/6x86L",0
db 5,4,"MediaGX MMX Enhanced",0
db 6,0,"MII (6x86MX)",0
db 6,5,"VIA Cyrix M2 core",0
db 6,6,"WinChip C5A",0
db 6,7,"WinChip C5B/WinChip C5C",0
db 6,8,"WinChip C5N",0
db 6,9,"WinChip C5XL/WinChip C5P",0
db 0FFh,0FFh,"Inconnu",0
@@cyrixfamilye:
db 0FFh,0FFh,"Inconnu",0
endp cpuinfo
;Test si CPUID est supporté oui=not Equal
nocpuid:
pushfd
pop eax
xor eax,00200000h
push eax
popfd
pushfd
pop eax
cmp eax,ebx
ret

907
lib/video.asm Normal file
View File

@ -0,0 +1,907 @@
model tiny,stdcall
p486
locals
jumps
codeseg
option procalign:byte
include "..\include\mem.h"
org 0h
header exe <"CE",1,0,0,offset exports,offset imports,,>
exports:
db "print",0
dw print
db "showdate",0
dw showdate
db "showtime",0
dw showtime
db "showname",0
dw showname
db "showattr",0
dw showattr
db "showsize",0
dw showsize
db "showspace",0
dw showspace
db "showint",0
dw showint
db "showsigned",0
dw showsigned
db "showhex",0
dw showhex
db "showbin",0
dw showbin
db "showbcd",0
dw showbcd
db "showstring",0
dw showstring
db "showstring0",0
dw showstring0
db "showintr",0
dw showintr
db "showintl",0
dw showintl
dw 0
imports:
db "VIDEO::addline",0
addline dd 0
db "VIDEO::setcolor",0
setcolor dd 0
db "VIDEO::getxy",0
getxy dd 0
db "VIDEO::setxy",0
setxy dd 0
db "VIDEO::setvideomode",0
setvideomode dd 0
db "VIDEO::setfont",0
setfont dd 0
db "VIDEO::clearscreen",0
clearscreen dd 0
db "VIDEO::enablescroll",0
enablescroll dd 0
db "VIDEO::disablescroll",0
disablescroll dd 0
db "VIDEO::showchar",0
showchar dd 0
dw 0
;================PRINT==============
;Affiche la chaine %0 en utilisant les parametres de formatage %x....%x
;-> %0 %x
;<-
;===================================
PROC print FAR
ARG @@pointer:word
push ax bx cx si di
xor di,di
mov si,[@@pointer]
@@strinaize0:
mov cl,[si]
cmp cl,0
je @@no0
cmp cl,'%'
je @@special
cmp cl,'\'
je @@special2
@@showit:
xor ch,ch
call [cs:showchar],cx,0FFFFh
inc si
jmp @@strinaize0
@@special:
cmp [byte ptr si+1],'%'
jne @@notshowit
inc si
jmp @@showit
@@notshowit:
mov cl,[byte ptr si+1]
cmp cl,'c'
je @@showchar
cmp cl,'u'
je @@showint
cmp cl,'v'
je @@showfixint
cmp cl,'w'
je @@showintr
cmp cl,'i'
je @@showsigned
cmp cl,'h'
je @@showhex
cmp cl,'b'
je @@showbin
cmp cl,'s'
je @@showstring
cmp cl,'0'
je @@showstring0
cmp cl,'y'
je @@showbcd
cmp cl,'z'
je @@showsize
cmp cl,'a'
je @@showattr
cmp cl,'n'
je @@showname
cmp cl,'t'
je @@showtime
cmp cl,'d'
je @@showdate
clc
jmp @@no0
@@showchar:
cmp [byte ptr si+2],'M'
je @@showmultchar
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh
add si,2
add di,2
jmp @@strinaize0
@@showmultchar:
mov cx,[offset @@pointer+di+2+2]
cmp cx,0
je @@nextfunc
@@showcharx:
call [cs:showchar],[word ptr @@pointer+di+2],0FFFFh
dec cx
jnz @@showcharx
@@nextfunc:
add si,3
add di,4
jmp @@strinaize0
@@showint:
call showint,[dword ptr @@pointer+di+2]
add si,2
add di,4
jmp @@strinaize0
@@showfixint:
call showintl,[word ptr @@pointer+di+6],[dword ptr @@pointer+di+2]
add di,6
add si,2
jmp @@strinaize0
@@showintr:
call showintr,[word ptr @@pointer+di+6],[dword ptr @@pointer+di+2]
add di,6
add si,2
jmp @@strinaize0
@@showsigned:
call @@Chosesize
call showsigned
jmp @@strinaize0
@@showhex:
call @@Chosesize
call showhex
jmp @@strinaize0
@@showbin:
call @@Chosesize
call showbin
jmp @@strinaize0
@@showstring:
cmp [byte ptr si+2],'P'
je @@showstring@@pointer
call showstring,[word ptr @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@showstring@@pointer:
push ds
mov ds,[offset @@pointer+di+2+2]
call showstring,[word ptr @@pointer+di+2]
add si,3
add di,4
pop ds
jmp @@strinaize0
@@showstring0:
cmp [byte ptr si+2],'P'
je @@showstring0@@pointer
call showstring0,[word ptr offset @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@showstring0@@pointer:
push ds
mov ds,[offset @@pointer+di+2+2]
call showstring0,[word ptr offset @@pointer+di+2]
add si,3
add di,4
pop ds
jmp @@strinaize0
@@showbcd:
call @@Chosesize
call showbcd
jmp @@strinaize0
@@showsize:
call showsize,[dword ptr offset @@pointer+di+2]
add si,2
add di,4
jmp @@strinaize0
@@showattr:
call showattr,[word ptr offset @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@showname:
call showname,[word ptr offset @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@showtime:
call showtime,[word ptr offset @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@showdate:
call showdate,[word ptr offset @@pointer+di+2]
add si,2
add di,2
jmp @@strinaize0
@@Chosesize:
pop cx
push [dword ptr offset @@pointer+di+2]
add di,4
cmp [byte ptr si+2],'B'
je @@byte
cmp [byte ptr si+2],'W'
je @@word
cmp [byte ptr si+2],'D'
je @@dword
dec si
@@word:
push 16
add si,3
push cx
retn
@@byte:
push 8
add si,3
push cx
retn
@@dword:
push 32
add si,3
push cx
retn
@@special2:
cmp [byte ptr si+1],'\'
jne @@notshowit2
inc si
jmp @@showit
@@notshowit2:
mov cl,[byte ptr si+1]
cmp cl,'l'
je @@showline
cmp cl,'g'
je @@goto
cmp cl,'h'
je @@gotox
cmp cl,'c'
je @@color
cmp cl,'m'
je @@setvideomode
cmp cl,'e'
je @@clearscreen
cmp cl,'s'
je @@savestate
cmp cl,'r'
je @@restorestate
cmp cl,'i'
je @@enablescroll
cmp cl,'j'
je @@disablescroll
cmp cl,'f'
je @@setfont
clc
jmp @@no0
@@color:
mov al,[si+2]
sub al,'0'
shl al,4
add al,[si+3]
sub al,'0'
xor ah,ah
call [cs:setcolor],ax
add si,4
jmp @@strinaize0
@@gotox:
mov bh,[si+2]
sub bh,'0'
mov bl,bh
shl bl,3
add bl,bh
add bl,bh
add bl,[si+3]
sub bl,'0'
xor bh,bh
call [cs:getxy]
xor ah,ah
call [cs:setxy],bx,ax
add si,4
jmp @@strinaize0
@@setvideomode:
mov ah,[si+2]
sub ah,'0'
mov al,ah
shl al,3
add al,ah
add al,ah
add al,[si+3]
sub al,'0'
xor ah,ah
call [cs:setvideomode]
add si,4
jmp @@strinaize0
@@setfont:
mov ah,[si+2]
sub ah,'0'
mov al,ah
shl al,3
add al,ah
add al,ah
add al,[si+3]
sub al,'0'
xor ah,ah
call [cs:setfont],ax
add si,4
jmp @@strinaize0
@@showline:
call [cs:addline]
add si,2
jmp @@strinaize0
@@clearscreen:
call [cs:clearscreen]
add si,2
jmp @@strinaize0
@@savestate:
mov ah,40
int 47h
add si,2
jmp @@strinaize0
@@restorestate:
mov ah,41
int 47h
add si,2
jmp @@strinaize0
@@enablescroll:
call [cs:enablescroll]
add si,2
jmp @@strinaize0
@@disablescroll:
call [cs:disablescroll]
add si,2
jmp @@strinaize0
@@goto:
mov ah,[si+2]
sub ah,'0'
mov al,ah
shl al,3
add al,ah
add al,ah
add al,[si+3]
sub al,'0'
xor ah,ah
;
mov bh,[si+5]
sub bh,'0'
mov bl,bh
shl bl,3
add bl,bh
add bl,bh
add bl,[si+6]
sub bl,'0'
xor bh,bh
call [cs:setxy],ax,bx
mov ah,25
int 47h
add si,7
jmp @@strinaize0
@@no0:
add di,bp
mov ax,[ss:bp] ;BP
mov bx,[ss:bp+2] ;IP
mov cx,[ss:bp+4] ;CS
mov [ss:di],ax
mov [ss:di+2],bx
mov [ss:di+4],cx
mov bp,di
pop di si cx bx ax
mov sp,bp
ret
ENDP print
;================SHOWDATE==============
;Affiche la date contenu en %0
;-> %0
;<-
;======================================
PROC showdate FAR
ARG @dates:word
USES edx
xor edx,edx
mov dx,[@dates]
and dx,11111b
call showintl,2,edx
call [cs:showchar],'/',0FFFFh
mov dx,[@dates]
shr dx,5
and dx,111b
call showintl,2,edx
call [cs:showchar],'/',0FFFFh
mov dx,[@dates]
shr dx,8
and dx,11111111b
add dx,1956
call showintl,2,edx
ret
ENDP showdate
;================SHOWTIME==============
;Affiche l'heure contenu en %0
;-> %0
;<-
;======================================
PROC showtime FAR
ARG @times:word
USES edx
xor edx,edx
mov dx,[@times]
shr dx,11
and dx,11111b
call showintl,2,edx
call [cs:showchar],':',0FFFFh
mov dx,[@times]
shr dx,5
and dx,111111b
call showintl,2,edx
call [cs:showchar],':',0FFFFh
mov dx,[@times]
and dx,11111b
shl dx,1
call showintl,2,edx
ret
ENDP showtime
;================SHOWNAME==============
;Affiche le nom pointé par ds:%0
;-> ds:%0
;<-
;======================================
PROC showname FAR
ARG @thename:word
USES cx,si
mov si,[@thename]
xor cx,cx
@@showthename:
call [cs:showchar],[word ptr ds:si],0FFFFh
inc si
inc cx
cmp cx,8
jne @@suiteaname
call [cs:showchar],' ',0FFFFh
@@suiteaname:
cmp cx,8+3
jb @@showthename
ret
ENDP showname
;================SHOWATTR==============
;Affiche les attributs spécifié par %0
;-> %0
;<-
;======================================
PROC showattr FAR
ARG @attr:word
push 0FFFFh
test [@attr],00000001b
je @@noreadonly
push 'L'
jmp @@readonly
@@noreadonly:
push '-'
@@readonly:
call [cs:showchar]
push 0FFFFh
test [@attr],00000010b
je @@nohidden
push 'C'
jmp @@hidden
@@nohidden:
push '-'
@@hidden:
call [cs:showchar]
push 0FFFFh
test [@attr],00000100b
je @@nosystem
push 'S'
jmp @@system
@@nosystem:
push '-'
@@system:
call [cs:showchar]
push 0FFFFh
test [@attr],00100000b
je @@noarchive
push 'A'
jmp @@archive
@@noarchive:
push '-'
@@archive:
call [cs:showchar]
push 0FFFFh
test [@attr],00010000b
je @@nodirectory
push 'R'
jmp @@directory
@@nodirectory:
push '-'
@@directory:
call [cs:showchar]
ret
ENDP showattr
;================SHOWSIZE==============
;Affiche le nom pointé par %0
;-> %0
;<-
;======================================
PROC showsize FAR
ARG @thesize:dword
USES edx,ds
push cs
pop ds
mov edx,[@thesize]
cmp edx,1073741824
ja @@giga
cmp edx,1048576*9
ja @@mega
cmp edx,1024*9
ja @@kilo
call showintr,4,edx
call showstring0,offset unit
jmp @@finsize
@@kilo:
shr edx,10
call showintr,4,edx
call showstring0,offset unitkilo
jmp @@finsize
@@mega:
shr edx,20
call showintr,4,edx
call showstring0,offset unitmega
jmp @@finsize
@@giga:
shr edx,30
call showintr,4,edx
call showstring0,offset unitgiga
@@finsize:
ret
unit db ' o ',0
unitkilo db ' ko',0
unitmega db ' mo',0
unitgiga db ' go',0
ENDP showsize
;==========SHOWSPACE===========
;met un espace aprés le curseur
;->
;<-
;==============================
PROC showspace FAR
call [cs:showchar],' ',0FFFFh
clc
ret
ENDP showspace
;==========SHOWINT===========
;Affiche un entier %0 aprés le curseur
;-> %0
;<-
;============================
PROC showint FAR
ARG @integer:dword
USES eax,bx,cx,edx,esi
xor cx,cx
mov eax,[@integer]
mov esi,10
mov bx,offset showbuffer+27
@@decint:
xor edx,edx
div esi
add dl,'0'
inc cx
mov [cs:bx],dl
dec bx
cmp ax,0
jne @@decint
mov ax,cx
@@showinteger:
inc bx
mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh
dec ax
jnz @@showinteger
ret
showbuffer db 50 dup (0FFh)
ENDP showint
;==========SHOWINTL===========
;Affiche un entier %0 aprés le curseur de taille %1 caractère centré a gauche
;-> %0 un entier % taille en caractères
;<-
;===============================
PROC showintl FAR
ARG @sizeofint:word,@integer:dword
USES eax,bx,cx,edx,esi,di
mov di,[@sizeofint]
xor cx,cx
mov eax,[@integer]
mov esi,10
mov bx,offset showbuffer+27
@@decint:
xor edx,edx
div esi
add dl,'0'
inc cx
mov [cs:bx],dl
dec bx
cmp cx,di
jae @@nomuch
cmp ax,0
jne @@decint
mov ax,di
xchg cx,di
sub cx,di
@@rego:
mov [byte ptr cs:bx],'0'
dec bx
dec cx
jnz @@rego
jmp @@finishim
@@nomuch:
mov ax,di
@@finishim:
@@showinteger:
inc bx
mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh
dec ax
jnz @@showinteger
ret
ENDP showintl
;==========SHOWINTR===========
;Affiche un entier %0 aprés le curseur de taille %1 caractère centré a droite
;-> %0 un entier % taille en caractères
;<-
;===============================
PROC showintr FAR
ARG @sizeofint:word,@integer:dword
USES eax,bx,cx,edx,esi,di
mov di,[@sizeofint]
xor cx,cx
mov eax,[@integer]
mov esi,10
mov bx,offset showbuffer+27
@@decint:
xor edx,edx
div esi
add dl,'0'
inc cx
mov [cs:bx],dl
dec bx
cmp cx,di
jae @@nomuch
cmp ax,0
jne @@decint
mov ax,di
xchg cx,di
sub cx,di
@@rego:
mov [byte ptr cs:bx],' '
dec bx
dec cx
jnz @@rego
jmp @@finishim
@@nomuch:
mov ax,di
@@finishim:
@@showinteger:
inc bx
mov cl,[cs:bx]
call [cs:showchar],cx,0FFFFh
dec ax
jnz @@showinteger
ret
ENDP showintr
;==========SHOWSIGNED===========
;Affiche un entier %0 de taille %1 aprés le curseur
;-> %0 un entier, %1 la taille
;<-
;===============================
PROC showsigned FAR
ARG @sizeofint:word,@integer:dword=taille
USES ebx,cx,edx
mov ebx,[@integer]
mov cx,[@sizeofint]
xor edx,edx
cmp cx,1
ja @@signed16
mov dl,bl
cmp dl,7Fh
jbe @@notsigned
neg dl
jmp @@showminus
@@signed16:
cmp cx,2
ja @@signed32
mov dx,bx
cmp dx,7FFFh
jbe @@notsigned
neg dx
jmp @@showminus
@@signed32:
mov edx,ebx
cmp edx,7FFFFFFFh
jbe @@notsigned
neg edx
@@showminus:
call [cs:showchar],'-',0FFFFh
@@notsigned:
call showint,edx,0FFFFh
ret
ENDP showsigned
;==========SHOWHEX===========
;Affiche un nombre hexadécimal %0 de taille %1 aprés le curseur
;-> %0 un entier, %1 la taille
;<-
;============================
PROC showhex FAR
ARG @sizeofint:word,@integer:dword=taille
USES ax,bx,cx,edx
mov edx,[@integer]
mov cx,[@sizeofint]
mov ax,cx
shr ax,2
sub cx,32
neg cx
shl edx,cl
@@Hexaize:
rol edx,4
mov bx,dx
and bx,0fh
mov cl,[cs:bx+offset Tab]
call [cs:showchar],cx,0FFFFh
dec al
jnz @@Hexaize
ret
Tab db '0123456789ABCDEF'
ENDP showhex
;==========SHOWBIN===========
;Affiche un nombre binaire %0 de taille %1 aprés le curseur
;-> %0 un entier, %1 la taille
;<-
;============================
PROC showbin FAR
ARG @sizeofint:word,@integer:dword=taille
USES ax,cx,edx
mov edx,[@integer]
mov cx,[@sizeofint]
sub cx,32
neg cx
shl edx,cl
mov ax,[@sizeofint]
@@binaize:
rol edx,1
mov cl,'0'
adc cl,0
call [cs:showchar],cx,0FFFFh
dec al
jnz @@binaize
ret
ENDP showbin
;==========SHOWBCD===========
;Affiche un nombre en BCD %0 de taille %1 aprés le curseur
;-> %0 un entier, %1 la taille
;<-
;============================
PROC showbcd FAR
ARG @sizeofint:word,@integer:dword
USES ax,cx,edx
mov edx,[@integer]
mov ax,[@sizeofint]
mov cx,ax
shr ax,2
sub cx,32
neg cx
shl edx,cl
@@BCDaize:
rol edx,4
mov cl,dl
and cl,0fh
add cl,'0'
call [cs:showchar],cx,0FFFFh
dec al
jnz @@BCDaize
ret
ENDP showbcd
;==========SHOWSTRING===========
;Affiche une chaine de caractère pointée par ds:%1 aprés le curseur
;-> ds:%1 pointeur chaine type pascal
;<-
;===============================
PROC showstring FAR
ARG @pointer:word
USES bx,si
mov si,[@pointer]
mov bl,[si]
@@strinaize:
inc si
call [cs:showchar],[word ptr si],0FFFFh
dec bl
jnz @@strinaize
ret
ENDP showstring
;==========SHOWSTRING0===========
;Affiche une chaine de caractère pointée par ds:%1 aprés le curseur
;-> ds:%1 pointeur chaine type zéro terminal
;<-
;================================
PROC showstring0 FAR
ARG @pointer:word
USES cx,si
mov si,[@pointer]
@@strinaize0:
mov cl,[si]
cmp cl,0
je @@no0
call [cs:showchar],cx,0FFFFh
inc si
jmp @@strinaize0
@@no0:
ret
ENDP showstring0

View File

@ -1,64 +1,11 @@
.model tiny
.486
smart
.code
org 0100h
start:
jmp tsr
db 'PIC8259A'
Tsr:
cli
cmp ax,1234h
jne nomore
mov ax,4321h
jmp itsok
nomore:
push bx
mov bl,ah
xor bh,bh
shl bx,1
mov bx,cs:[bx].tables
mov cs:current,bx
pop bx
call cs:current
itsok:
jnc noerror
push bp
mov bp,sp
or byte ptr [bp+6],1b
pop bp
mov ax,cs
shl eax,16
mov ax,cs:current
jmp endofint
noerror:
push bp
mov bp,sp
and byte ptr [bp+6],0FEh
pop bp
endofint:
sti
iret
current dw 0
tables dw enableirq
dw disableirq
dw readmaskirq
dw readirr
dw readisr
dw installhandler
dw replacehandler
dw getint
dw setint
dw seteoi
;Adresses de port du contr“leur IRQ ;Adresses de port du contr“leur IRQ
MASTERPIC = 020h ;Adresse de base du PIC maŒtre MASTERPIC = 020h ;Adresse de base du PIC maŒtre
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
IRQMASK = 001h ;Offset sur port de masquage IRQMASK = 001h ;Offset sur port de masquage
;Commandes IRQ OCW2 ;Commandes IRQ OCW2
DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique
EOI = 020h ;End of Interrupt non spcifi EOI = 020h ;End of Interrupt non spcifi
COMMANDEOI = 060h ;Commande EOI particulière COMMANDEOI = 060h ;Commande EOI particulière
ENABLEROTATION = 080h ;Activer la rotation de priorités en mode EOI automatique ENABLEROTATION = 080h ;Activer la rotation de priorités en mode EOI automatique
ROTATIONNOSPEC = 0A0h ;Rotation des priorités en mode EOI automatique ROTATIONNOSPEC = 0A0h ;Rotation des priorités en mode EOI automatique
@ -66,176 +13,130 @@ tables dw enableirq
ROTATIONSPEC = 0E0h ;Rotation des priorités en mode EOI spécifié ROTATIONSPEC = 0E0h ;Rotation des priorités en mode EOI spécifié
;Position des vecteurs d'interruptions ;Position des vecteurs d'interruptions
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
SLAVEFIRSTVECTOR = 070h ;lectroniques SLAVEFIRSTVECTOR = 070h ;lectroniques
;OCW3 codes registres ;OCW3 codes registres
IRR = 002h ;Interrupt Request Register IRR = 002h ;Interrupt Request Register
ISR = 003h ;In Service Register ISR = 003h ;In Service Register
;OCW3 et modes ;OCW3 et modes
OCW3 = 008h ;OCW3 OCW3 = 008h ;OCW3
POLLING = 004h ;Polling bit POLLING = 004h ;Polling bit
ISR = 0Bh ; Pas d'opration, pas de Poll, lire ISR OCW3 ISR = 0Bh ; Pas d'opration, pas de Poll, lire ISR OCW3
IRR = 0Ah ; Pas d'opration, pas de Poll, lire IRR IRR = 0Ah ; Pas d'opration, pas de Poll, lire IRR
;Autorise une interruption lectronique ;Autorise une interruption lectronique
;Entre : AL - Numro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC ;Entre : %1 - Numro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
EnableIRQ: PROC enableirq FAR
push ax cx dx ARG @irq:word
mov dx,MASTERPIC+IRQMASK USES ax,cx,dx
cmp al,7 mov ax,[@irq]
jbe master mov dx,MASTERPIC+IRQMASK
mov dx,SLAVEPIC+IRQMASK cmp al,7
master: jbe @@master
mov cl,al mov dx,SLAVEPIC+IRQMASK
and cl,7 @@master:
mov al,1 mov cl,al
shl al,cl and cl,7
not al mov al,1
mov ah,al shl al,cl
in al,dx not al
and al,ah mov ah,al
out dx,al in al,dx
pop dx cx ax and al,ah
ret out dx,al
ret
endp enableirq
;Desactive une interruption lectronique ;Desactive une interruption lectronique
;Entre : AL - Numro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC ;Entre : %0 - Numro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
DisableIRQ: PROC disableirq FAR
push ax cx dx ARG @irq:word
mov dx,MASTERPIC+IRQMASK USES ax,cx,dx
cmp al,7 mov ax,[@irq]
jbe master2 mov dx,MASTERPIC+IRQMASK
mov dx,SLAVEPIC+IRQMASK cmp al,7
master2: jbe @@master
mov cl,al mov dx,SLAVEPIC+IRQMASK
and cl,7 @@master:
mov al,1 mov cl,al
shl al,cl and cl,7
mov ah,al mov al,1
in al,dx shl al,cl
or al,ah not al
out dx,al mov ah,al
pop dx cx ax in al,dx
ret or al,ah
out dx,al
ret
endp disableirq
;Signale "End Of Interrupt" de l'interruption %0
PROC seteoi FAR
ARG @irq:word
USES ax,dx
mov ax,[@irq]
cmp al,7
jbe @@master
mov al,EOI
out SLAVEPIC,al
@@master:
mov al,EOI
out MASTERPIC,al
ret
endp seteoi
;Lit les masques d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
PROC readmaskirq FAR
ARG @controleur:word
USES bx,dx
mov bx,[@controleur]
mov dx,MASTERPIC+ IRQMASK
cmp bl,0
jne @@master
mov dx,SLAVEPIC+ IRQMASK
@@master:
xor ah,ah
in al,dx
pop dx
ret
endp readmaskirq
;Lit le registre d'tat d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
PROC readisr FAR
ARG @controleur:word
USES bx,dx
mov bx,[@controleur]
mov dx,MASTERPIC
cmp bh,0
jne @@master
mov dx,SLAVEPIC
@@master:
mov al,ISR
out dx,al
xor ah,ah
in al,dx
ret
endp readisr
;Signale "End Of Interrupt" de l'interruption al
SetEOI:
push ax dx
cmp al,7
jbe master3
mov al,EOI
out SLAVEPIC,al
master3:
mov al,EOI
out MASTERPIC,al
pop dx ax
ret
;Lit les masques d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
ReadmaskIrq:
push dx
mov dx,MASTERPIC+ IRQMASK
cmp bh,0
jne Master5
mov dx,SLAVEPIC+ IRQMASK
master5:
in al,dx
pop dx
ret
;Lit le registre d'tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh ;Lit le registre d'tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh
ReadISR: PROC readirr FAR
push dx ARG @controleur:word
mov dx,MASTERPIC USES bx,dx
cmp bh,0 mov bx,[@controleur]
jne Master6 mov dx,MASTERPIC
mov dx,SLAVEPIC cmp bh,0
master6: jne @@master
mov al,isr mov dx,SLAVEPIC
out dx,al @@master:
in al,dx mov al,IRR
pop dx out dx,al
ret xor ah,ah
in al,dx
;Lit le registre d'tat d'un contr“leur IRQ dans al, 0 master ou slave 1 ds bh ret
ReadIRR: endp readirr
push dx
mov dx,MASTERPIC
cmp bh,0
jne Master7
mov dx,SLAVEPIC
master7:
mov al,irr
out dx,al
in al,dx
pop dx
ret
;remplace le handler pointer par ds:si en bx:100h interruption ax
replacehandler:
push ax bx cx si di ds es
mov es,bx
mov di,0100h
mov ah,4
int 48h
jc reph
mov bx,ax
call getint
mov es:[102h],si
mov es:[104h],ds
call setint
reph:
pop es ds di si cx bx ax
ret
;install le handler pointer par ds:si en bx:100h interruption ax
installhandler:
push bx cx di es
mov es,bx
mov di,100h
mov ah,4
int 48h
jc inh
mov bx,ax
call setint
inh:
pop es di cx bx
ret
;met es:di le handle de l'int al
setint:
push ax bx ds
call disableirq
cli
xor ah,ah
mov bx,ax
shl bx,2
xor ax,ax
mov ds,ax
mov ds:[bx],di
mov ds:[bx+2],es
pop ds bx ax
sti
call enableirq
ret
;met ds:si le handle de l'int al
getint:
push ax bx es
xor ah,ah
mov bx,ax
shl bx,2
xor ax,ax
mov es,ax
mov si,es:[bx]
mov ds,es:[bx+2]
pop es bx ax
ret
end start

View File

@ -1,67 +1,36 @@
lnk_boot = tlink /x asm= lzasm
asm= tasm /t/m5/zi lnk= elink
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: systeme.sys boot.bin
boot.bin: boot.asm systeme.sys: video.obj systeme.obj
$(asm) boot $(lnk) systeme.obj systeme.sys
$(lnk_boot) boot
exe2boot boot.exe boot.bin
clavier.sys: clavier.asm systeme.obj: ../lib/detect.lib ../lib/video.lib video.sys
$(asm) clavier $(asm) systeme.asm
$(lnk) clavier
ren clavier.com clavier.sys
8259a.sys: 8259a.asm
$(asm) 8259a
$(lnk) 8259a
ren 8259a.com 8259a.sys
disque.sys: disque.asm video.sys:
$(asm) disque $(lnk) video.obj video.sys
$(lnk) disque
ren disque.com disque.sys
heure.sys: heure.asm boot.bin: boot.obj
$(asm) heure $(lnk) boot.obj boot.bin /bs
$(lnk) heure
ren heure.com heure.sys
horloge.sys: horloge.asm detect.obj:
$(asm) horloge $(asm) detect.asm
$(lnk) horloge
ren horloge.com horloge.sys
manette.sys: manette.asm video.obj:
$(asm) manette $(asm) video.asm
$(lnk) manette
ren manette.com manette.sys
port.sys: port.asm boot.obj:
$(asm) port $(asm) boot.asm
$(lnk) port
ren port.com port.sys
souris.sys: souris.asm
$(asm) souris
$(lnk) souris
ren souris.com souris.sys
systeme.sys: systeme.asm
$(asm) systeme
$(lnk) systeme
ren systeme.com systeme.sys
video.sys: video.asm
$(asm) video
$(lnk) video
ren video.com video.sys
clean: clean:
del *.obj del *.obj
del *.exe del *.exe
del *.bak
del *.lib
del *.com del *.com
del *.bin
del *.sys del *.sys
del *.err del *.err

View File

@ -1,221 +1,216 @@
boots segment model tiny,stdcall
.386 p486
org 7C00h locals
;org 100h jumps
assume cs:boots,ds:boots codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\fat.h"
include "..\include\divers.h"
org 7C00h
start:
jmp boot jmp boot
bootdb db 'COS2000A' ;Fabricant + n°série Formatage bootsec bootinfo <"COS2000A",512,1,1,2,224,2880,0F0h,9,18,2,0,0,0,0,0,29h,01020304h,"COS2000 ","FAT12 ">
sizec dw 512 ;octet/secteur
db 1 ;secteur/cluster errorloading db " [Erreur]",0dh,0ah,0
reserv dw 1 ;secteur reserv okloading db "Recherche noyau ",0Dh,0ah," -"
nbfat db 2 ;nb de copie de la FAT sys db "SYSTEME SYS",0
nbfit dw 224 ;taille rep racine syst db " [ Ok ]",0dh,0ah,"Chargement ",0
allclu dw 2880 ;nb secteur du volume si < 32 még dot db ".",0
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
specialboot:
errorloading db ' Erreur !!',0dh,0ah,0
okloading db 'Recherche noyau',0Dh,0ah,' - system.sys',0
syst db ' Ok',0dh,0ah,'Chargement',0
dot db '.',0
Sys db 'SYSTEME SYS'
errorboot: errorboot:
mov si,offset errorloading mov si,offset errorloading
call showstr call showstr
mov ah,0 mov ah,0
int 16h int 16h
int 19h int 19h
boot:
mov Bootdrv,dl
cli
mov ax,09000h
mov ss,ax
mov sp,0FFFFh
sti
boot:
mov [bootsec.bootdrive],dl
cli
mov ax,09000h
mov ss,ax
mov sp,0FFFFh
sti
boot2: boot2:
push cs push cs
push cs push cs
pop es pop es
pop ds pop ds
xor ax,ax xor ax,ax
int 13h mov dl,[bootsec.bootdrive]
jc errorboot int 13h
mov si,offset okloading jc errorboot
call showstr mov si,offset okloading
mov cx,Reserv call showstr
add cx,word ptr [offset Hidden] mov cx,[bootsec.reservedsectors]
adc cx,word ptr [offset Hidden+2] add cx,[bootsec.hiddensectorsh]
push cx adc cx,[bootsec.hiddensectorsl]
mov bx,fatsize push cx
mov di,offset bufferfat mov bx,[bootsec.sectorsperfat]
mov di,offset bufferfat
readfat: readfat:
call readsector call readsector
inc cx jc errorboot
add di,sizec inc cx
dec bx add di,[bootsec.sectorsize]
jnz readfat dec bx
pop cx jnz readfat
xor ax,ax pop cx
mov al,NbFat xor ax,ax
mov bx,FatSize mov al,[bootsec.fatsperdrive]
mul bx mov bx,[bootsec.sectorsperfat]
add cx,ax mul bx
mov ax,32 add cx,ax
mul nbfit mov ax,32
div sizec mul [bootsec.directorysize]
add ax,cx div [bootsec.sectorsize]
sub ax,2 add ax,cx
mov word ptr [offset bootsig],ax sub ax,2
xor dx,dx mov [word ptr bootsec.reservedfornt],ax
CheckRoot: xor dx,dx
mov di,offset buffer checkroot:
call readsector mov di,offset buffer
jc errorboot call readsector
xor bx,bx jc errorboot
xor bx,bx
findnext: findnext:
cmp byte ptr [di],0 cmp [byte ptr di],0
je errorboot je errorboot
cmp byte ptr [di],0E5h cmp [byte ptr di],0E5h
je no je no
cmp byte ptr [di],041h cmp [byte ptr di],041h
je no je no
mov si,offset dot mov si,offset dot
call showstr call showstr
push di cx push di cx
mov si,offset sys mov si,offset sys
mov cx,11 mov cx,11
rep cmpsb rep cmpsb
pop cx di pop cx di
je oksystem je oksystem
no: no:
add di,32 add di,32
add bx,32 add bx,32
inc dx inc dx
cmp dx,nbfit cmp dx,[bootsec.directorysize]
ja errorboot ja errorboot
cmp bx,sizec cmp bx,[bootsec.sectorsize]
jb findnext jb findnext
inc cx inc cx
jmp Checkroot jmp checkroot
oksystem: oksystem:
mov si,offset syst mov si,offset syst
call showstr call showstr
mov cx,[di+26] mov cx,[di+26]
mov ax,0900h mov ax,0900h
mov es,ax mov es,ax
push es push es
mov di,100h mov di,0000h
push di push 0010h
mov si,offset dot mov si,offset dot
xor ax,ax xor ax,ax
fatagain: fatagain:
cmp cx,0FF0h cmp cx,0FF0h
jae finishload jae finishload
push cx push cx
add cx,word ptr [offset bootsig] add cx,[word ptr bootsec.reservedfornt]
call readsector call readsector
pop cx pop cx
jc errorboot jc errorboot
inc ax inc ax
call showstr call showstr
add di,sizec add di,[bootsec.sectorsize]
call getfat call getfat
jnc fatagain jnc fatagain
finishload: finishload:
db 0CBh retf
;=============READSECTOR (Fonction 01H)=============== ;=============READSECTOR (Fonction 01H)===============
;Lit le secteur CX et le met en es:di ;Lit le secteur CX et le met en es:di
;-> AH=1 ;-> AH=1
;<- Flag Carry si erreur ;<- Flag Carry si erreur
;===================================================== ;=====================================================
ReadSector: readsector:
push ax bx cx dx si push ax bx cx dx si
mov ax,cx mov ax,cx
xor dx,dx xor dx,dx
div nbtrack div [bootsec.sectorspertrack]
inc dl inc dl
mov bl,dl mov bl,dl
xor dx,dx xor dx,dx
div head div [bootsec.headsperdrive]
mov dh, 0 xchg dl,dh
xchg dl,dh mov cx,ax
mov cx,ax xchg cl,ch
xchg cl,ch shl cl,6
shl cl,6 or cl, bl
or cl, bl
mov bx,di mov bx,di
mov SI, 4 mov si, 4
mov AL, 1 mov al, 1
TryAgain: tryagain:
mov AH, 2 mov ah, 2
mov dl,[bootsec.bootdrive]
int 13h int 13h
jnc Done jnc done
dec SI dec si
jnz TryAgain jnz tryagain
Done: done:
pop si dx cx bx ax pop si dx cx bx ax
ret
getfat:
push ax bx dx di
mov di,offset bufferfat
mov ax,cx
mov bx,ax
and bx,0000000000000001b
shr ax,1
mov cx,3
mul cx
add di,ax
cmp bx,0h
jnz evenfat
oddfat:
mov dx,[di]
and dx,0FFFh
mov cx,dx
jmp endfat
evenfat:
mov dx,[di+1]
and dx,0FFF0h
shr dx,4
mov cx,dx
endfat:
pop di dx bx ax
ret
showstr:
push ax bx si
again:
lodsb
or al,al
jz fin
mov ah,0Eh
mov bx,07h
int 10h
jmp again
fin:
pop si bx ax
ret ret
Buffer equ $
BufferFat equ $+2048
boots ends getfat:
end start push ax bx dx di
mov di,offset bufferfat
mov ax,cx
mov bx,ax
and bx,0000000000000001b
shr ax,1
mov cx,3
mul cx
add di,ax
cmp bx,0h
jnz evenfat
oddfat:
mov dx,[di]
and dx,0FFFh
mov cx,dx
jmp endfat
evenfat:
mov dx,[di+1]
and dx,0FFF0h
shr dx,4
mov cx,dx
endfat:
pop di dx bx ax
ret
showstr:
push ax bx si
again:
lodsb
or al,al
jz fin
mov ah,0Eh
mov bx,07h
int 10h
jmp again
fin:
pop si bx ax
ret
db 055h,0AAh
endof:
buffer equ offset endof+2048
bufferfat equ offset endof+4096

View File

@ -3,7 +3,9 @@
smart smart
.code .code
org 0100h org 0h
include ..\include\mem.h
start: start:
@ -15,35 +17,49 @@ tsr:
db 2eh,0ffh,1eh db 2eh,0ffh,1eh
dw offsets dw offsets
cli cli
mov cs:feax,eax
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 pop ax
pop ax
pop ax
push gs
push gs
push gs
pop ds
pop es
pop fs
push gs
push size exe
sti
mov cs:[isstate],0
retf
com db 'COMMANDE.CE',0
F11: F11:
push ax di es push ax di es
@ -65,154 +81,181 @@ notabove:
f12: f12:
mov cs:isstate,1 pushad
pop word ptr cs:fip pushf
pop word ptr cs:fcs push ds
pop dword ptr cs:ffl mov cs:[eaxr],eax
mov cs:fesp,esp mov cs:[ebxr],ebx
push ds es mov cs:[ecxr],ecx
pusha mov cs:[edxr],edx
push word ptr cs:fip mov cs:[esir],esi
push gs mov cs:[edir],edi
push fs mov cs:[espr],esp
push ss mov cs:[ebpr],ebp
push es mov cs:[csr],cs
push ds mov cs:[dsr],ds
push word ptr cs:fcs mov cs:[esr],es
push dword ptr cs:fesp mov cs:[fsr],fs
push ebp mov cs:[gsr],gs
push edi mov cs:[ssr],ss
push esi push cs
push edx pop ds
push ecx mov si,offset sep
push ebx call Showstr
push eax mov si,offset reg
push dword ptr cs:ffl mov di,offset regdata
push cs mov bx,7
push cs showregs:
pop es cmp byte ptr cs:[si+6],":"
pop ds jne endshowregs
mov ah,26 call Showstr
int 47h cmp byte ptr cs:[si+4]," "
mov ah,2 je segsss
int 47h mov edx,cs:[di]
mov ah,21 mov cx,32
mov cl,4 call Showhex
int 47h add di,4
mov ah,13 jmp showmax
mov si,offset reg segsss:
int 47h mov dx,cs:[di]
mov ah,6 mov cx,16
int 47h call Showhex
mov ah,21 add di,2
mov cl,7 showmax:
int 47h add si,9
mov ah,13 mov bp,dx
mov si,offset fla push si
int 47h mov si,offset beginds
pop edx call showstr
mov cx,32 mov si,bp
mov ah,11 mov cx,8
int 47h mov al,0
mov ah,5 letshow:
int 47h mov dl,ds:[si]
mov ah,10 inc si
int 47h call showhex
mov si,offset regs inc al
mov bx,8+7 cmp al,10
mov ah,21 jb letshow
mov cl,6 mov si,offset ende
int 47h call showstr
showallREG: mov si,offset begines
mov ah,6 call showstr
int 47h mov si,bp
cmp bx,8 mov cx,8
jb nodr mov al,0
pop edx letshow2:
mov cx,32 mov dl,es:[si]
jmp popo inc si
nodr: call showhex
mov ah,21 inc al
mov cl,1 cmp al,10
int 47h jb letshow2
xor edx,edx mov si,offset ende
pop dx call showstr
mov cx,16 pop si
popo: jmp showregs
mov ah,13 endshowregs:
int 47h mov si,offset sep
mov ah,10 call Showstr
int 47h xor ax,ax
mov ah,5 int 16h
int 47h pop ds
push si popf
mov si,offset gr popad
mov ah,13 jmp endof
int 47h begines db ' es[',0
mov ah,8 beginds db ' ds[',0
int 47h ende db '] ',0
mov si,offset dr
mov ah,13
int 47h ;==============================Affiche le nombre nb hexa en EDX de taille CX et couleur BL==============
pop si ShowHex:
add si,5 push ax bx cx edx si di
dec bx mov di,cx
jnz showallreg sub cx,32
mov ah,34 neg cx
mov di,offset infos shl edx,cl
int 47h shr di,2
mov ah,25 mov ah,09h
mov bl,cs:infos and bx,1111b
xor bh,bh Hexaize:
dec bl rol edx,4
int 47h mov si,dx
mov si,offset app and si,1111b
mov ah,13 mov al,[si+offset tab]
int 47h push cx
mov ah,32 mov cx,1
mov bl,cs:infos cmp al,32
xor bh,bh jb control2
mov di,ax mov ah,09h
dec di int 10h
mov cl,116 control2:
int 47h mov ah,0Eh
pop es ds int 10h
sti pop cx
waitt: dec di
cmp cs:isstate,0 jnz Hexaize
jne waitt pop di si edx cx bx ax
mov ah,27 ret
int 47h Tab db '0123456789ABCDEF'
popa
pop es ds ;==============================Affiche une chaine DS:SI de couleur BL==============
push dword ptr cs:ffl showstr:
push word ptr cs:fcs push ax bx cx si
push word ptr cs:fip mov cx,1
jmp endof again:
lodsb
or al,al
jz fin
and bx,0111b
cmp al,32
jb control
mov ah,09h
int 10h
control:
mov ah,0Eh
int 10h
jmp again
fin:
pop si cx bx ax
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
sep db 0Ah,0Dh,'********************',0Ah,0Dh,0
reg db ' Etats des registres',0
fla db 'Eflags:',0
regs db 'EAX:',0
db 'EBX:',0
db 'ECX:',0
db 'EDX:',0
db 'ESI:',0
db 'EDI:',0
db 'EBP:',0
db 'ESP:',0
db ' CS:',0
db ' DS:',0
db ' ES:',0
db ' FS:',0
db ' GS:',0
db ' SS:',0
db ' IP:',0
gr db '(',0
dr db ')',0
app db 'Appuyez sur espace pour quitter...',0
ffl dd 0
fcs dw 0
fip dw 0
fesp dd 0
feax dd 0
end start end start

View File

@ -3,13 +3,13 @@
smart smart
.code .code
org 0100h org 0h
include ..\include\fat.h include ..\include\fat.h
include ..\include\mem.h
start: start:
jmp tsr ;Saute à la routine résidente jmp tsr ;Saute à la routine résidente
names db 'DRIVE' ;Nom drivers
id dw 1234h ;Identifiant drivers id dw 1234h ;Identifiant drivers
Tsr: Tsr:
cli ;Désactive interruptions logiciellement cli ;Désactive interruptions logiciellement
@ -36,15 +36,23 @@ noerrorint:
itsok: itsok:
push bp push bp
mov bp,sp ;On prend sp dans bp pour adresser la pile mov bp,sp ;On prend sp dans bp pour adresser la pile
jnc noerror ;La fonction appelée a renvoyer une erreur : Flag CARRY ? pushf
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 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 ;xor eax,eax
;mov ax,cs ;On récupère le segment et l'offset puis en renvoie l'adresse physique ;mov ax,cs ;On récupère le segment et l'offset puis en renvoie l'adresse physique
;shl eax,4 ;de l'erreur. ;shl eax,4 ;de l'erreur.
;add ax,cs:current ;add ax,cs:current
jmp endofint ;on termine l'int jmp endofscan ;on termine l'int
noerror: 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 and byte ptr [bp+6],0FEh;Si pas d'erreur on efface le Bit CARRY du FLAG qui sera dépilé lors du IRET
endofscan:
popf
jne noequal
or byte ptr [bp+6],1000000b
jmp endofint
noequal:
and byte ptr [bp+6],0BFh
endofint: endofint:
pop bp pop bp
sti ;On réactive les interruptions logiciellement sti ;On réactive les interruptions logiciellement
@ -53,7 +61,7 @@ endofint:
current dw 0 ;Mot temporaire qui contient l'adresse de la fonction appelée current dw 0 ;Mot temporaire qui contient l'adresse de la fonction appelée
tables dw readsector tables dw readsector
dw writesector dw writesector
dw verifysector2 dw verifysector
dw initdrive dw initdrive
dw loadfile dw loadfile
dw compressrle dw compressrle
@ -68,6 +76,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 +105,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 +136,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 +171,108 @@ 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
mov ah,12
int 49h
jc reallyerror
push es
push cs
mov ax,offset arrive
push ax
push es
cmp word ptr gs:[0h],'EC'
jne noce
push size exe
jmp wasce
noce:
push 0000h
wasce:
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
push eax
mov ah,2
int 49h
pop eax
jc errorload2
push gs
pop es
mov cx,cs:tempfit.FileGroup
mov di,0h
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 +329,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
@ -237,29 +354,38 @@ CmpNames:
repe cmpsb repe cmpsb
jne nequal jne nequal
inc si inc si
jmp equal
nequal: nequal:
cmp byte ptr es:[di-1],' '
jne notequal
equal:
cmp byte ptr [si-1],'.' cmp byte ptr [si-1],'.'
jne trynoext jne trynoext
mov al,' ' mov al,' '
rep scasb rep scasb
mov cx,3 mov cx,3
rep cmpsb rep cmpsb
jne notequal jne nequal2
cmp byte ptr [si],0 inc si
jne notequal jmp equal2
cmp cx,0 nequal2:
jl notequal cmp byte ptr es:[di-1],' '
jne notequal
equal2:
cmp byte ptr [si-1],0
jne notequal
itok: itok:
clc
pop di si cx ax pop di si cx ax
ret ret
notequal:
stc
pop di si cx ax
ret
trynoext: trynoext:
cmp byte ptr [si-1],0 cmp byte ptr [si-1],0
jne notequal jne notequal
jmp itok jmp itok
notequal:
stc
pop di si cx ax
ret
;charge le fichier de de groupe CX et de taille eax ;charge le fichier de de groupe CX et de taille eax
LoadWay: LoadWay:
@ -292,6 +418,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 +435,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 +454,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 +497,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 +527,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 +796,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 +814,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 +863,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,25 +894,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
ret pop cx si
VerifySector2:
call verifysector
jne nook
or byte ptr [bp+6],10b
nook:
ret ret
;=============DecompressRle (Fonction 05H)============== ;=============DecompressRle (Fonction 05H)==============
@ -788,6 +934,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 +1101,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

@ -3,7 +3,7 @@
smart smart
.code .code
org 0100h org 0h
start: start:
jmp tsr ;Saute à la routine résidente jmp tsr ;Saute à la routine résidente

View File

@ -3,7 +3,7 @@
smart smart
.code .code
org 0100h org 0h
start: start:

View File

@ -3,7 +3,7 @@
smart smart
.code .code
org 0100h org 0h
start: start:

View File

@ -2,7 +2,7 @@
.486 .486
smart smart
.code .code
org 0100h org 0h
start: start:
jmp tsr jmp tsr
drv db 'JOYSTICK',0 drv db 'JOYSTICK',0

View File

@ -1,119 +1,731 @@
FirstMB dw 0
;Initialise les blocs de mémoire db "biosprint",0
MBinit: dw biosprint
push ax cx es db "mbinit",0
mov ax,gs dw mbinit
mov cs:Firstmb,ax db "mbcreate",0
dec ax dw mbcreate
mov es,ax db "mbfree",0
mov cx,0A000h dw mbfree
sub cx,ax db "mbclean",0
dec cx dw mbclean
mov es:[MB.Reference],Free db "mbresident",0
mov es:[MB.Sizes],cx dw mbresident
mov es:[MB.Check],'NH' db "mbnonresident",0
mov es:[MB.IsNotLast],False dw mbnonresident
db "mbchown",0
dw mbchown
db "mballoc",0
dw mballoc
db "mbfind",0
dw mbfind
db "mbfindsb",0
dw mbfindsb
db "mbget",0
dw mbget
db "mbloadfuncs",0
dw mbloadfuncs
db "mbsearchfunc",0
dw mbsearchfunc
db "bioswaitkey",0
dw bioswaitkey
db "mbloadsection",0
dw mbloadsection
db "enableirq",0
dw enableirq
db "disableirq",0
dw enableirq
db "readmaskirq",0
dw readmaskirq
db "readirr",0
dw readirr
db "readisr",0
dw readisr
db "seteoi",0
dw seteoi
dd 0
include "8259a.asm"
;Affiche le nombre hexa dans %0[dword]
PROC biosprinth FAR
ARG @num:dword
USES ax,bx,cx,edx,si,di
mov edx,[@num]
mov ah,09h
mov di,8
@@hexaize:
rol edx,4
mov si,dx
and si,1111b
mov al,[cs:si+offset @@tab]
mov cx,1
cmp al,32
jb @@control
mov bx,7
mov ah,09h
int 10h
@@control:
mov ah,0Eh
int 10h
dec di
jnz @@hexaize
ret
@@tab db '0123456789ABCDEF'
endp biosprinth
;Affiche le texte ASCIIZ pointé par %0
PROC biosprint FAR
ARG @pointer:word
USES ax,bx,cx,si
mov si,[@pointer]
mov cx,1
mov bx,7
@@again:
lodsb
or al,al
jz @@fin
cmp al,32
jb @@control
mov ah,09h
int 10h
@@control:
mov ah,0Eh
int 10h
jmp @@again
@@fin:
ret
endp biosprint
;PROC flatmode FAR
; USES eax,bx,edx
; ; first, calculate the linear address of GDT
; xor edx,edx
; xor eax,eax
; mov dx,cs
; shl edx,4
; add [dword ptr cs:offset @@gdt+2],edx ; store as GDT linear base addr
; ; now load the GDT into the GDTR
; lgdt [fword ptr cs:offset @@gdt] ; load GDT base (286-style 24-bit load)
; mov bx,1 * size descriptor ; point to first descriptor
; mov eax,cr0 ; prepare to enter protected mode
; or al,1 ; flip the PE bit
; cli ; turn off interrupts
; mov cr0,eax ; we're now in protected mode
; mov fs,bx ; load the FS segment register
; and al,0FEh ; clear the PE bit again
; mov cr0,eax ; back to real mode
; sti ; resume handling interrupts
; ret ;
;@@gdt descriptor <@@gdtend - @@gdt - 1, @@gdt, 0, 0, 0, 0> ; the GDT itself
; descriptor <0ffffh, 0, 0, 091h, 0cfh, 0> ; 4G data segment
;@@gdtend:
;endp flatmode
;Attend l'appuie sur une touche
PROC bioswaitkey FAR
xor ax,ax
int 16h
ret
endp bioswaitkey
firstmb dw 0
;Charge les sections du block %0
PROC mbloadsection FAR
ARG @blocks:word
USES ax,bx,cx,si,di,ds,es
LOCAL @@toresov:word:60
mov ax,[@blocks]
inc ax
inc ax
mov es,ax
mov ds,ax
cmp [word ptr 0],"EC"
jne @@notace
lea si,[@@toresov]
mov [word ptr ss:si],0FFFFh
mov bx,[ds:exe.sections]
@@loading:
cmp [dword ptr bx],0
je @@finishloading
mov ax,bx
add ax,4
call mbcreate,ax,[word ptr bx+2]
jc @@error
inc si
inc si
mov [ss:si],ax
push si
mov si,[bx]
xor di,di
mov es,ax
mov cx,[bx+2]
cld
rep movsb
pop si
add bx,4
@@gonext:
inc bx
cmp [byte ptr bx],0
jne @@gonext
inc bx
jmp @@loading
@@finishloading:
pushad
xor eax,eax
mov ax,[word ptr ss:si]
call biosprinth,eax
popad
cmp [word ptr ss:si],0FFFFh
je @@finishdepands
call mbloadfuncs,[word ptr ss:si]
jc @@depandserror
dec si
dec si
jmp @@finishloading
@@finishdepands:
ret
@@notace:
stc
ret
@@error:
stc
ret
@@depandserror:
stc
ret
endp mbloadsection
;Initialise les blocs de mémoire en prenant memorystart pour segment de base
PROC mbinit FAR
USES ax,cx,si,di,ds,es
cmp [cs:firstmb],0
jne @@alreadyok
push cs
pop ds
mov [cs:firstmb],memorystart
mov ax,memorystart-2
mov es,ax
mov si,offset afree
xor di,di
mov cx,size mb
rep movsb
clc clc
pop es cx ax
ret ret
notforfree: @@alreadyok:
stc stc
pop es cx ax
ret ret
endp mbinit
;Libère le bloc de mémoire GS afree mb <"HN",0,0,0,0A000h-memorystart,"Libre">
MBFree: db 0
push bx es
mov bx,gs
dec bx
mov es,bx
cmp es:[MB.Check],'NH'
je notforfree
mov es:[MB.IsResident],0
mov es:[MB.Reference],Free
mov dword ptr es:[MB.Names],'eerF'
mov dword ptr es:[MB.Names+4],0
pop es bx
ret
;Creér un bloc de nom ds:si de taille cx (octets) -> n°segement dans GS ;Creér un bloc de nom %0 de taille %1 (octets) -> n°segment dans AX
MBCreate: PROC mbcreate FAR
push ax bx cx dx si di es ARG @blocks:word,@size:word
USES bx,cx,dx,si,di,ds,es
push gs
mov gs,[ss:bp+4]
mov cx,[@size]
shr cx,4 shr cx,4
inc cx inc cx
mov bx,cs:firstmb mov bx,[cs:firstmb]
dec bx dec bx
searchfree: dec bx
mov es,bx mov dl,true
cmp es:[MB.Check],'NH' @@searchfree:
jne wasntgood cmp dl,false
cmp es:[MB.IsNotLast],True je @@notenougtmem
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
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 mov ax,[es:mb.sizes]
je wasntgood
notsogood:
inc bx
add bx,es:[MB.Sizes]
jmp searchfree
weregood:
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.IsResident],False mov [es:mb.reference],gs
mov es:[MB.Sizes],cx mov [es:mb.isresident],false
mov di,MB.Names lea di,[es:mb.names]
push ax cx push cx
mov cx,8 mov cx,24/4
loops: push cs
mov dh,[si] pop ds
inc si mov si,[@blocks]
dec cx cld
jz endofloops rep movsd
cmp dh,0 pop cx
je endofloops inc bx
mov es:[di],dh inc bx
inc di sub ax,cx
jmp loops cmp ax,0
endofloops: je @@nofree
inc cx
mov al,0
rep stosb
pop cx ax
mov word ptr es:[MB.Check],'NH'
sub ax,cx
dec ax dec ax
js nofree dec ax
inc bx mov [es:mb.sizes],cx
mov gs,bx add cx,bx
add bx,cx mov es,cx
mov es,bx mov si,offset afree
mov es:[MB.IsNotLast],dl xor di,di
mov es:[MB.IsResident],False mov cx,size mb
mov es:[MB.Reference],Free cld
mov es:[MB.Sizes],ax rep movsb
mov dword ptr es:[MB.Names],'eerF' mov [es:mb.isnotlast],dl
mov dword ptr es:[MB.Names+4],0 mov [es:mb.sizes],ax
mov es:[MB.Check],'NH' @@nofree:
nofree: mov ax,bx
clc clc
pop es di si dx cx bx ax pop gs
ret ret
wasntgood: @@notsogood:
inc bx
inc bx
add bx,[es:mb.sizes]
jmp @@searchfree
@@memoryerror:
stc stc
pop es di si dx cx bx ax pop gs
ret
@@notenougtmem:
pop gs
stc
ret
endp mbcreate
;Libère le bloc de mémoire %0 et ses sous blocs
PROC mbfree FAR
ARG @blocks:word
USES ax,bx,cx,si,di,ds,es
mov bx,[@blocks]
mov ax,bx
dec bx
dec bx
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
cmp [es:mb.reference],free
je @@wasfree
cmp [es:mb.isresident],true
je @@wasresident
mov [es:mb.reference],free
push cs
pop ds
mov si,offset @@isfree
lea di,[es:mb.names]
mov cx,6
cld
rep movsb
mov bx,[cs:firstmb]
dec bx
dec bx
@@searchtofree:
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
inc bx
inc bx
add bx,[es:mb.sizes]
cmp [es:mb.sizes],0
je @@nottofree
cmp ax,[es:mb.reference]
jne @@nottofree
mov [es:mb.isresident],false
mov [es:mb.reference],free
mov cx,6
cld
rep movsb
@@nottofree:
cmp [es:mb.isnotlast],true
je @@searchtofree
call mbclean
ret
@@memoryerror:
stc
ret
@@wasfree:
stc
ret
@@wasresident:
stc
ret
@@isfree db "libre",0
endp mbfree
;Mise a nivo de la mémoire (jonction de blocs libre)
PROC mbclean FAR
USES ax,bx,dx,es,gs
mov bx,[cs:firstmb]
dec bx
dec bx
xor ax,ax
xor dx,dx
@@searchfree:
mov gs,bx
cmp [word ptr gs:mb.check],"NH"
jne @@memoryerror
inc bx
inc bx
add bx,[gs:mb.sizes]
cmp [word ptr gs:mb.sizes],0
je @@notenougtmem
cmp [gs:mb.reference],free
jne @@notfree
cmp ax,0
je @@notmeetfree
add dx,[gs:mb.sizes]
mov [word ptr gs:mb.check],0
mov [dword ptr gs:mb.names],0
inc dx
inc dx
jmp @@nottrigered
@@notmeetfree:
xor dx,dx
mov ax,gs
jmp @@nottrigered
@@notfree:
cmp ax,0
je @@nottrigered
mov es,ax
add [es:mb.sizes],dx
xor ax,ax
@@nottrigered:
cmp [gs:mb.isnotlast],true
je @@searchfree
cmp ax,0
je @@reallyfinish
mov es,ax
add [es:mb.sizes],dx
mov [es:mb.isnotlast],false
@@reallyfinish:
clc
ret
@@notenougtmem:
stc
ret
@@memoryerror:
stc
ret
endp mbclean
;Rend le segment %0 résident
PROC mbresident FAR
ARG @blocks:word
USES bx,es
mov bx,[@blocks]
dec bx
dec bx
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
mov [es:mb.isresident],true
ret
@@memoryerror:
stc
ret
endp mbresident
;Rend le segment %0 non résident
PROC mbnonresident FAR
ARG @blocks:word
USES bx,es
mov bx,[@blocks]
dec bx
dec bx
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
mov [es:mb.isresident],false
ret
@@memoryerror:
stc
ret
endp mbnonresident
;Change le proprietaire de %0 a %1
PROC mbchown FAR
ARG @blocks:word,@owner:word
USES bx,dx,es
mov bx,[@blocks]
dec bx
dec bx
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
cmp [es:mb.reference],free
je @@wasfree
mov dx,[@owner]
mov [es:mb.reference],dx
ret
@@memoryerror:
stc
ret
@@wasfree:
stc
ret
endp mbchown
;Alloue un bloc /data de CX caractere pour le process appelant -> ax
PROC mballoc FAR
ARG @size:word
USES ax,si,ds
push cs
pop ds
call mbcreate,offset @@data,[@size]
call mbchown,ax,[word ptr ss:bp+4]
ret ret
;Rend le segment GS résident @@data db '/data',0
MBresident: endp mballoc
push bx es
mov bx,gs ;Renvoie en AX le MB n° %0 carry quand terminé
PROC mbget FAR
ARG @num:word
USES bx,dx,es
mov bx,[cs:firstmb]
dec bx dec bx
mov es,bx dec bx
mov es:[MB.IsResident],True xor dx,dx
pop es bx @@searchfree:
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
inc bx
inc bx
add bx,[es:mb.sizes]
cmp [es:mb.sizes],0
je @@memoryerror
cmp dx,[@num]
je @@foundmcb
ja @@notfound
inc dx
cmp [es:mb.isnotlast],true
je @@searchfree
@@memoryerror:
stc
ret ret
@@foundmcb:
mov ax,es
inc ax
inc ax
clc
ret
@@notfound:
stc
ret
endp mbget
;Renvoie en AX le MCB qui correspond a ds:%0
PROC mbfind FAR
ARG @blocks:word
USES bx,si,di,es
mov bx,[cs:firstmb]
dec bx
dec bx
mov si,[@blocks]
lea di,[es:mb.names]
@@search:
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
inc bx
inc bx
add bx,[es:mb.sizes]
cmp [es:mb.sizes],0
je @@memoryerror
push si di
@@cmpnames:
mov al,[es:di]
cmp al,[ds:si]
jne @@ok
cmp al,0
je @@ok
inc si
inc di
jmp @@cmpnames
@@ok:
pop di si
je @@foundmcb
cmp [es:mb.isnotlast],true
je @@search
@@notfound:
stc
ret
@@memoryerror:
stc
ret
@@foundmcb:
mov ax,es
inc ax
inc ax
clc
ret
endp mbfind
;Renvoie en AX le sous mcb qui correspond a %0 et qui appartien a %1
PROC mbfindsb FAR
ARG @blocks:word,@owner:word
USES bx,dx,si,di,es
mov bx,[cs:firstmb]
dec bx
dec bx
mov si,[@blocks]
lea di,[es:mb.names]
mov dx,[@owner]
@@search:
mov es,bx
cmp [word ptr es:mb.check],"NH"
jne @@memoryerror
inc bx
inc bx
add bx,[es:mb.sizes]
cmp [es:mb.sizes],0
je @@memoryerror
push si di
@@cmpnames:
mov al,[es:di]
cmp al,[ds:si]
jne @@ok
cmp al,0
je @@ok
inc si
inc di
jmp @@cmpnames
@@ok:
pop di si
jne @@notfoundmcb
cmp [es:mb.reference],dx
je @@foundmcb
@@notfoundmcb:
cmp [es:mb.isnotlast],true
je @@search
@@notfound:
stc
ret
@@foundmcb:
mov ax,es
inc ax
inc ax
clc
ret
@@memoryerror:
stc
ret
endp mbfindsb
;Resouds les dépendances du bloc de mémoire %0
PROC mbloadfuncs FAR
ARG @blocks:word
USES ax,bx,cx,dx,si,ds
mov ds,[@blocks]
cmp [word ptr 0],"EC"
jne @@notace
mov si,[ds:exe.imports]
cmp si,0
je @@endofloading
@@loadfuncs:
cmp [word ptr si],0
je @@endofloading
call mbsearchfunc,si
jnc @@toendoftext
mov bx,si
@@findend:
inc bx
cmp [byte ptr bx], ':'
jne @@findend
mov [byte ptr bx],0
;call projectfile,bx
jc @@erroronload
mov [byte ptr bx],':'
call mbsearchfunc,si
jc @@libnotexist
@@toendoftext:
mov cl,[si]
cmp cl,0
je @@oktonext
inc si
jmp @@toendoftext
@@oktonext:
inc si
mov [si],ax
mov [si+2],dx
add si,4
jmp @@loadfuncs
@@endofloading:
clc
ret
@@notace:
stc
ret
@@libnotexist:
stc
ret
@@erroronload:
stc
ret
endp mbloadfuncs
;Recherche une fonction pointé par DS:SI en mémoire et renvoie son adresse en DX:AX
PROC mbsearchfunc FAR
ARG @func:word
USES bx,si,di,es
mov bx,[@func]
push bx
@@findend:
inc bx
cmp [byte ptr bx], ':'
jne @@findend
mov [byte ptr bx],0
call mbfind
mov [byte ptr bx],':'
jc @@notfoundattallthesb
mov es,ax
cmp [word ptr es:exe.checks],"EC"
jne @@notfoundattallthesb
mov di,[es:exe.exports]
inc bx
inc bx
@@functions:
cmp [word ptr es:di],0
je @@notfoundattallthesb
mov si,bx
@@cmpnamesfunc:
mov al,[es:di]
cmp al,[ds:si]
jne @@notfoundthesb
cmp al,0
je @@seemsok
inc si
inc di
jmp @@cmpnamesfunc
@@notfoundthesb:
mov al,[es:di]
cmp al,0
je @@oktonext
inc di
jmp @@notfoundthesb
@@oktonext:
inc di
inc di
inc di
jmp @@functions
@@seemsok:
mov dx,es
mov ax,[es:di+1]
clc
ret
@@notfoundattallthesb:
stc
ret
endp mbsearchfunc

View File

@ -2,7 +2,7 @@
.486 .486
smart smart
.code .code
org 0100h org 0h
start: start:
jmp tsr jmp tsr
drv db 'LPT ',0 drv db 'LPT ',0

View File

@ -2,7 +2,7 @@
.486 .486
smart smart
.code .code
org 0100h org 0h
start: start:
jmp tsr jmp tsr
drv db 'MOUSE',0 drv db 'MOUSE',0

File diff suppressed because it is too large Load Diff

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)

File diff suppressed because it is too large Load Diff

View File

@ -2,56 +2,52 @@ 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
detect.com: detect.asm
$(asm) detect $(asm) detect
$(lnk) detect $(lnk) detect
ren detect.com detect.exe
editeur.exe: editeur.asm editeur.com: editeur.asm
$(asm) editeur $(asm) editeur
$(lnk) editeur $(lnk) editeur
ren editeur.com editeur.exe
gestion.exe: gestion.asm gestion.com: gestion.asm
$(asm) gestion $(asm) gestion
$(lnk) gestion $(lnk) gestion
ren gestion.com gestion.exe
logo.exe: logo.asm logo.com: logo.asm
$(asm) logo $(asm) logo
$(lnk) logo $(lnk) logo
ren logo.com logo.exe
pmode.exe: pmode.asm pmode.com: pmode.asm
$(asm) pmode $(asm) pmode
$(lnk) pmode $(lnk) pmode
ren pmode.com pmode.exe
souris.exe: souris.asm souris.com: souris.asm
$(asm) souris $(asm) souris
$(lnk) souris $(lnk) souris
ren souris.com souris.exe
test.exe: test.asm test.com: test.asm
$(asm) test $(asm) test
$(lnk) test $(lnk) test
ren test.com test.exe
verifier.exe: verifier.asm verifier.com: verifier.asm
$(asm) verifier $(asm) verifier
$(lnk) verifier $(lnk) verifier
ren verifier.com verifier.exe
volume.exe: volume.asm volume.com: volume.asm
$(asm) volume $(asm) volume
$(lnk) volume $(lnk) volume
ren volume.com volume.exe
clean: clean:
del *.obj del *.obj
del *.exe del *.com
del *.com del *.com
del *.sys del *.sys
del *.err del *.err

View File

@ -3,47 +3,32 @@
smart smart
.code .code
org 0100h org 0h
include ..\include\pci.h include ..\include\pci.h
include ..\include\mem.h
start: start:
call cleartext header exe <,1,0,,,offset imports,,>
realstart:
call getpciinfos call getpciinfos
mov pciversion,bx mov [pciversion],bx
mov nbbus,cl mov [nbbus],cl
mov pcitype,al mov [pcitype],al
mov si,offset msg
call showstring0
call line
mov si,offset pcivers
call showstring0
xor edx,edx xor edx,edx
mov dx,bx mov dl,[nbbus]
xchg dl,dh
mov cx,8
call showhex
mov si,offset poin
call showstring0
shr dx,8
call showhex
mov si,offset pcivers2
call showstring0
call line
mov si,offset nbbuses
call showstring0
xor edx,edx
mov dl,nbbus
inc dl inc dl
call showint push edx
call line mov dx,[pciversion]
push edx
mov dx,[pciversion]
shr dx,8
push edx
push offset msg
call [print]
mov si,offset typesof
call showstring0
mov di,offset types mov di,offset types
mov bx,7 mov bx,7
mov al,pcitype mov al,pcitype
@ -51,53 +36,51 @@ vote:
bt ax,bx bt ax,bx
jnc nowas jnc nowas
shl bx,1 shl bx,1
mov si,[di+bx] push word ptr [di+bx]
call showstring0 call [print]
mov si,offset spac
call showstring0
shr bx,1 shr bx,1
nowas: nowas:
dec bx dec bx
jns vote jns vote
call line push offset return
call [print]
xor ax,ax xor ax,ax
xor cx,cx xor cx,cx
mov di,offset infos mov si,offset infos
search: search:
mov di,si
call Getallfunctionsinfos call Getallfunctionsinfos
jc stopthis jc stopthis
mov dh,[si+pci.subclass]
push cx di mov dl,[si+pci.class]
mov si,offset msg1 ;sousclasse
call showstring0 mov di,offset subclasse
mov cx,16
xor edx,edx
mov dx,[di+pci.device]
call showhex
mov si,offset msg2
call showstring0
mov dx,[di+pci.vendor]
call showhex
mov si,offset msg3
call showstring0
mov cl,[di+pci.class]
mov ch,[di+pci.subclass]
mov di,offset temp
call getpciclass
mov si,di
call showstring0
mov si,offset poin
call showstring0
mov di,offset temp
call getpcisubclass call getpcisubclass
mov si,di push di
call showstring0 ;classe
call line mov di,offset classe
pop di cx call getpciclass
push di
;fonction
mov dl,ch
push edx
;device
mov dl,cl
push edx
;bus
mov dl,al
push edx
;device
mov dx,[si+pci.device]
push edx
;vendeur
mov dx,[si+pci.vendor]
push edx
push offset msg2
call [print]
jmp noerror
noerror:
inc ch inc ch
cmp ch,7 cmp ch,7
jbe search jbe search
@ -110,30 +93,24 @@ xor cl,cl
inc al inc al
cmp al,16 cmp al,16
jbe search jbe search
ret retf
msg3 db ' Classe:',0 msg db "COS2000 hardware detecteur V1.6\lBIOS PCI version %hB.%hB a ete detecte !\lNombre de bus : %u\lCaracterisques PCI: ",0
msg1 db 'Peripherique :',0 msg2 db "Peripherique :%hW Constructeur :%hW Id :%hB.%hB.%hB Classe :%0.%0\l",0
msg2 db ' Constructeur :',0 return db "\l",0
msg db 'COS2000 hardware detecteur V1.1',0 classe db 128 dup (0)
pcivers db 'BIOS PCI version ',0 subclasse db 128 dup (0)
pcivers2 db ' a ete detecte !',0
nbbuses db 'Nombre de bus : ',0
typesof db 'Caracterisques PCI: ',0
poin db '.',0
virg db ', ',0
spac db ' ',0
temp db 128 dup (0)
types dw config1 types dw config1
dw config2 dw config2
dw poin dw null
dw poin dw null
dw config3 dw config3
dw config4 dw config4
dw poin dw null
dw poin dw null
null db 'indefini',0
config1 db 'Config Mechanism 1',0 config1 db 'Config Mechanism 1',0
config2 db 'Config Mechanism 2',0 config2 db 'Config Mechanism 2',0
config3 db 'Special Cycle Mechanism 1',0 config3 db 'Special Cycle Mechanism 1',0
@ -146,12 +123,12 @@ infos db 256 dup (0)
;fonction 0-7 bus 0-255 device 0-31 ;fonction 0-7 bus 0-255 device 0-31
;renvoie en es:di de classe cl ;renvoie en es:di de classe dl
getpciclass: getpciclass:
push ax cx si di ds es push ax cx dx si di ds es
push es push es
push di push di
mov di,cx mov di,dx
and di,0FFh and di,0FFh
shl di,1 shl di,1
mov di,[offset classes+di] mov di,[offset classes+di]
@ -169,27 +146,27 @@ pop ds
pop di pop di
pop es pop es
rep movsb rep movsb
pop es ds di si cx ax pop es ds di si dx cx ax
ret ret
;renvoie en es:di la sous-classe de ch et de classe cl ;renvoie en es:di la sous-classe de dh et de classe dl
getpcisubclass: getpcisubclass:
push ax cx si di ds es push ax cx dx si di ds es
push es push es
push di push di
mov di,cx mov di,dx
and di,0FFh and di,0FFh
shl di,1 shl di,1
mov di,[offset classesd+di] mov di,[offset classesd+di]
xchg ch,cl xchg dh,dl
xor ch,ch xor dh,dh
cmp cx,80h cmp dx,80h
jne suiteac jne suiteac
mov di,offset divers mov di,offset divers
jmp found jmp found
suiteac: suiteac:
shl cx,1 shl dx,1
add di,cx add di,dx
mov di,[di] mov di,[di]
found: found:
mov cx,0FFh mov cx,0FFh
@ -206,7 +183,7 @@ pop ds
pop di pop di
pop es pop es
rep movsb rep movsb
pop es ds di si cx ax pop es ds di si dx cx ax
ret ret
divers db 'divers',0 divers db 'divers',0
@ -224,19 +201,30 @@ dw offset class9
dw offset class10 dw offset class10
dw offset class11 dw offset class11
dw offset class12 dw offset class12
class0 db 'Ancien',0 dw offset class13
class1 db 'Stockage',0 dw offset class14
class2 db 'Reseau',0 dw offset class15
class3 db 'Affichage',0 dw offset class16
class4 db 'Multimedia',0 dw offset class17
class5 db 'Memoire',0 class0 db 'ancien',0
class6 db 'Pont',0 class1 db 'stockage',0
class7 db 'Communication',0 class2 db 'reseau',0
class8 db 'Systeme',0 class3 db 'affichage',0
class9 db 'Acquisition',0 class4 db 'multimedia',0
class10 db 'Dock',0 class5 db 'memoire',0
class11 db 'Processeur',0 class6 db 'pont',0
class12 db 'Bus serie',0 class7 db 'communication',0
class8 db 'systeme',0
class9 db 'acquisition',0
class10 db 'dock',0
class11 db 'processeur',0
class12 db 'bus serie',0
class13 db 'sans fil',0
class14 db 'intelligent',0
class15 db 'satellite',0
class16 db 'cryptage',0
class17 db 'traitement signal',0
;Classes et sous classes ;Classes et sous classes
classesd: classesd:
@ -253,6 +241,11 @@ dw offset class9d
dw offset class10d dw offset class10d
dw offset class11d dw offset class11d
dw offset class12d dw offset class12d
dw offset class13d
dw offset class14d
dw offset class15d
dw offset class16d
dw offset class17d
class0d: class0d:
dw offset subclass00 dw offset subclass00
@ -265,30 +258,40 @@ dw offset subclass10
dw offset subclass11 dw offset subclass11
dw offset subclass12 dw offset subclass12
dw offset subclass13 dw offset subclass13
dw offset subclass14
subclass10 db 'scsi',0 subclass10 db 'scsi',0
subclass11 db 'ide',0 subclass11 db 'ide',0
subclass12 db 'disquette',0 subclass12 db 'disquette',0
subclass13 db 'ipi',0 subclass13 db 'ipi',0
subclass14 db 'raid',0
class2d: class2d:
dw offset subclass20 dw offset subclass20
dw offset subclass21 dw offset subclass21
dw offset subclass22 dw offset subclass22
dw offset subclass23
dw offset subclass24
subclass20 db 'ethernet',0 subclass20 db 'ethernet',0
subclass21 db 'token ring',0 subclass21 db 'token ring',0
subclass22 db 'fddi',0 subclass22 db 'fddi',0
subclass23 db 'atm',0
subclass24 db 'isdn',0
class3d: class3d:
dw offset subclass30 dw offset subclass30
dw offset subclass31 dw offset subclass31
dw offset subclass32
subclass30 db 'vga',0 subclass30 db 'vga',0
subclass31 db 'xga',0 subclass31 db 'xga',0
subclass32 db '3D',0
class4d: class4d:
dw offset subclass40 dw offset subclass40
dw offset subclass41 dw offset subclass41
dw offset subclass42
subclass40 db 'video',0 subclass40 db 'video',0
subclass41 db 'audio',0 subclass41 db 'audio',0
subclass42 db 'telephonie',0
class5d: class5d:
dw offset subclass50 dw offset subclass50
@ -305,36 +308,50 @@ dw offset subclass64
dw offset subclass65 dw offset subclass65
dw offset subclass66 dw offset subclass66
dw offset subclass67 dw offset subclass67
dw offset subclass68
subclass60 db 'hote',0 subclass60 db 'hote',0
subclass61 db 'isa',0 subclass61 db 'isa',0
subclass62 db 'eisa',0 subclass62 db 'eisa',0
subclass63 db 'mc',0 subclass63 db 'mca',0
subclass64 db 'pci',0 subclass64 db 'pci',0
subclass65 db 'pcmcia',0 subclass65 db 'pcmcia',0
subclass66 db 'nubus',0 subclass66 db 'nubus',0
subclass67 db 'cardbus',0 subclass67 db 'cardbus',0
subclass68 db 'RACEway',0
class7d: class7d:
dw offset subclass70 dw offset subclass70
dw offset subclass71 dw offset subclass71
dw offset subclass72
dw offset subclass73
subclass70 db 'serie',0 subclass70 db 'serie',0
subclass71 db 'parallele',0 subclass71 db 'parallele',0
subclass72 db 'serie multiport',0
subclass73 db 'modem',0
class8d: class8d:
dw offset subclass80 dw offset subclass80
dw offset subclass81 dw offset subclass81
dw offset subclass82 dw offset subclass82
subclass80 db 'pic 8259a',0 dw offset subclass83
subclass81 db 'dma 8237',0 dw offset subclass84
subclass82 db 'tim 8254',0 subclass80 db 'pic',0
subclass81 db 'dma',0
subclass82 db 'timer',0
subclass83 db 'rtc',0
subclass84 db 'hotplug',0
class9d: class9d:
dw offset subclass90 dw offset subclass90
dw offset subclass91 dw offset subclass91
dw offset subclass92 dw offset subclass92
dw offset subclass93
dw offset subclass94
subclass90 db 'clavier',0 subclass90 db 'clavier',0
subclass91 db 'stylo',0 subclass91 db 'stylo',0
subclass92 db 'souris',0 subclass92 db 'souris',0
subclass93 db 'scanner',0
subclass94 db 'joystick',0
class10d: class10d:
dw offset subclass100 dw offset subclass100
@ -357,10 +374,47 @@ dw offset subclass120
dw offset subclass121 dw offset subclass121
dw offset subclass122 dw offset subclass122
dw offset subclass123 dw offset subclass123
dw offset subclass124
dw offset subclass125
subclass120 db 'firewire',0 subclass120 db 'firewire',0
subclass121 db 'access',0 subclass121 db 'access',0
subclass122 db 'ssa',0 subclass122 db 'ssa',0
subclass123 db 'usb',0 subclass123 db 'usb',0
subclass124 db 'fibre',0
subclass125 db 'smbus',0
class13d:
dw offset subclass130
dw offset subclass131
dw offset subclass132
subclass130 db 'irda',0
subclass131 db 'ir',0
subclass132 db 'rf',0
class14d:
dw offset subclass140
subclass140 db 'IO arch',0
class15d:
dw offset subclass150
dw offset subclass151
dw offset subclass152
dw offset subclass153
subclass150 db 'tv',0
subclass151 db 'audio',0
subclass152 db 'voix',0
subclass153 db 'donnees',0
class16d:
dw offset subclass160
dw offset subclass161
subclass160 db 'reseau',0
subclass161 db 'jeux',0
class17d:
dw offset subclass170
subclass170 db 'dpio',0
;bx pci version, cl nbbus, al pci type ;bx pci version, cl nbbus, al pci type
getPciInfos: getPciInfos:
@ -380,29 +434,22 @@ errorpci:
pop dx pop dx
ret ret
;al=bus bl=index cl=deviceid ch=func->dl
getfunctioninfo:
push eax bx cx
mov ah,80h
shl eax,16
mov ah,cl
shl ah,3
or ah,ch
mov al,bl
and al,0fch
mov dx,0cf8h
out dx,eax
mov dx,0CFCh
and bl,3
or dl,bl
in al,dx
mov dl,al
pop cx bx eax
ret
;al=bus cl=deviceid ch=func es:di ;al=bus cl=deviceid ch=func es:di
Getallfunctionsinfos: Getallfunctionsinfos:
push ax bx dx di push ax bx dx di
cmp ch,0
je amultiorfirst
mov bl,0Eh
push cx
xor ch,ch
call getfunctioninfo
pop cx
and dl,80h
cmp dl,0
jne amultiorfirst
mov word ptr [di],0000h
jmp notexist
amultiorfirst:
xor bl,bl xor bl,bl
goinfos: goinfos:
call getfunctioninfo call getfunctioninfo
@ -427,180 +474,78 @@ notexist:
stc stc
pop di dx bx ax pop di dx bx ax
ret ret
; PCI TYPE 1
;*******************************************************************
config1_addr equ 0CF8h
config1_data equ 0CFCh
;=============CLEAR========= pci_type1_detect:
;Efface l'ecran texte mov dx, config1_addr+3
;-> mov al, 01h
;<- out dx,al
;============================= mov dx,config1_addr
cleartext: in eax,dx
push es eax cx di mov ecx,eax
xor di,di mov eax,80000000h
mov ax,0b800h out dx,eax
mov es,ax in eax,dx
mov eax,07200720h cmp eax,80000000h
mov cx,cs:pagesize jne endofdetectiontype1
shr cx,2 mov eax,ecx
cld out dx,eax
rep stosd endofdetectiontype1:
mov cs:xy,0 ret
mov cs:x,0
mov cs:y,0 ;al=bus bl=index cl=deviceid ch=func->dl
pop di cx eax es getfunctioninfo:
ret push eax bx cx
mov ah,80h
shl eax,16
mov ah,cl
shl ah,3
or ah,ch
mov al,bl
and al,0fch
mov dx,0cf8h
out dx,eax
mov dx,0CFCh
and bl,3
or dl,bl
in al,dx
mov dl,al
pop cx bx eax
ret
;==========LINE========= ; PCI TYPE 2
;remet le curseur a la ligne ;*******************************************************************
;-> config2_reg0 equ 0CFBh
;<- config2_reg1 equ 0CF8h
;============================= config2_reg2 equ 0CFAh
line:
push bx cx di es
mov bh,cs:x
mov bl,cs:y
xor bh,bh
mov cl,cs:lines
dec cl
dec cl
cmp bl,cl
jne scro
dec bl
mov cl,1
call scrolldown
scro:
inc bl
call setxy
pop es di cx bx
ret
;==========SETXY========= pci_type2_detect:
;Change les coordonnées du curseur a X:AH,Y:AL xor ax,ax
;-> AX mov dx,config2_reg0
;<- es di out dx,ax
;============================= mov dx,config2_reg1
setxy: out dx,ax
push ax bx dx mov dx,config2_reg2
mov cs:x,bh out dx,ax
mov cs:y,bl mov ax,config2_reg1
mov al,bl in al,dx
mov bl,bh cmp al,0
xor bh,bh jne endofdetectiontype2
mov di,bx mov ax,config2_reg0
mul cs:columns in al,dx
add di,ax cmp al,0
shl di,1 jne endofdetectiontype2
mov cs:xy,di endofdetectiontype2:
mov ax,0B800h ret
mov es,ax
pop dx bx ax imports:
ret db "VIDEO.LIB::print",0
print dd 0
;==========SCROLLDOWN========= dw 0
;defile de cx lines vers le bas
;-> CX
;<-
;=============================
scrolldown:
push ax cx dx si di ds es
mov si,0B800h
mov es,si
mov ds,si
mov ax,cx
mul cs:columns
shl ax,1
mov si,ax
mov cx,cs:pagesize
sub cx,si
xor di,di
cld
rep movsb
pop es ds di si dx cx ax
ret
;===================================Afficher un int EDX a l'cran en ah,al================
ShowInt:
push eax bx cx edx esi di es ds
mov di,cs:xy
mov cx,0B800h
mov es,cx
xor cx,cx
mov eax,edx
mov esi,10
mov bx,offset showbuffer+27
decint3:
xor edx,edx
div esi
add dl,'0'
mov dh,7
sub bx,2
add cx,2
mov cs:[bx],dx
cmp ax,0
jne decint3
mov si,bx
push cs
pop ds
cld
rep movsb
mov cs:xy,di
pop ds es di esi edx cx bx eax
ret
;================Affiche la chaine 0 de caractŠre contenue dans ds:si
showstring0:
push es cx si di
mov di,cs:xy
mov cx,0B800h
mov es,cx
mov ch,cs:colors
strinaize0:
mov cl,[si]
cmp cl,0
je no0
mov es:[di],cx
add di,2
inc si
jmp strinaize0
no0:
mov cs:xy,di
pop di si cx es
ret
;==============================Affiche le nombre nb hexa en EDX==============
ShowHex:
push es ax bx cx edx di
mov di,cs:xy
mov bx,0B800h
mov es,bx
mov ax,cx
sub cx,32
neg cx
shl edx,cl
mov ch,cs:colors
shr ax,2
Hexaize:
rol edx,4
mov bx,dx
and bx,0fh
mov cl,cs:[bx+offset Tab]
mov es:[di],cx
add di,2
dec al
jnz Hexaize
mov cs:xy,di
pop di edx cx bx ax es
ret
Tab db '0123456789ABCDEF'
x db 0
y db 0
xy dw 0
pagesize dw 80*25*2
lines db 25
columns db 80
colors db 7
showbuffer db 35 dup (0FFh)
end start end start

View File

@ -1,13 +1,21 @@
.model tiny .model tiny
.386c .486
smart
.code .code
org 0100h
org 0h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,>
realstart:
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
@ -41,62 +49,43 @@ Adres:
int 47h int 47h
mov bh,infos mov bh,infos
mov edi,ebp mov edi,ebp
mov ah,21
mov cl,7
int 47h
lines: lines:
xor edx,edx
mov dx,di
push edx
mov edx,edi mov edx,edi
shr edx,4*4 shr edx,4*4
shl edx,4*3 shl edx,4*3
mov cx,16 push edx
mov ah,10 push offset spaces
int 47h call [print]
mov si,offset dep
mov ah,13
int 47h
mov dx,di mov dx,di
mov ah,10
int 47h
mov ah,13
mov si,offset spaces
int 47h
mov ah,5
int 47h
mov al,infos+1 mov al,infos+1
mov cl,7
mov ah,21
int 47h
mov esi,edi mov esi,edi
doaline: doaline:
mov edx,edi mov edx,edi
shr edx,4*4 shr edx,4*4
shl edx,4*3 shl edx,4*3
mov fs,dx mov fs,dx
mov dl,fs:[di] push dword ptr fs:[di]
mov ah,10 push 8
mov cl,8 call [showhex]
int 47h push ' '
mov ah,5 call [showchar]
int 47h
inc edi inc edi
dec al dec al
jnz doaline jnz doaline
mov edi,esi mov edi,esi
mov si,offset spaces push offset spaces2
mov ah,13 call [print]
int 47h
mov al,infos+1 mov al,infos+1
mov ah,21
mov cl,7
int 47h
doaline2: doaline2:
mov edx,edi mov edx,edi
shr edx,4*4 shr edx,4*4
shl edx,4*3 shl edx,4*3
mov fs,dx mov fs,dx
mov dl,fs:[di] push word ptr fs:[di]
mov ah,7 call [showchar]
int 47h
inc edi inc edi
dec al dec al
jnz doaline2 jnz doaline2
@ -108,14 +97,12 @@ doaline2:
int 47h int 47h
jmp lines jmp lines
outes: outes:
mov ah,21
mov cl,112
int 47h
mov bh,0 mov bh,0
mov bl,infos mov bl,infos
mov si,offset menu mov ah,25
mov ah,14h
int 47h int 47h
push offset menu
call [print]
waitkey: waitkey:
mov ax,0 mov ax,0
int 16h int 16h
@ -151,18 +138,13 @@ outes:
suit6: suit6:
cmp ax,4100h cmp ax,4100h
jne suit7 jne suit7
mov ah,21
mov cl,116
int 47h
mov dword ptr [pope],'TIDE' mov dword ptr [pope],'TIDE'
mov bh,0
mov bl,infos mov bl,infos
xor bh,bh mov ah,25
mov si,offset menu
mov ah,14h
int 47h
mov ah,21
mov cl,7
int 47h int 47h
push offset menu
call [print]
mov ax,0B800h mov ax,0B800h
mov es,ax mov es,ax
mov xxyy2,3 mov xxyy2,3
@ -241,28 +223,20 @@ writs:
cmp ch,cl cmp ch,cl
je no je no
push si ax push si ax
mov ah,25 mov bh,0
mov bl,infos mov bl,infos
xor bh,bh mov ah,25
int 47h
mov ah,21
mov cl,117
int 47h
mov si,offset msg
mov ah,13
int 47h int 47h
push offset msg
call [print]
mov ax,0 mov ax,0
int 16h int 16h
mov bh,0
mov bl,infos mov bl,infos
xor bh,bh
mov ah,25 mov ah,25
int 47h int 47h
mov ah,21 push offset menu
mov cl,116 call [print]
int 47h
mov ah,13
mov si,offset menu
int 47h
pop bx si pop bx si
mov es:[bx-1],edi mov es:[bx-1],edi
mov es:[si-1],dx mov es:[si-1],dx
@ -285,10 +259,9 @@ 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 ; +++++++ retf
ret
calc1: calc1:
push ax dx si push ax dx si
@ -375,14 +348,25 @@ yy dw 0
xxyy dw 3 xxyy dw 3
xxyy2 dw 3 xxyy2 dw 3
msg db 'Erreur : zone non modifiable (ROM) pressez une touche pour continuer ',0 msg db '\c74Erreur : zone non modifiable (ROM) pressez une touche pour continuer ',0
menu db 'haut/bas [F1/2] Offset [F3/4] Segment [F5/6] Mode F7, Quitter F8 MODE ' menu db '\c70haut/bas [F1/2] Offset [F3/4] Segment [F5/6] Mode F7, Quitter F8 MODE '
pope db 'VUE ',0 pope db 'VUE ',0
spaces db ' ³ ',0 spaces db '\c02%hW:%hW \c04| \c07',0
spaces2 db '\c04 | \c07',0
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)
imports:
db "VIDEO.LIB::print",0
print dd 0
db "VIDEO.LIB::showhex",0
showhex dd 0
db "VIDEO.LIB::showchar",0
showchar dd 0
dw 0
end start end start

29
programs/exem-ce.asm Normal file
View File

@ -0,0 +1,29 @@
.model small
.486
smart
.code
org 0h
include ..\include\mem.h
start:
header exe <,1,0,,,offset imports,offset exports,>
realstart:
push offset message
call [affiche]
call [waitkey]
retf
message db 'Appel de la librairie video !',0
imports:
db "VIDEO.LIB::print",0
affiche dd 0
db "EXEM-LIB.LIB::waitkey",0
waitkey dd 0
dw 0
exports:
end start

25
programs/exem-lib.asm Normal file
View File

@ -0,0 +1,25 @@
.model tiny
.486
smart
.code
org 0h
include ..\include\mem.h
start:
header exe <,1,0,,,offset imports,offset exports,>
getvar2:
mov ax,0
int 16h
retf
imports:
exports:
db "waitkey",0
dw getvar2
dw 0
end start

View File

@ -3,133 +3,42 @@
smart smart
.code .code
org 0100h org 0h
include ..\include\mem.h
include ..\include\fat.h include ..\include\fat.h
start: start:
mov ah,2 header exe <,1,0,,,offset imports,,>
int 47h
mov ah,25 realstart:
mov bx,0 push offset msg1
int 47h call [print]
mov ah,21
mov cl,70h
int 47h
mov ah,13
mov si,offset msg1
int 47h
mov ah,21
mov cl,7
int 47h
mov ah,13
mov si,offset prompt
int 47h
mov ah,13
mov si,offset infos
int 47h
mov ah,13
mov si,offset prompt
int 47h
mov ah,3 mov ah,3
int 48h int 48h
xor bp,bp xor bp,bp
mov di,offset bufferentry mov di,offset bufferentry
mov si,di
mov ah,7 mov ah,7
int 48h int 48h
jc nofiles jc nofiles
go: go:
test [si+Entries.FileAttr],00010000b push word ptr [di+Entries.FileAttr]
je notdirectory push dword ptr [di+Entries.FileSize]
mov ah,21 push word ptr [di+Entries.FileTime]
mov cl,4 push word ptr [di+Entries.FileDate]
int 47h push word ptr [di+Entries.FileTimeCrea]
jmp notall push word ptr [di+Entries.FileDateCrea]
notdirectory: push di
cmp [si+Entries.FilExt],'E' push offset line
jne notexe call [print]
cmp [si+Entries.FilExt+1],'X'
jne notexe
cmp [si+Entries.FilExt+2],'E'
jne notexe
mov ah,21
mov cl,5
int 47h
jmp notall
notexe:
cmp [si+Entries.FilExt],'S'
jne notsys
cmp [si+Entries.FilExt+1],'Y'
jne notsys
cmp [si+Entries.FilExt+2],'S'
jne notsys
mov ah,21
mov cl,0Ah
int 47h
jmp notall
notsys:
mov ah,21
mov cl,7h
int 47h
notall:
mov ah,46
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,44
mov dx,[si+Entries.FileDateCrea]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,45
mov dx,[si+Entries.FileTimeCrea]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,44
mov dx,[si+Entries.FileDate]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,45
mov dx,[si+Entries.FileTime]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,48
mov edx,[si+Entries.FileSize]
int 47h
mov ah,05
int 47h
int 47h
int 47h
mov ah,47
mov dl,[si+Entries.FileAttr]
int 47h
mov ah,6
int 47h
inc bp inc bp
mov ah,8 mov ah,8
int 48h int 48h
jnc go jnc go
nofiles: nofiles:
mov ah,21 push offset menu
mov cl,70h call [print]
int 47h
mov ah,13
mov si,offset menu
int 47h
mov xx,1 mov xx,1
mov xxold,2 mov xxold,2
call Select call Select
@ -139,7 +48,7 @@ int 16h
cmp ah,50h cmp ah,50h
jne tre1 jne tre1
cmp xx,bp cmp xx,bp
je endof ja endof
inc xx inc xx
call select call select
jmp endof jmp endof
@ -157,11 +66,11 @@ tre2:
tre3: tre3:
cmp ah,59 cmp ah,59
jne tre4 jne tre4
jmp start jmp realstart
tre4: tre4:
cmp ah,67 cmp ah,67
jne endof jne endof
db 0CBh retf
;selectionne la ligne xx ;selectionne la ligne xx
Select: Select:
@ -183,12 +92,18 @@ ret
xx dw 1 xx dw 1
xxold dw 0 xxold dw 0
menu db '[F1] Lire disque [F9] Quitter ',0 menu db '\c70 [F1] Lire disque [F9] Quitter \c07',0
msg1 db ' Gestionnaire de fichier Version 1.0 ',0 msg1 db '\e\g00,00\c70 Gestionnaire de fichier Version 1.5 '
msg2 db 'Programme en cours de chargement',0 db '\g00,01\c07--------------------------------------------------------------------------------'
prompt db '--------------------------------------------------------------------------------',0 db '\g00,02Nom Ext. Date creation Date modification Taille Attributs'
infos db 'Nom Ext. Date creation Date modification Taille Attributs',0 db '\g00,03--------------------------------------------------------------------------------\l',0
line db '\c07%n %d %t %d %t %z %a\l',0
bufferentry db 512 dup (0)
bufferentry equ $
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start

39
programs/isa.asm Normal file
View File

@ -0,0 +1,39 @@
.model tiny
.486
smart
.code
org 0100h
start:
PNP_ADR_PORT equ 0x279
PNP_WRITE_PORT equ 0xA79
;MIN and MAX READ_ADDR must have the bottom two bits set
MIN_READ_ADDR equ 0x203
MAX_READ_ADDR equ 0x3FF
;READ_ADDR_STEP must be a multiple of 4
READ_ADDR_STEP equ 8
;bits
CONFIG_WAIT_FOR_KEY equ 0x02
CONFIG_RESET_CSN equ 0x04
IDENT_LEN equ 9
;renvoie le timer en ax
ctc:
cli
mov dx,043h
mov al,0
out dx,al
mov dx,40h
in al,dx
mov ah,al
in al,dx
sti
ret
;attend pendant ax microsecondes
usleep:
end start

View File

@ -1,22 +1,37 @@
.model tiny .model tiny
.386c .486
smart
.code .code
org 0100h
org 0h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,>
realstart:
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
@ -25,58 +40,75 @@ jc problem2
push es push es
pop ds pop ds
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
mov cx,300 push 0
mov bx,30 call cs:[loadbmppalet]
mov ah,37 push 150
int 47h push 20
mov ah,15h push 0
mov cl,11 call cs:[showbmp]
int 47h jc problem4
push cs push cs
pop ds pop ds
mov ah,13 push offset poper
mov si,offset poper call [print]
int 47h endofit:
mov ax,0 xor ax,ax
int 16h int 16h
mov ah,39 mov ah,29h
int 47h int 47h
mov ax,0004 retf
int 47h
db 0CBH
problem: problem:
push cs push cs
pop ds pop ds
mov ah,13 push offset error
mov si,offset error call [print]
int 47h jmp endofit
mov ax,0
int 16h
db 0CBh
problem2: problem2:
push cs push cs
pop ds pop ds
mov ah,13 push offset error2
mov si,offset error2 call [print]
int 47h jmp endofit
mov ax,0
int 16h
db 0CBh
poper db 'COS2000 en mode graphique',0 problem3:
push cs
pop ds
push offset error3
call [print]
jmp endofit
problem4:
push cs
pop ds
push offset error4
call [print]
jmp endofit
poper db '\c0BC\c0CO\c0DS\c0E2\c0E0\c0E0\c0F0 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
error db 'Une erreur est apparue lors du chargement de l''image',0 error3 db '\c04Une erreur est apparue lors de l''allocation de mémoire',0
error2 db 'Une erreur est apparue lors de la decompression de l''image',0 error db '\c04Une erreur est apparue lors du chargement de l''image',0
error2 db '\c04Une erreur est apparue lors de la decompression de l''image',0
error4 db '\c0FUne erreur est apparue lors de l''affichage de l''image',0
imports:
db "VIDEO.LIB::print",0
print dd 0
db "BMP.LIB::showbmp",0
showbmp dd 0
db "BMP.LIB::loadbmppalet",0
loadbmppalet dd 0
dw 0
end start end start

82
programs/memoire.asm Normal file
View File

@ -0,0 +1,82 @@
.model tiny
.486
smart
.code
org 0h
include ..\include\mem.h
include ..\include\divers.h
start:
header exe <,1,0,,,offset imports,,>
realstart:
push offset msg
call [print]
xor cx,cx
listmcb:
mov ah,4
int 49h
jc fino
inc cx
;placement mémoire
mov dx,gs
inc dx
inc dx
push edx
;parent
cmp gs:[MB.Reference],0
je next
mov dx,gs:[MB.Reference]
dec dx
dec dx
push dx
push offset MB.Names
jmp suitemn
next:
push cs
push offset none
suitemn:
;Resident
cmp gs:[MB.IsResident],true
jne notresident
push offset resident
jmp suitelistmcb
notresident:
push offset nonresident
suitelistmcb:
;taille memoire
xor edx,edx
mov dx,gs:[MB.Sizes]
shl edx,4
push 6
push edx
;nom
push gs
push offset MB.Names
push offset line
call [print]
jmp listmcb
fino:
db 0CBh
resident db "oui",0
nonresident db "non",0
line db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0
msg db "Memory manager V1.5\lNom Taille Res Parent Mem\l",0
none db ".",0
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start

View File

@ -3,7 +3,7 @@
smart smart
.code .code
org 0100h org 0h
start: start:
mov eax,cr0 mov eax,cr0

View File

@ -3,11 +3,25 @@
smart smart
.code .code
org 0100h org 0h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,>
realstart:
mov ah,2 mov ah,2
int 74h int 74h
db 0CBh push offset message
call [print]
retf
message db 'Activation de la souris',0
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start

View File

@ -2,181 +2,36 @@
.486 .486
smart smart
.code .code
org 0100h
org 0h
include ..\include\mem.h
start: start:
mov ah,26 header exe <,1,0,,,offset imports,,>
int 47h
mov ax,0001 realstart:
int 47h mov ah,28h
mov ah,2
int 47h int 47h
mov si,offset text1 ;titre push word ptr 0FFFFh
mov ah,13 push dword ptr 652201
int 47h push dword ptr 1545454545
mov ah,6 push word ptr 1523
int 47h push word ptr 2041
int 47h push offset zero
push offset fixe
mov ah,21 push word ptr 5
mov cl,3 push word ptr 'i'
int 47h push word ptr 'a'
mov ah,13 push dword ptr 5041
mov si,offset text2 push dword ptr 125645
int 47h push dword ptr 5041
mov ah,6 push dword ptr 125645
int 47h push dword ptr 5041
mov edx,2612182686 push dword ptr 125645
mov ah,8 push offset message
int 47h call [print]
mov ah,6
int 47h
mov edx,7576534
mov ah,8
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,4
int 47h
mov si,offset text3
mov ah,13
int 47h
mov ah,6
int 47h
mov edx,-6876253
mov cx,32
mov ah,9
int 47h
mov ah,6
int 47h
mov edx,-311212323
mov cx,32
mov ah,9
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,5
int 47h
mov ah,13
mov si,offset text4
int 47h
mov ah,6
int 47h
mov edx,0892325457
mov cx,16
mov ah,10
int 47h
mov ah,6
int 47h
mov edx,0236514
mov ah,10
mov cx,32
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,6
int 47h
mov ah,13
mov si,offset text5
int 47h
mov ah,6
int 47h
mov edx,3762182686
mov ah,11
mov cx,32
int 47h
mov ah,6
int 47h
mov edx,2182686
mov ah,11
mov cx,16
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,7
int 47h
mov ah,13
mov si,offset text6
int 47h
mov ah,6
int 47h
mov dl,'h'
mov ah,7
int 47h
mov ah,6
int 47h
mov dl,'@'
mov ah,7
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,8
int 47h
mov ah,13
mov si,offset text7
int 47h
mov ah,6
int 47h
mov si,offset textt
mov ah,13
int 47h
mov ah,6
int 47h
mov si,offset texttt
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,9
int 47h
mov ah,13
mov si,offset text71
int 47h
mov ah,6
int 47h
mov dx,0BF30h
mov ah,44
int 47h
mov ah,6
int 47h
mov dx,0B0B6h
mov ah,44
int 47h
mov ah,6
int 47h
mov ah,13
mov si,offset text72
int 47h
mov ah,6
int 47h
mov edx,8601h
mov ah,45
int 47h
mov ah,6
int 47h
mov dx,0B0B6h
mov ah,45
int 47h
mov ah,6
int 47h
mov ax,0 mov ax,0
int 16h int 16h
@ -187,20 +42,14 @@ int 47h
mov ah,2 mov ah,2
int 47h int 47h
mov ah,21
mov cl,5
int 47h
mov cx,200 mov cx,200
go1: go1:
mov ah,30 mov ah,30
int 47h int 47h
mov ah,33 mov ah,33
int 47 int 47
mov ah,20 push offset textdemo1
xor bh,bh call [print]
inc bl
mov si,offset text8
int 47h
call put call put
mov ah,30 mov ah,30
int 47h int 47h
@ -209,20 +58,14 @@ int 47h
dec cx dec cx
jnz go1 jnz go1
mov ah,21
mov cl,7
int 47h
mov cx,200 mov cx,200
go2: go2:
mov si,offset text9
mov ah,30 mov ah,30
int 47h int 47h
mov ah,33 mov ah,33
int 47h int 47h
mov ah,6 push offset textdemo2
int 47h call [print]
mov ah,13
int 47h
call put call put
mov ah,30 mov ah,30
int 47h int 47h
@ -231,20 +74,14 @@ int 47h
dec cx dec cx
jnz go2 jnz go2
mov ah,21
mov cl,9
int 47h
mov cx,200 mov cx,200
go3: go3:
mov si,offset text10
mov ah,30 mov ah,30
int 47h int 47h
mov ah,33 mov ah,33
int 47h int 47h
xor bh,bh push offset textdemo3
inc bl call [print]
mov ah,20
int 47h
call put call put
mov ah,30 mov ah,30
int 47h int 47h
@ -257,14 +94,8 @@ mov ah,30
int 47h int 47h
mov ah,2 mov ah,2
int 47h int 47h
mov bx,040Dh push offset texte2
mov si,offset texte1 call [print]
mov ah,20
int 47h
mov si,offset texte2
inc bl
mov ah,20
int 47h
mov ah,30 mov ah,30
int 47h int 47h
mov ah,2 mov ah,2
@ -272,9 +103,6 @@ int 47h
mov ah,30 mov ah,30
int 47h int 47h
mov cl,12
mov ah,21
int 47h
mov bp,255 mov bp,255
xor edx,edx xor edx,edx
go4: go4:
@ -283,32 +111,28 @@ int 47h
mov ah,33 mov ah,33
int 47h int 47h
inc edx inc edx
mov ah,11 push edx
mov cx,16 push offset texte3
int 47h call [print]
mov ah,6
int 47h
mov ah,30 mov ah,30
int 47h int 47h
mov ah,33 mov ah,33
int 47h int 47h
dec bp dec bp
jnz go4 jnz go4
mov ah,27 push offset texte4
int 47h call [print]
xor bx,bx
mov si,offset texte3
mov ah,20
int 47h
mov ax,0 mov ax,0
int 16h int 16h
db 0CBh mov ah,29h
int 47h
retf
put: put:
call random call random
mov di,dx mov di,dx
and di,4096-2 and di,4096-2
mov si,offset text11 mov si,offset fond
call showstring2 call showstring2
ret ret
@ -332,24 +156,27 @@ mov cs:randseed,dx
pop dx cx ax pop dx cx ax
ret ret
texttt db 'Texte',0 zero db 'Chaine a zro terminal',0
textt db 'Divers',0 fixe db 20,'Chaine a taille fixe'
text1 db ' Dmonstration de l''utilisation de la bibliothŠque VIDEO',0 message db "\m01\e\c07\h01Dmonstration de la librairie VIDEO.LIB\l\l"
text2 db 'Nombre entier :',0 db "\c01Nombres entiers ou signs (%%u/%%i):\l%u\l%iD\l"
text3 db 'Nombre sign :',0 db "\c02Nombre hexadcimaux (%%h):\l%hD\l%hW\l"
text4 db 'Nombre hxadcimal :',0 db "\c03Nombres Binaires (%%b):\l%bD\l%bB\l"
text5 db 'Nombre binaire :',0 db "\c04Caracteres simples ou multiples (%%c/%%cM):\l%c\l%cM\l"
text6 db 'CaractŠres :',0 db "\c05Chaines a zro terminal ou fixes (%%0/%%s):\l%s\l%0\l"
text7 db 'Texte :',0 db "\c06Dates et heures (%%t/%%d):\l%t\l%d\l"
text71 db 'Date :',0 db "\c07Nombre a echelle automatique (%%z):\l%z\l%z\l"
text72 db 'Heure :',0 db "\c08Attributs de fichiers (%%a):\l%a",0
text8 db 'Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling',0
text9 db 'Vertical Vertical Vertical Vertical Vertical Vertical Vertical Vertical',0 fond db 16,'Ceci est un fond'
text10 db 'Rapide Rapide Rapide Rapide Rapide Rapide Rapide Rapide',0 textdemo1 db '\c05Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling Scrolling\l',0
text11 db 'Echange rapide de pages Vido',0 textdemo2 db '\c07Vertical Vertical Vertical Vertical Vertical Vertical Vertical Vertical\l',0
texte1 db 'Routine d''affichage Ultra Rapide Agissant sur le Matriel',0 textdemo3 db '\c09Rapide Rapide Rapide Rapide Rapide Rapide Rapide Rapide\l',0
texte2 db 'Possibilit de raliser des effets de superposition',0 texte1 db 'Echange rapide de pages Vido',0
texte3 db 'Sauvegarde et restauration de l''ecran',0 texte2 db '\g04,13Routine d''affichage Ultra Rapide Agissant sur le Matriel'
db '\g04,14Possibilit de raliser des effets de superposition',0
texte3 db '\c04%bD\l',0
texte4 db '\g01,00Sauvegarde et restauration de l''ecran (%%s/%%r)',0
showstring2: showstring2:
push es bx cx si di push es bx cx si di
@ -368,6 +195,9 @@ strinaize4:
pop di si cx bx es pop di si cx bx es
ret ret
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start

View File

@ -1,151 +1,113 @@
.model tiny .model tiny
.386c .386c
.code .code
org 0100h org 0h
include ..\include\mem.h
start: start:
mov ax,0002 header exe <,1,0,,,offset imports,,>
int 47H
mov ah,26 realstart:
int 47H mov ah,28h
replay: int 47h
mov ah,2 push offset msg
int 47h call [print]
mov ah,21 mov bp,1000h
mov cl,7 xor di,di
int 47h xor cx,cx
xor di,di xor edx,edx
xor cx,cx
mov ah,20
mov bx,1D00h
mov si,offset Msg
int 47h
mov ah,20
mov bx,0231h
mov si,offset msgapp
int 47h
VerifAll: VerifAll:
mov ah,1 mov ah,1
int 16h int 16h
cmp al,32 jz nokey
je enend cmp al,' '
mov ax,cx je enend
mov si,100 nokey:
mul si mov dx,di
mov si,2880 push edx
div si mov dx,cx
xor edx,edx inc dx
mov dx,ax push edx
mov ah,15 mov ax,cx
mov bx,0A14h inc ax
int 47h mov si,100
mov ah,13 mul si
mov si,offset po mov si,2880
int 47h div si
mov ah,15 mov dx,ax
mov dx,cx push edx
mov bx,0A10h push offset msg2
int 47h call [print]
mov ah,13 call gauge
mov si,offset Msg2 mov ah,2
int 47h int 48h
mov ah,8 jc errors
mov edx,0 je noprob
mov dx,di inc di
int 47h noprob:
mov ah,13 inc cx
mov si,offset Msg3 cmp cx,2880
int 47h jnz verifall
call gauge
mov ah,2
int 48h
jc errors
je noprob
inc di
noprob:
inc cx
cmp cx,2880
jnz verifall
enend: enend:
cmp di,0 cmp di,0
je noatall je noatall
mov bx,0E09h push offset error2
mov ah,20 call [print]
mov si,offset error2 jmp someof
int 47h noatall:
jmp someof push offset noerror
noatall: call [print]
mov bx,0E09h someof:
mov ah,20 mov ah,0
mov si,offset noerror int 16h
int 47h mov ah,29h
someof: int 47H
mov ah,0 retf
int 16h errors:
mov ah,27 push offset error
int 47h call [print]
db 0CBH mov ah,0
errors: int 16h
mov ah,21 mov ah,29h
mov cl,4 int 47H
int 47h retf
mov bx,0D09h
mov ah,20
mov si,offset errore
int 47h
mov ah,0
int 16h
jmp replay
errore db 'Erreur avec le lecteur de disquette !',0 error db '\g10,10Erreur avec le lecteur de disquette !',0
noerror db 'Pas de secteurs defectueux, appuyez sur une touche pour continuer',0 error2 db '\g10,10Le disque est defectueux, appuyez sur une touche pour quitter',0
error2 db 'Le disque est defectueux, appuyez sur une touche pour quitter',0 noerror db '\g10,10Pas de secteurs defectueux, appuyez sur une touche pour continuer',0
po db ' %',0 msg db '\m02\e\c07\g29,00- Test de surface du disque -\g02,49<Pressez espace pour quitter>',0
msgapp db '<Pressez espace pour quitter>',0 msg2 db '\g10,20%u %%\g10,16%u cluster testes. \h34%u cluster defectueux. ',0
msg db '- Test de surface du disque -',0
msg2 db ' cluster tested. ',0
msg3 db ' cluster defectueux. ',0
;->Increment CX
gauge: gauge:
push ax bx cx dx si ds push ax dx
push cs mov ax,cx
pop ds mul sizeof
mov ax,cx div max
mul sizes xor edx,edx
div max mov dx,sizeof
mov dx,ax sub dx,ax
mov bl,oldvalue push dx
xor bh,bh push 'Û'
mov byte ptr [offset gaugetxt+bx],'Û' mov dx,ax
cmp bx,0 push dx
jnz nono2 push 'Û'
mov ah,21 push offset gauges
mov cl,8 call [print]
int 47h pop dx ax
mov bx,xy retn
mov ah,20
mov si,offset gaugetxt max dw 2879
int 47h sizeof dw 50
mov ah,21
mov cl,7 gauges db '\g10,18\c05%cM\c07%cM',0
int 47h
nono2: imports:
mov bx,dx db "VIDEO.LIB::print",0
xor bh,bh print dd 0
mov byte ptr [offset gaugetxt+bx],0 dw 0
mov oldvalue,bl
mov bx,xy
mov ah,20
mov si,offset gaugetxt
int 47h
pop ds si dx cx bx ax
ret
oldvalue db 0
max dw 2880
sizes dw 50
xy dw 0A12h
gaugetxt db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0
End Start End Start

View File

@ -1,13 +1,21 @@
.model tiny .model tiny
.386c .486
smart
.code .code
org 0100h
org 0h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,>
realstart:
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 +23,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 +36,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:
@ -32,12 +44,8 @@ Adres:
mov bl,infos mov bl,infos
xor bh,bh xor bh,bh
int 47h int 47h
mov ah,21 push offset errordisk
mov cl,116 call [print]
int 47h
mov ah,13
mov si,offset errordisk
int 47h
mov ax,0 mov ax,0
int 16h int 16h
noerror: noerror:
@ -65,52 +73,32 @@ Adres:
int 47h int 47h
mov bh,infos mov bh,infos
mov di,bp mov di,bp
mov ah,21
mov cl,7
int 47h
lines: lines:
mov dx,sect xor edx,edx
mov cx,16
mov ah,10
int 47h
mov si,offset dep
mov ah,13
int 47h
mov dx,di mov dx,di
mov ah,10 push edx
int 47h mov dx,sect
mov ah,13 push edx
mov si,offset spaces push offset spaces
int 47h call [print]
mov ah,5
int 47h
mov al,infos+1 mov al,infos+1
mov cl,7
mov ah,21
int 47h
mov si,di mov si,di
doaline: doaline:
mov dl,[di+offset buffer] push dword ptr [di+offset buffer]
mov ah,10 push 8
mov cl,8 call [showhex]
int 47h push ' '
mov ah,5 call [showchar]
int 47h
inc di inc di
dec al dec al
jnz doaline jnz doaline
mov di,si mov di,si
mov si,offset spaces push offset spaces2
mov ah,13 call [print]
int 47h
mov al,infos+1 mov al,infos+1
mov ah,21
mov cl,7
int 47h
doaline2: doaline2:
mov dl,[di+offset buffer] push word ptr [di+offset buffer]
mov ah,7 call [showchar]
int 47h
inc di inc di
dec al dec al
jnz doaline2 jnz doaline2
@ -122,14 +110,12 @@ doaline2:
int 47h int 47h
jmp lines jmp lines
outes: outes:
mov ah,21
mov cl,112
int 47h
mov bh,0 mov bh,0
mov bl,infos mov bl,infos
mov si,offset menu mov ah,25
mov ah,14h
int 47h int 47h
push offset menu
call [print]
waitkey: waitkey:
mov ax,0 mov ax,0
int 16h int 16h
@ -177,19 +163,12 @@ outes:
cmp ax,4100h cmp ax,4100h
jne suit7 jne suit7
mov dword ptr [pope],'TIDE' mov dword ptr [pope],'TIDE'
mov bh,0
mov bl,infos mov bl,infos
xor bh,bh
mov ah,25 mov ah,25
int 47h int 47h
mov ah,21 push offset menu
mov cl,116 call [print]
int 47h
mov si,offset menu
mov ah,13
int 47h
mov ah,21
mov cl,7
int 47h
mov ax,0B800h mov ax,0B800h
mov es,ax mov es,ax
mov xxyy2,3 mov xxyy2,3
@ -203,9 +182,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,8 +261,9 @@ cursor:
suit7: suit7:
cmp ax,4200h cmp ax,4200h
jne adres2 jne adres2
db 0CBH mov ah,29h
ret int 47H
retf
calc1: calc1:
push ax dx si push ax dx si
@ -292,7 +272,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 +295,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
@ -366,15 +347,27 @@ xx dw 0
yy dw 0 yy dw 0
xxyy dw 3 xxyy dw 3
xxyy2 dw 3 xxyy2 dw 3
errordisk db 'Une erreur est apparue sur le lecteur, appuyez sur une touche ',0
menu db 'Haut&Bas [F1/2] Secteur [F3/4] Charger/Sauver [F5/6] Mode [F7] Quit. [F8] ' errordisk db '\c74Une erreur est apparue sur le lecteur, appuyez sur une touche ',0
pope db 'VIEW',0 menu db '\c70Haut&Bas [F1/2] Secteur [F3/4] Charger/Sauver [F5/6] Mode [F7] Quit. [F8] '
spaces db ' ³ ',0 pope db 'VUE ',0
spaces db '\c02%hW:%hW \c04| \c07',0
spaces2 db '\c04 | \c07',0
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)
imports:
db "VIDEO.LIB::print",0
print dd 0
db "VIDEO.LIB::showhex",0
showhex dd 0
db "VIDEO.LIB::showchar",0
showchar dd 0
dw 0
end start end start