commit
a845b77632
29
MAKEFILE
29
MAKEFILE
|
@ -1,9 +1,5 @@
|
|||
all:
|
||||
cd commande
|
||||
make
|
||||
cd ..
|
||||
|
||||
cd programs
|
||||
cd lib
|
||||
make
|
||||
cd ..
|
||||
|
||||
|
@ -11,31 +7,16 @@ all:
|
|||
make
|
||||
cd ..
|
||||
|
||||
cd contribs
|
||||
make
|
||||
cd ..
|
||||
|
||||
cd install
|
||||
make
|
||||
cd ..
|
||||
|
||||
copy:
|
||||
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:
|
||||
cd commande
|
||||
make clean
|
||||
cd ..
|
||||
|
||||
cd programs
|
||||
cd lib
|
||||
make clean
|
||||
cd ..
|
||||
|
||||
|
@ -43,10 +24,6 @@ clean:
|
|||
make clean
|
||||
cd ..
|
||||
|
||||
cd contribs
|
||||
make clean
|
||||
cd ..
|
||||
|
||||
cd install
|
||||
make clean
|
||||
cd ..
|
||||
|
|
106
include/fat.h
106
include/fat.h
|
@ -1,58 +1,52 @@
|
|||
Free equ 0
|
||||
True equ 1
|
||||
False equ 0
|
||||
struc dpt
|
||||
steprate&headunload db 0DFh ;Vitesse de progression & mont‚e de la tˆte
|
||||
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
|
||||
StepRate&HeadUnload db 0DFh ;Vitesse de progression & mont‚e de la tˆte
|
||||
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
|
||||
DPT ends
|
||||
struc entries
|
||||
filename db 8 dup (0)
|
||||
filext db 3 dup (0)
|
||||
fileattr db 0
|
||||
filereserved db 0
|
||||
filetimecreams db 0 ;(*10 ms)
|
||||
filetimecrea dw 0
|
||||
filedatecrea dw 0
|
||||
filedateacc dw 0
|
||||
filenotused dw 0
|
||||
filetime dw 0
|
||||
filedate dw 0
|
||||
filegroup dw 0
|
||||
filesize dd 0
|
||||
ends entries
|
||||
|
||||
Entries Struc
|
||||
FileName db 8 dup (0)
|
||||
FilExt db 3 dup (0)
|
||||
FileAttr db 0
|
||||
FileReserved db 0
|
||||
FileTimeCreaMs db 0 ;(*10 ms)
|
||||
FileTimeCrea dw 0
|
||||
FileDateCrea dw 0
|
||||
FileDateAcc dw 0
|
||||
FileNotused dw 0
|
||||
FileTime dw 0
|
||||
FileDate dw 0
|
||||
FileGroup dw 0
|
||||
FileSize dd 0
|
||||
Entries Ends
|
||||
|
||||
BootSector Struc
|
||||
jumper db 0,0,0
|
||||
Vendor db 'COS2000A' ;Fabricant + n°série Formatage
|
||||
SectorSize dw 512 ;octet/secteur
|
||||
SectorsPerCluster db 1 ;secteur/cluster
|
||||
ReservedSectors dw 1 ;secteur reserv‚
|
||||
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
|
||||
struc bootinfo
|
||||
vendor db 'COS2000A' ;Fabricant + n°série Formatage
|
||||
sectorsize dw 512 ;octet/secteur
|
||||
sectorspercluster db 1 ;secteur/cluster
|
||||
reservedsectors dw 1 ;secteur reserv‚
|
||||
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
|
||||
mediadescriptor 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
|
||||
ends bootinfo
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
lnk_boot = tlink /x
|
||||
asm= tasm /t/m5/zi
|
||||
lnk= tlink /x/t
|
||||
asm= lzasm
|
||||
lnk= elink
|
||||
|
||||
all: setup.com
|
||||
|
||||
setup.com: setup.asm
|
||||
$(asm) setup
|
||||
$(lnk) setup
|
||||
setup.com: setup.obj
|
||||
$(lnk) setup.obj setup.com
|
||||
|
||||
setup.obj:
|
||||
$(asm) setup.asm
|
||||
|
||||
clean:
|
||||
del *.obj
|
||||
del *.exe
|
||||
del *.bak
|
||||
del *.lib
|
||||
del *.com
|
||||
del *.bin
|
||||
del *.sys
|
||||
del *.err
|
||||
del *.err
|
|
@ -1,20 +1,21 @@
|
|||
.model tiny
|
||||
.486
|
||||
smart
|
||||
.code
|
||||
model tiny,stdcall
|
||||
p486
|
||||
locals
|
||||
jumps
|
||||
codeseg
|
||||
option procalign:byte
|
||||
|
||||
org 0100h
|
||||
|
||||
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,'$'
|
||||
Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',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,'$'
|
||||
Ok db 0Dh,0AH,'COS2000 a ete correctement installe, veuillez redemarrer votre PC',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,'$'
|
||||
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,'$'
|
||||
ok db 0Dh,0AH,'COS2000 a ete correctement installe, veuillez redemarrer votre PC',0Dh,0AH,'$'
|
||||
files db '*.*',0
|
||||
boot db 'boot.bin',0
|
||||
dat db 'data',0
|
||||
|
@ -53,7 +54,7 @@ copycos:
|
|||
mov dx,offset message3
|
||||
int 21h
|
||||
allfile:
|
||||
mov byte ptr [offset dta+43],'$'
|
||||
mov [byte ptr offset dta+43],'$'
|
||||
mov ah,9
|
||||
mov dx,offset dta+30
|
||||
int 21h
|
||||
|
@ -97,8 +98,8 @@ allfile:
|
|||
push cs
|
||||
pop es
|
||||
mov di,offset dta+30-3
|
||||
mov word ptr [di],":a"
|
||||
mov byte ptr [di+2],"\"
|
||||
mov [word ptr di],":a"
|
||||
mov [byte ptr di+2],"\"
|
||||
xor cx,cx
|
||||
mov dx,di
|
||||
int 21h
|
||||
|
@ -118,7 +119,7 @@ allfile:
|
|||
jc error
|
||||
mov ah,4fh
|
||||
int 21h
|
||||
jnc allfile
|
||||
jnc allfile
|
||||
mov ah,09
|
||||
mov dx,offset message2
|
||||
int 21h
|
||||
|
@ -146,7 +147,7 @@ allfile:
|
|||
xor bx,bx
|
||||
int 13h
|
||||
mov ah,09
|
||||
mov dx,offset Ok
|
||||
mov dx,offset ok
|
||||
int 21h
|
||||
xor ax,ax
|
||||
int 16h
|
||||
|
@ -160,5 +161,4 @@ error:
|
|||
xor ax,ax
|
||||
int 16h
|
||||
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
|
||||
MASTERPIC = 020h ;Adresse de base du PIC maŒtre
|
||||
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
|
||||
IRQMASK = 001h ;Offset sur port de masquage
|
||||
MASTERPIC = 020h ;Adresse de base du PIC maŒtre
|
||||
SLAVEPIC = 0A0h ;Adresse de base du PIC esclave
|
||||
IRQMASK = 001h ;Offset sur port de masquage
|
||||
|
||||
;Commandes IRQ OCW2
|
||||
DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique
|
||||
EOI = 020h ;End of Interrupt non sp‚cifi‚
|
||||
DISABLEROTATION = 000h ;Desactiver la rotation de priorités en mode EOI automatique
|
||||
EOI = 020h ;End of Interrupt non sp‚cifi‚
|
||||
COMMANDEOI = 060h ;Commande EOI particulière
|
||||
ENABLEROTATION = 080h ;Activer la rotation de 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é
|
||||
|
||||
;Position des vecteurs d'interruptions
|
||||
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
|
||||
SLAVEFIRSTVECTOR = 070h ;‚lectroniques
|
||||
MASTERFIRSTVECTOR = 008h ;Vecteurs logiciels des interruptions
|
||||
SLAVEFIRSTVECTOR = 070h ;‚lectroniques
|
||||
|
||||
;OCW3 codes registres
|
||||
IRR = 002h ;Interrupt Request Register
|
||||
ISR = 003h ;In Service Register
|
||||
;OCW3 et modes
|
||||
;OCW3 et modes
|
||||
OCW3 = 008h ;OCW3
|
||||
POLLING = 004h ;Polling bit
|
||||
|
||||
|
||||
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
|
||||
;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
|
||||
USES ax,cx,dx
|
||||
mov ax,[@irq]
|
||||
|
@ -86,11 +48,11 @@ EnableIRQ PROC FAR
|
|||
and al,ah
|
||||
out dx,al
|
||||
ret
|
||||
EnableIRQ endp
|
||||
endp enableirq
|
||||
|
||||
;Desactive une interruption ‚lectronique
|
||||
;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
|
||||
USES ax,cx,dx
|
||||
mov ax,[@irq]
|
||||
|
@ -109,11 +71,11 @@ DisableIRQ PROC FAR
|
|||
or al,ah
|
||||
out dx,al
|
||||
ret
|
||||
DisableIRQ endp
|
||||
endp disableirq
|
||||
|
||||
|
||||
;Signale "End Of Interrupt" de l'interruption %0
|
||||
SetEOI PROC FAR
|
||||
PROC seteoi FAR
|
||||
ARG @irq:word
|
||||
USES ax,dx
|
||||
mov ax,[@irq]
|
||||
|
@ -125,11 +87,11 @@ SetEOI PROC FAR
|
|||
mov al,EOI
|
||||
out MASTERPIC,al
|
||||
ret
|
||||
DisableIRQ endp
|
||||
endp seteoi
|
||||
|
||||
|
||||
;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
|
||||
USES bx,dx
|
||||
mov bx,[@controleur]
|
||||
|
@ -142,10 +104,10 @@ ReadmaskIrq PROC FAR
|
|||
in al,dx
|
||||
pop dx
|
||||
ret
|
||||
ReadmaskIrq endp
|
||||
endp readmaskirq
|
||||
|
||||
;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
|
||||
USES bx,dx
|
||||
mov bx,[@controleur]
|
||||
|
@ -154,16 +116,16 @@ ReadISR PROC FAR
|
|||
jne @@master
|
||||
mov dx,SLAVEPIC
|
||||
@@master:
|
||||
mov al,isr
|
||||
mov al,ISR
|
||||
out dx,al
|
||||
xor ah,ah
|
||||
in al,dx
|
||||
ret
|
||||
ReadISR endp
|
||||
endp readisr
|
||||
|
||||
|
||||
;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
|
||||
USES bx,dx
|
||||
mov bx,[@controleur]
|
||||
|
@ -172,74 +134,9 @@ ReadIRR PROC FAR
|
|||
jne @@master
|
||||
mov dx,SLAVEPIC
|
||||
@@master:
|
||||
mov al,irr
|
||||
mov al,IRR
|
||||
out dx,al
|
||||
xor ah,ah
|
||||
in al,dx
|
||||
ret
|
||||
ReadIRR endp
|
||||
|
||||
;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
|
||||
|
||||
endp readirr
|
|
@ -1,73 +1,36 @@
|
|||
lnk_boot = tlink /x
|
||||
asm= tasm /t/m5/zi
|
||||
lnk= tlink /x/t
|
||||
asm= lzasm
|
||||
lnk= elink
|
||||
|
||||
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
|
||||
$(asm) boot
|
||||
$(lnk_boot) boot
|
||||
exe2boot boot.exe boot.bin
|
||||
systeme.sys: video.obj systeme.obj
|
||||
$(lnk) systeme.obj systeme.sys
|
||||
|
||||
clavier.sys: clavier.asm
|
||||
$(asm) clavier
|
||||
$(lnk) clavier
|
||||
ren clavier.com clavier.sys
|
||||
systeme.obj: ../lib/detect.lib ../lib/video.lib video.sys
|
||||
$(asm) systeme.asm
|
||||
|
||||
8259a.sys: 8259a.asm
|
||||
$(asm) 8259a
|
||||
$(lnk) 8259a
|
||||
ren 8259a.com 8259a.sys
|
||||
|
||||
disque.sys: disque.asm
|
||||
$(asm) disque
|
||||
$(lnk) disque
|
||||
ren disque.com disque.sys
|
||||
video.sys:
|
||||
$(lnk) video.obj video.sys
|
||||
|
||||
heure.sys: heure.asm
|
||||
$(asm) heure
|
||||
$(lnk) heure
|
||||
ren heure.com heure.sys
|
||||
boot.bin: boot.obj
|
||||
$(lnk) boot.obj boot.bin /bs
|
||||
|
||||
horloge.sys: horloge.asm
|
||||
$(asm) horloge
|
||||
$(lnk) horloge
|
||||
ren horloge.com horloge.sys
|
||||
detect.obj:
|
||||
$(asm) detect.asm
|
||||
|
||||
manette.sys: manette.asm
|
||||
$(asm) manette
|
||||
$(lnk) manette
|
||||
ren manette.com manette.sys
|
||||
video.obj:
|
||||
$(asm) video.asm
|
||||
|
||||
port.sys: port.asm
|
||||
$(asm) port
|
||||
$(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
|
||||
boot.obj:
|
||||
$(asm) boot.asm
|
||||
|
||||
clean:
|
||||
del *.obj
|
||||
del *.exe
|
||||
del *.bak
|
||||
del *.lib
|
||||
del *.com
|
||||
del *.sys
|
||||
del *.err
|
||||
del *.bin
|
||||
del *.sys
|
||||
del *.err
|
348
noyau/boot.asm
348
noyau/boot.asm
|
@ -1,222 +1,216 @@
|
|||
boots segment
|
||||
.386
|
||||
org 7C00h
|
||||
assume cs:boots,ds:boots
|
||||
model tiny,stdcall
|
||||
p486
|
||||
locals
|
||||
jumps
|
||||
codeseg
|
||||
option procalign:byte
|
||||
|
||||
include "..\include\mem.h"
|
||||
include "..\include\fat.h"
|
||||
include "..\include\divers.h"
|
||||
|
||||
org 7C00h
|
||||
|
||||
start:
|
||||
jmp boot
|
||||
|
||||
bootdb db 'COS2000A' ;Fabricant + n°série Formatage
|
||||
sizec dw 512 ;octet/secteur
|
||||
db 1 ;secteur/cluster
|
||||
reserv dw 1 ;secteur reserv‚
|
||||
nbfat db 2 ;nb de copie de la FAT
|
||||
nbfit dw 224 ;taille rep racine
|
||||
allclu dw 2880 ;nb secteur du volume si < 32 még
|
||||
db 0F0h ;Descripteur de média
|
||||
fatsize dw 9 ;secteur/FAT
|
||||
nbtrack dw 18 ;secteur/piste
|
||||
head dw 2 ;nb de tˆteb de lecture/écriture
|
||||
hidden dd 0 ;nombre de secteur 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:
|
||||
bootsec bootinfo <"COS2000A",512,1,1,2,224,2880,0F0h,9,18,2,0,0,0,0,0,29h,01020304h,"COS2000 ","FAT12 ">
|
||||
|
||||
errorloading db " [Erreur]",0dh,0ah,0
|
||||
okloading db "Recherche noyau ",0Dh,0ah," -"
|
||||
sys db "SYSTEME SYS",0
|
||||
syst db " [ Ok ]",0dh,0ah,"Chargement ",0
|
||||
dot db ".",0
|
||||
|
||||
|
||||
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:
|
||||
mov si,offset errorloading
|
||||
call showstr
|
||||
mov ah,0
|
||||
int 16h
|
||||
int 19h
|
||||
boot:
|
||||
mov Bootdrv,dl
|
||||
cli
|
||||
mov ax,09000h
|
||||
mov ss,ax
|
||||
mov sp,0FFFFh
|
||||
sti
|
||||
mov si,offset errorloading
|
||||
call showstr
|
||||
mov ah,0
|
||||
int 16h
|
||||
int 19h
|
||||
|
||||
boot:
|
||||
mov [bootsec.bootdrive],dl
|
||||
cli
|
||||
mov ax,09000h
|
||||
mov ss,ax
|
||||
mov sp,0FFFFh
|
||||
sti
|
||||
boot2:
|
||||
push cs
|
||||
push cs
|
||||
pop es
|
||||
pop ds
|
||||
xor ax,ax
|
||||
int 13h
|
||||
jc errorboot
|
||||
mov si,offset okloading
|
||||
call showstr
|
||||
mov cx,Reserv
|
||||
add cx,word ptr [offset Hidden]
|
||||
adc cx,word ptr [offset Hidden+2]
|
||||
push cx
|
||||
mov bx,fatsize
|
||||
mov di,offset bufferfat
|
||||
push cs
|
||||
push cs
|
||||
pop es
|
||||
pop ds
|
||||
xor ax,ax
|
||||
mov dl,[bootsec.bootdrive]
|
||||
int 13h
|
||||
jc errorboot
|
||||
mov si,offset okloading
|
||||
call showstr
|
||||
mov cx,[bootsec.reservedsectors]
|
||||
add cx,[bootsec.hiddensectorsh]
|
||||
adc cx,[bootsec.hiddensectorsl]
|
||||
push cx
|
||||
mov bx,[bootsec.sectorsperfat]
|
||||
mov di,offset bufferfat
|
||||
readfat:
|
||||
call readsector
|
||||
inc cx
|
||||
add di,sizec
|
||||
dec bx
|
||||
jnz readfat
|
||||
pop cx
|
||||
xor ax,ax
|
||||
mov al,NbFat
|
||||
mov bx,FatSize
|
||||
mul bx
|
||||
add cx,ax
|
||||
mov ax,32
|
||||
mul nbfit
|
||||
div sizec
|
||||
add ax,cx
|
||||
sub ax,2
|
||||
mov word ptr [offset bootsig],ax
|
||||
xor dx,dx
|
||||
CheckRoot:
|
||||
mov di,offset buffer
|
||||
call readsector
|
||||
jc errorboot
|
||||
xor bx,bx
|
||||
call readsector
|
||||
jc errorboot
|
||||
inc cx
|
||||
add di,[bootsec.sectorsize]
|
||||
dec bx
|
||||
jnz readfat
|
||||
pop cx
|
||||
xor ax,ax
|
||||
mov al,[bootsec.fatsperdrive]
|
||||
mov bx,[bootsec.sectorsperfat]
|
||||
mul bx
|
||||
add cx,ax
|
||||
mov ax,32
|
||||
mul [bootsec.directorysize]
|
||||
div [bootsec.sectorsize]
|
||||
add ax,cx
|
||||
sub ax,2
|
||||
mov [word ptr bootsec.reservedfornt],ax
|
||||
xor dx,dx
|
||||
checkroot:
|
||||
mov di,offset buffer
|
||||
call readsector
|
||||
jc errorboot
|
||||
xor bx,bx
|
||||
findnext:
|
||||
cmp byte ptr [di],0
|
||||
je errorboot
|
||||
cmp byte ptr [di],0E5h
|
||||
je no
|
||||
cmp byte ptr [di],041h
|
||||
je no
|
||||
mov si,offset dot
|
||||
call showstr
|
||||
push di cx
|
||||
mov si,offset sys
|
||||
mov cx,11
|
||||
rep cmpsb
|
||||
pop cx di
|
||||
je oksystem
|
||||
cmp [byte ptr di],0
|
||||
je errorboot
|
||||
cmp [byte ptr di],0E5h
|
||||
je no
|
||||
cmp [byte ptr di],041h
|
||||
je no
|
||||
mov si,offset dot
|
||||
call showstr
|
||||
push di cx
|
||||
mov si,offset sys
|
||||
mov cx,11
|
||||
rep cmpsb
|
||||
pop cx di
|
||||
je oksystem
|
||||
no:
|
||||
add di,32
|
||||
add bx,32
|
||||
inc dx
|
||||
cmp dx,nbfit
|
||||
ja errorboot
|
||||
cmp bx,sizec
|
||||
jb findnext
|
||||
inc cx
|
||||
jmp Checkroot
|
||||
add di,32
|
||||
add bx,32
|
||||
inc dx
|
||||
cmp dx,[bootsec.directorysize]
|
||||
ja errorboot
|
||||
cmp bx,[bootsec.sectorsize]
|
||||
jb findnext
|
||||
inc cx
|
||||
jmp checkroot
|
||||
oksystem:
|
||||
mov si,offset syst
|
||||
call showstr
|
||||
mov cx,[di+26]
|
||||
mov ax,0900h
|
||||
mov es,ax
|
||||
push es
|
||||
mov di,000h
|
||||
push di
|
||||
mov si,offset dot
|
||||
xor ax,ax
|
||||
mov si,offset syst
|
||||
call showstr
|
||||
mov cx,[di+26]
|
||||
mov ax,0900h
|
||||
mov es,ax
|
||||
push es
|
||||
mov di,0000h
|
||||
push 0010h
|
||||
mov si,offset dot
|
||||
xor ax,ax
|
||||
fatagain:
|
||||
cmp cx,0FF0h
|
||||
jae finishload
|
||||
push cx
|
||||
add cx,word ptr [offset bootsig]
|
||||
call readsector
|
||||
pop cx
|
||||
jc errorboot
|
||||
cmp cx,0FF0h
|
||||
jae finishload
|
||||
push cx
|
||||
add cx,[word ptr bootsec.reservedfornt]
|
||||
call readsector
|
||||
pop cx
|
||||
jc errorboot
|
||||
inc ax
|
||||
call showstr
|
||||
add di,sizec
|
||||
call getfat
|
||||
jnc fatagain
|
||||
call showstr
|
||||
add di,[bootsec.sectorsize]
|
||||
call getfat
|
||||
jnc fatagain
|
||||
finishload:
|
||||
db 0CBh
|
||||
retf
|
||||
|
||||
;=============READSECTOR (Fonction 01H)===============
|
||||
;Lit le secteur CX et le met en es:di
|
||||
;-> AH=1
|
||||
;<- Flag Carry si erreur
|
||||
;=====================================================
|
||||
ReadSector:
|
||||
readsector:
|
||||
push ax bx cx dx si
|
||||
mov ax,cx
|
||||
xor dx,dx
|
||||
div nbtrack
|
||||
inc dl
|
||||
mov bl,dl
|
||||
xor dx,dx
|
||||
div head
|
||||
mov dh, 0
|
||||
xchg dl,dh
|
||||
mov cx,ax
|
||||
xchg cl,ch
|
||||
shl cl,6
|
||||
or cl, bl
|
||||
xor dx,dx
|
||||
div [bootsec.sectorspertrack]
|
||||
inc dl
|
||||
mov bl,dl
|
||||
xor dx,dx
|
||||
div [bootsec.headsperdrive]
|
||||
xchg dl,dh
|
||||
mov cx,ax
|
||||
xchg cl,ch
|
||||
shl cl,6
|
||||
or cl, bl
|
||||
mov bx,di
|
||||
mov SI, 4
|
||||
mov AL, 1
|
||||
TryAgain:
|
||||
mov AH, 2
|
||||
mov si, 4
|
||||
mov al, 1
|
||||
tryagain:
|
||||
mov ah, 2
|
||||
mov dl,[bootsec.bootdrive]
|
||||
int 13h
|
||||
jnc Done
|
||||
dec SI
|
||||
jnz TryAgain
|
||||
Done:
|
||||
jnc done
|
||||
dec si
|
||||
jnz tryagain
|
||||
done:
|
||||
pop si dx cx bx ax
|
||||
ret
|
||||
ret
|
||||
|
||||
|
||||
getfat:
|
||||
push ax bx dx di
|
||||
mov di,offset bufferfat
|
||||
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
|
||||
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
|
||||
and dx,0FFFh
|
||||
mov cx,dx
|
||||
jmp endfat
|
||||
evenfat:
|
||||
mov dx,[di+1]
|
||||
and dx,0FFF0h
|
||||
shr dx,4
|
||||
mov cx,dx
|
||||
mov dx,[di+1]
|
||||
and dx,0FFF0h
|
||||
shr dx,4
|
||||
mov cx,dx
|
||||
endfat:
|
||||
pop di dx bx ax
|
||||
pop di dx bx ax
|
||||
ret
|
||||
|
||||
|
||||
showstr:
|
||||
push ax bx si
|
||||
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
|
||||
or al,al
|
||||
jz fin
|
||||
mov ah,0Eh
|
||||
mov bx,07h
|
||||
int 10h
|
||||
jmp again
|
||||
fin:
|
||||
pop si bx ax
|
||||
ret
|
||||
|
||||
|
||||
db 055h,0AAh
|
||||
|
||||
Buffer equ $
|
||||
BufferFat equ $+2048
|
||||
endof:
|
||||
|
||||
boots ends
|
||||
end start
|
||||
buffer equ offset endof+2048
|
||||
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