commit
a845b77632
29
MAKEFILE
29
MAKEFILE
|
@ -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 ..\binaires\data
|
|
||||||
copy programs\*.com ..\binaires\data
|
|
||||||
copy programs\*.rip ..\binaires\data
|
|
||||||
copy noyau\*.sys ..\binaires\data
|
|
||||||
copy noyau\*.bin ..\binaires\data
|
|
||||||
copy contribs\*.com ..\binaires\data
|
|
||||||
copy install\*.com ..\binaires
|
|
||||||
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 ..
|
||||||
|
|
106
include/fat.h
106
include/fat.h
|
@ -1,58 +1,52 @@
|
||||||
Free equ 0
|
struc dpt
|
||||||
True equ 1
|
steprate&headunload db 0DFh ;Vitesse de progression & mont‚e 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 donn‚es
|
||||||
|
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 mont‚e en vitesse du moteur
|
||||||
|
ends dpt
|
||||||
|
|
||||||
DPT struc
|
struc entries
|
||||||
StepRate&HeadUnload db 0DFh ;Vitesse de progression & mont‚e 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 donn‚es
|
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 mont‚e 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 cach‚s
|
||||||
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 d‚marrage
|
||||||
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 cach‚s
|
|
||||||
HiddenSectorsL dw 0 ;
|
|
||||||
SectorPerDisk2 dd 0 ;Nombre secteur du volume si > 32 Mo+20h ; the number of sectors
|
|
||||||
BootDrive db 0 ;Lecteur de d‚marrage
|
|
||||||
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
|
|
||||||
|
|
|
@ -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
|
|
@ -1,20 +1,21 @@
|
||||||
.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 V1.2Fr programme d''installation',0Dh,0AH,'Inserez une disquette formatee et appuyez sur entre...',0Dh,0AH,'Attention le contenu de celle ci peut etre altere !!!',0Dh,0AH,'$'
|
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 ete correctement installe, 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
|
||||||
|
@ -53,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,8 +98,8 @@ allfile:
|
||||||
push cs
|
push cs
|
||||||
pop es
|
pop es
|
||||||
mov di,offset dta+30-3
|
mov di,offset dta+30-3
|
||||||
mov word ptr [di],":a"
|
mov [word ptr di],":a"
|
||||||
mov byte ptr [di+2],"\"
|
mov [byte ptr di+2],"\"
|
||||||
xor cx,cx
|
xor cx,cx
|
||||||
mov dx,di
|
mov dx,di
|
||||||
int 21h
|
int 21h
|
||||||
|
@ -118,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
|
||||||
|
@ -146,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
|
||||||
|
@ -160,5 +161,4 @@ error:
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
int 16h
|
int 16h
|
||||||
ret
|
ret
|
||||||
|
|
||||||
end start
|
|
||||||
|
|
|
@ -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
|
713
lib/video.asm
713
lib/video.asm
File diff suppressed because it is too large
Load Diff
149
noyau/8259a.asm
149
noyau/8259a.asm
|
@ -1,48 +1,11 @@
|
||||||
.model tiny,StdCall
|
|
||||||
.486
|
|
||||||
.code
|
|
||||||
Locals
|
|
||||||
jumps
|
|
||||||
|
|
||||||
org 0h
|
|
||||||
|
|
||||||
include ..\include\mem.h
|
|
||||||
include ..\include\bmp.h
|
|
||||||
|
|
||||||
start:
|
|
||||||
header exe <,1,0,,,,offset exports,>
|
|
||||||
|
|
||||||
exports:
|
|
||||||
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 "installhandler",0
|
|
||||||
dw installhandler
|
|
||||||
db "replacehandler",0
|
|
||||||
dw replacehandler
|
|
||||||
db "getint",0
|
|
||||||
dw getint
|
|
||||||
db "setint",0
|
|
||||||
dw setint
|
|
||||||
db "seteoi",0
|
|
||||||
dw seteoi
|
|
||||||
dw 0
|
|
||||||
|
|
||||||
;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 sp‚cifi‚
|
EOI = 020h ;End of Interrupt non sp‚cifi‚
|
||||||
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
|
||||||
|
@ -50,24 +13,23 @@ exports:
|
||||||
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'op‚ration, pas de Poll, lire ISR OCW3
|
ISR = 0Bh ; Pas d'op‚ration, pas de Poll, lire ISR OCW3
|
||||||
IRR = 0Ah ; Pas d'op‚ration, pas de Poll, lire IRR
|
IRR = 0Ah ; Pas d'op‚ration, pas de Poll, lire IRR
|
||||||
|
|
||||||
|
|
||||||
;Autorise une interruption ‚lectronique
|
;Autorise une interruption ‚lectronique
|
||||||
;Entr‚e : %1 - Num‚ro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
;Entr‚e : %1 - Num‚ro de l'interruption (0-15) … autoriser 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
||||||
EnableIRQ PROC FAR
|
PROC enableirq FAR
|
||||||
ARG @irq:word
|
ARG @irq:word
|
||||||
USES ax,cx,dx
|
USES ax,cx,dx
|
||||||
mov ax,[@irq]
|
mov ax,[@irq]
|
||||||
|
@ -86,11 +48,11 @@ EnableIRQ PROC FAR
|
||||||
and al,ah
|
and al,ah
|
||||||
out dx,al
|
out dx,al
|
||||||
ret
|
ret
|
||||||
EnableIRQ endp
|
endp enableirq
|
||||||
|
|
||||||
;Desactive une interruption ‚lectronique
|
;Desactive une interruption ‚lectronique
|
||||||
;Entr‚e : %0 - Num‚ro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
;Entr‚e : %0 - Num‚ro de l'interruption (0-15) … desactiver 0-7 = MASTERPIC , 8-15 = SLAVEPIC
|
||||||
DisableIRQ PROC FAR
|
PROC disableirq FAR
|
||||||
ARG @irq:word
|
ARG @irq:word
|
||||||
USES ax,cx,dx
|
USES ax,cx,dx
|
||||||
mov ax,[@irq]
|
mov ax,[@irq]
|
||||||
|
@ -109,11 +71,11 @@ DisableIRQ PROC FAR
|
||||||
or al,ah
|
or al,ah
|
||||||
out dx,al
|
out dx,al
|
||||||
ret
|
ret
|
||||||
DisableIRQ endp
|
endp disableirq
|
||||||
|
|
||||||
|
|
||||||
;Signale "End Of Interrupt" de l'interruption %0
|
;Signale "End Of Interrupt" de l'interruption %0
|
||||||
SetEOI PROC FAR
|
PROC seteoi FAR
|
||||||
ARG @irq:word
|
ARG @irq:word
|
||||||
USES ax,dx
|
USES ax,dx
|
||||||
mov ax,[@irq]
|
mov ax,[@irq]
|
||||||
|
@ -125,11 +87,11 @@ SetEOI PROC FAR
|
||||||
mov al,EOI
|
mov al,EOI
|
||||||
out MASTERPIC,al
|
out MASTERPIC,al
|
||||||
ret
|
ret
|
||||||
DisableIRQ endp
|
endp seteoi
|
||||||
|
|
||||||
|
|
||||||
;Lit les masques d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
;Lit les masques d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
||||||
ReadmaskIrq PROC FAR
|
PROC readmaskirq FAR
|
||||||
ARG @controleur:word
|
ARG @controleur:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
mov bx,[@controleur]
|
mov bx,[@controleur]
|
||||||
|
@ -142,10 +104,10 @@ ReadmaskIrq PROC FAR
|
||||||
in al,dx
|
in al,dx
|
||||||
pop dx
|
pop dx
|
||||||
ret
|
ret
|
||||||
ReadmaskIrq endp
|
endp readmaskirq
|
||||||
|
|
||||||
;Lit le registre d'‚tat d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
;Lit le registre d'‚tat d'un contr“leur IRQ dans ax, 0 master ou slave 1 ds %1
|
||||||
ReadISR PROC FAR
|
PROC readisr FAR
|
||||||
ARG @controleur:word
|
ARG @controleur:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
mov bx,[@controleur]
|
mov bx,[@controleur]
|
||||||
|
@ -154,16 +116,16 @@ ReadISR PROC FAR
|
||||||
jne @@master
|
jne @@master
|
||||||
mov dx,SLAVEPIC
|
mov dx,SLAVEPIC
|
||||||
@@master:
|
@@master:
|
||||||
mov al,isr
|
mov al,ISR
|
||||||
out dx,al
|
out dx,al
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
in al,dx
|
in al,dx
|
||||||
ret
|
ret
|
||||||
ReadISR endp
|
endp readisr
|
||||||
|
|
||||||
|
|
||||||
;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
|
||||||
ReadIRR PROC FAR
|
PROC readirr FAR
|
||||||
ARG @controleur:word
|
ARG @controleur:word
|
||||||
USES bx,dx
|
USES bx,dx
|
||||||
mov bx,[@controleur]
|
mov bx,[@controleur]
|
||||||
|
@ -172,74 +134,9 @@ ReadIRR PROC FAR
|
||||||
jne @@master
|
jne @@master
|
||||||
mov dx,SLAVEPIC
|
mov dx,SLAVEPIC
|
||||||
@@master:
|
@@master:
|
||||||
mov al,irr
|
mov al,IRR
|
||||||
out dx,al
|
out dx,al
|
||||||
xor ah,ah
|
xor ah,ah
|
||||||
in al,dx
|
in al,dx
|
||||||
ret
|
ret
|
||||||
ReadIRR endp
|
endp readirr
|
||||||
|
|
||||||
;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
|
|
||||||
|
|
|
@ -1,73 +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 mcb.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
|
|
||||||
|
|
||||||
mcb.sys: mcb.asm
|
|
||||||
$(asm) mcb
|
|
||||||
$(lnk) mcb
|
|
||||||
ren mcb.com mcb.sys
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
del *.obj
|
||||||
del *.exe
|
del *.exe
|
||||||
|
del *.bak
|
||||||
|
del *.lib
|
||||||
del *.com
|
del *.com
|
||||||
del *.sys
|
|
||||||
del *.err
|
|
||||||
del *.bin
|
del *.bin
|
||||||
|
del *.sys
|
||||||
|
del *.err
|
348
noyau/boot.asm
348
noyau/boot.asm
|
@ -1,222 +1,216 @@
|
||||||
boots segment
|
model tiny,stdcall
|
||||||
.386
|
p486
|
||||||
org 7C00h
|
locals
|
||||||
assume cs:boots,ds:boots
|
jumps
|
||||||
|
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 cach‚s
|
|
||||||
dd 0 ;si nbsecteur = 0 nbsect ; the number of sectors
|
|
||||||
bootdrv db 0 ;Lecteur de d‚marrage
|
|
||||||
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,000h
|
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
|
ret
|
||||||
|
|
||||||
|
|
||||||
getfat:
|
getfat:
|
||||||
push ax bx dx di
|
push ax bx dx di
|
||||||
mov di,offset bufferfat
|
mov di,offset bufferfat
|
||||||
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
|
||||||
add di,ax
|
add di,ax
|
||||||
cmp bx,0h
|
cmp bx,0h
|
||||||
jnz evenfat
|
jnz evenfat
|
||||||
oddfat:
|
oddfat:
|
||||||
mov dx,[di]
|
mov dx,[di]
|
||||||
and dx,0FFFh
|
and dx,0FFFh
|
||||||
mov cx,dx
|
mov cx,dx
|
||||||
jmp endfat
|
jmp endfat
|
||||||
evenfat:
|
evenfat:
|
||||||
mov dx,[di+1]
|
mov dx,[di+1]
|
||||||
and dx,0FFF0h
|
and dx,0FFF0h
|
||||||
shr dx,4
|
shr dx,4
|
||||||
mov cx,dx
|
mov cx,dx
|
||||||
endfat:
|
endfat:
|
||||||
pop di dx bx ax
|
pop di dx bx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
showstr:
|
showstr:
|
||||||
push ax bx si
|
push ax bx si
|
||||||
again:
|
again:
|
||||||
lodsb
|
lodsb
|
||||||
or al,al
|
or al,al
|
||||||
jz fin
|
jz fin
|
||||||
mov ah,0Eh
|
mov ah,0Eh
|
||||||
mov bx,07h
|
mov bx,07h
|
||||||
int 10h
|
int 10h
|
||||||
jmp again
|
jmp again
|
||||||
fin:
|
fin:
|
||||||
pop si bx ax
|
pop si bx ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
db 055h,0AAh
|
db 055h,0AAh
|
||||||
|
|
||||||
Buffer equ $
|
endof:
|
||||||
BufferFat equ $+2048
|
|
||||||
|
|
||||||
boots ends
|
buffer equ offset endof+2048
|
||||||
end start
|
bufferfat equ offset endof+4096
|
||||||
|
|
||||||
|
|
1207
noyau/mcb.asm
1207
noyau/mcb.asm
File diff suppressed because it is too large
Load Diff
1317
noyau/video.asm
1317
noyau/video.asm
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue