feat: conversion des makefiles, conversion des sources vers FASM. Dossier boot opérationnel

BREAKING CHANGE: passage sous linux
This commit is contained in:
Nicolas Hordé 2019-07-05 19:44:28 +02:00
parent b8248c75a2
commit 6b14100dc5
94 changed files with 353 additions and 3485 deletions

View File

@ -1,59 +0,0 @@
all:
cd lib
make
cd ..
cd noyau
make
cd ..
cd install
make
cd ..
cd commande
make
cd ..
cd programs
make
cd ..
install:
if not exist data mkdir data
copy noyau\systeme.sys data
copy noyau\boot.bin data
copy commande\commande.ce data
copy lib\*.lib data
copy programs\*.ce data
copy programs\exem-lib.lib data
copy programs\cos.rip data
copy install\setup.com .
copy: clean all
copy noyau\systeme.sys b:
copy commande\*.ce b:
copy lib\*.lib b:
copy programs\*.ce b:
copy programs\*.lib b:
clean:
cd lib
make clean
cd ..
cd noyau
make clean
cd ..
cd install
make clean
cd ..
cd commande
make clean
cd ..
cd programs
make clean
cd ..

View File

@ -1,9 +1,5 @@
model tiny,stdcall
p486
locals
jumps
codeseg
option procalign:byte
use16
align 1
include "..\include\mem.h"
include "..\include\fat.h"
@ -13,7 +9,7 @@ org 7C00h
jmp boot
bootsec bootinfo <"COS2000A",512,1,1,2,224,2880,0F0h,9,18,2,0,0,0,0,0,29h,01020304h,"COS2000 ","FAT12 ">
bootsec bootinfo "COS2000A","COS2000 ","FAT12 "
errorloading db " [Erreur]",0dh,0ah,0
okloading db "Recherche noyau ",0Dh,0ah," -"
@ -21,10 +17,8 @@ sys db "SYSTEME SYS",0
syst db " [ Ok ]",0dh,0ah,"Chargement ",0
dot db ".",0
errorboot:
mov si,offset errorloading
mov si,errorloading
call showstr
mov ah,0
int 16h
@ -46,14 +40,14 @@ boot2:
mov dl,[bootsec.bootdrive]
int 13h
jc errorboot
mov si,offset okloading
mov si,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
mov di,bufferfat
readfat:
call readsector
jc errorboot
@ -72,24 +66,24 @@ readfat:
div [bootsec.sectorsize]
add ax,cx
sub ax,2
mov [word ptr bootsec.reservedfornt],ax
mov word [bootsec.reservedfornt],ax
xor dx,dx
checkroot:
mov di,offset buffer
mov di,buffer
call readsector
jc errorboot
xor bx,bx
findnext:
cmp [byte ptr di],0
cmp byte [di],0
je errorboot
cmp [byte ptr di],0E5h
cmp byte [di],0E5h
je no
cmp [byte ptr di],041h
cmp byte [di],041h
je no
mov si,offset dot
mov si,dot
call showstr
push di cx
mov si,offset sys
mov si,sys
mov cx,11
rep cmpsb
pop cx di
@ -105,7 +99,7 @@ no:
inc cx
jmp checkroot
oksystem:
mov si,offset syst
mov si,syst
call showstr
mov cx,[di+26]
mov ax,8000h
@ -113,13 +107,13 @@ oksystem:
push es
mov di,0000h
push 0010h
mov si,offset dot
mov si,dot
xor ax,ax
fatagain:
cmp cx,0FF0h
jae finishload
push cx
add cx,[word ptr bootsec.reservedfornt]
add cx,word [bootsec.reservedfornt]
call readsector
pop cx
jc errorboot
@ -167,7 +161,7 @@ done:
getfat:
push ax bx dx di
mov di,offset bufferfat
mov di,bufferfat
mov ax,cx
mov bx,ax
and bx,0000000000000001b
@ -206,11 +200,13 @@ fin:
pop si bx ax
ret
rb 7C00h+512-2-$
db 055h,0AAh
endof:
buffer equ offset endof+2048
bufferfat equ offset endof+4096
buffer:
rb 7C00h+512+2048-$
bufferfat:
rb 7C00h+512+4096-$

BIN
boot/boot12.bin Normal file

Binary file not shown.

10
boot/makefile Normal file
View File

@ -0,0 +1,10 @@
ASM=fasm
CLEAN=rm -rf
all: boot12.bin
boot12.bin: boot12.asm
$(ASM) $<
clean:
$(CLEAN) *.bin

View File

@ -1,20 +0,0 @@
asm= lzasm /z/t
lnk= elink
all: commande.ce
commande.ce: commande.obj
$(lnk) commande.obj commande.ce
commande.obj: commande.asm
$(asm) commande.asm
clean:
del *.obj
del *.ce
del *.bak
del *.lib
del *.com
del *.bin
del *.sys
del *.err

View File

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

View File

@ -1,27 +0,0 @@
[bits 16] ;16 bits
[org 0x0] ;Point d'entré en 0h
section .text ;Segment de code
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 imported ;exportation de fonctions
sections dw 0 ;sections des blocs mémoire
starting dw realstart
imported:
db "VIDEO.LIB::print",0
print dd 0
endofimport dd 0
realstart:
push msg
call far [cs:print] ;Afficher le texte (Showstring0)
xor ax,ax
int 0x16 ;Attendre l'appuie sur une touche
retf ;retour far
msg db 'Hello World !!',0

View File

@ -1,31 +0,0 @@
.model tiny ;model tiny (.com)
.486 ;Pour processeur 80486
Smart ;Optimisations
.code ;Segment de code
org 0h ;Point d'entré en 0h
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 imported ;exportation de fonctions
sections dw 0 ;sections des blocs mémoire
starting dw realstart
imported:
db "VIDEO.LIB::print",0
print dd 0
start:
push msg
call far [cs:print] ;Afficher le texte (Showstring0)
xor ax,ax
int 16h ;Attendre l'appuie sur une touche
db 0CBH ;retour far
msg db 'Hello World !!',0
end start

18
final/makefile Normal file
View File

@ -0,0 +1,18 @@
all: cos2000.img
cos2000.img:
(dd if=/dev/zero of=cos2000.img count=2880 bs=512)
(mkfs.msdos -F 12 -n "COS2000" cos2000.img)
(fusefat cos2000.img ./mnt -o rw+)
(cp ../noyau/systeme.sys ./mnt/)
(cp ../noyau/systeme.ini ./mnt/)
(cp ../programs/*.ce ./mnt/)
(cp ../programs/*.lib ./mnt/)
(cp ../programs/*.rip ./mnt/)
(cp ../lib/*.lib ./mnt/)
(cp ../system/system.sys ./mnt/;sync)
(fusermount ./mnt -u)
(dd if=../boot/boot12.bin of=cos2000.img seek=0 count=1 conv=notrunc;sync)
clean:
rm -f *.img

View File

@ -1,67 +1,72 @@
struc diskbuffer
size dw 12
current dw 0FFFFh
chain dw 128 dup (0FFFFh)
ends diskbuffer
{
.size dw 12
.current dw 0FFFFh
.chain dw 128 dup (0FFFFh)
}
struc dpt
steprate&headunload db 0DFh ;Vitesse de progression & monte 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 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
{
.steprateheadunload db 0DFh ;Vitesse de progression & montee de la tete
.dmaflagheadload db 002h ;Etat Dma et temps de descente de la tete
.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
}
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
{
.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
}
;Pour recherches
struct find
files db 13 dup (0) ;le fichier
entryplace dw 0 ;En octet
adressdirectory dw 0 ;En cluster
firstsearch db 1 ;Premiere requete ?
result entries <>
ends find
struc find
{
.files db 13 dup (0) ;le fichier
.entryplace dw 0 ;En octet
.adressdirectory dw 0 ;En cluster
.firstsearch db 1 ;Premiere requete ?
.result entries <>
}
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 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
ends bootinfo
struc bootinfo vendor,drivename,serialnumber
{
.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 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 'FAT12 ' ;FAT
}

View File

@ -1,132 +1,143 @@
struc regs
seip dd 0
seax dd 0
sebx dd 0
secx dd 0
sedx dd 0
sesi dd 0
sedi dd 0
sebp dd 0
sesp dd 0
scs dw 0
sds dw 0
ses dw 0
sfs dw 0
sgs dw 0
sss dw 0
seflags dd 0
;sst0 dt 0
;sst1 dt 0
;sst2 dt 0
;sst3 dt 0
;sst4 dt 0
;sst5 dt 0
;sst6 dt 0
;sst7 dt 0
ends regs
{
.seip dd 0
.seax dd 0
.sebx dd 0
.secx dd 0
.sedx dd 0
.sesi dd 0
.sedi dd 0
.sebp dd 0
.sesp dd 0
.scs dw 0
.sds dw 0
.ses dw 0
.sfs dw 0
.sgs dw 0
.sss dw 0
;.seflags dd 0
;.sst0 dt 0
;;sst1 dt 0
;.sst2 dt 0
;.sst3 dt 0
;.sst4 dt 0
;.sst5 dt 0
;.sst6 dt 0
;.sst7 dt 0
}
struc tuple ;vecteur d'interruption
off dw 0 ;adresse
seg dw 0 ;segment
ends tuple
struc tuple
{
.off dw 0 ;adresse
.seg dw 0 ;segment
}
union vector
data tuple <>
content dd 0
ends
;union vector
;{
;.data tuple 0,0
;.content dd 0
;}
struc ints ;bloc interruption
number db 0 ;numero de l'interruption
activated db 0 ;activé ou non
locked db 0 ;verrouillée
launchedlow dd 0
launchedhigh dd 0
calledlow dd 0
calledhigh dd 0
vector1 vector ?
vector2 vector ?
vector3 vector ?
vector4 vector ?
vector5 vector ?
vector6 vector ?
vector7 vector ?
vector8 vector ?
ends ints
struc ints ;bloc interruption
{
.number db 0 ;numero de l'interruption
.activated db 0 ;activé ou non
.locked db 0 ;verrouillée
.launchedlow dd 0
.launchedhigh dd 0
.calledlow dd 0
.calledhigh dd 0
.vector1 vector ?
.vector2 vector ?
.vector3 vector ?
.vector4 vector ?
.vector5 vector ?
.vector6 vector ?
.vector7 vector ?
.vector8 vector ?
}
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
{
.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
}
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
{
.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
}
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
{
.limit_low dw 0
.base_low dw 0
.base_middle db 0
.dpltype db 0
.limit_high db 0
.base_high db 0
}
free equ 0 ;Reference quand libre
macro exporting
label exports
endm
{
exports:
}
macro importing
label imports
endm
{
imports:
}
macro noimporting
label imports
{
imports:
dd 0
endm
}
macro noexporting
label imports
{
imports:
dd 0
endm
}
macro ende
{
dd 0
endm
}
macro endi
{
dd 0
endm
}
macro use lib:req,fonction:req
macro use lib*,fonction*
{
db "&lib&::&fonction&",0
label &fonction& dword
fonction:
dd 0
dd 0
endm
}
macro declare fonction:req
macro declare fonction*
{
db "&fonction&",0
dw offset fonction
endm
dw fonction
}
macro heading versmaj:req,versmin:req,start:req
header exe <"CE",offset &versmaj&,offset &versmin&,0,offset exports,offset imports,0,offset &start&>
db "&fonction&",0
dw offset fonction
endif
endm
macro heading versmaj*,versmin*,start*
{
header exe "CE",versmaj,versmin,0,exports,imports,0,start
}

View File

@ -1,20 +0,0 @@
asm= lzasm /z/t
lnk= elink
all: setup.com
setup.com: setup.obj
$(lnk) setup.obj setup.com /c
setup.obj:
$(asm) setup.asm
clean:
del *.obj
del *.exe
del *.bak
del *.lib
del *.com
del *.bin
del *.sys
del *.err

View File

@ -1,164 +0,0 @@
model tiny,stdcall
p486
locals
jumps
codeseg
option procalign:byte
org 0100h
ent equ 32h
jmp copycos
message db 0Dh,0Ah,'COS 2000 V1.4Fr 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
retu db 0Dh,0AH,'$'
dta db 43 dup (0)
copycos:
mov ah,9
mov dx,offset message
int 21h
xor ax,ax
int 16h
mov ah,4ah
mov bx,1000h
int 21h
jc error
mov ah,48h
mov bx,65536/16
int 21h
jc error
mov fs,ax
mov ah,3Bh
mov dx,offset dat
int 21h
jc error
mov ah,1Ah
mov dx,offset dta
int 21h
jc error
mov ah,4eh
xor cx,cx
mov dx,offset files
int 21h
jc error
mov ah,09
mov dx,offset message3
int 21h
allfile:
mov [byte ptr offset dta+43],'$'
mov ah,9
mov dx,offset dta+30
int 21h
push dx
mov ah,09
mov dx,offset retu
int 21h
pop dx
mov ax,3D00h
int 21h
jc error
mov bx,ax
mov ax,4202h
xor cx,cx
xor dx,dx
int 21h
jc error
cmp dx,0
jne error
cmp ax,0
je error
mov bp,ax
mov ax,4200h
xor cx,cx
xor dx,dx
int 21h
jc error
push fs
pop ds
mov ah,3fh
mov cx,0FFFFh
xor dx,dx
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
mov ah,3ch
push cs
pop es
mov di,offset dta+30-3
mov [word ptr di],":a"
mov [byte ptr di+2],"\"
xor cx,cx
mov dx,di
int 21h
jc error
mov bx,ax
push fs
pop ds
xor dx,dx
mov ah,40h
mov cx,bp
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
mov ah,4fh
int 21h
jnc allfile
mov ah,09
mov dx,offset message2
int 21h
mov ax,3D00h
mov dx,offset boot
int 21h
jc error
push fs
pop ds
mov ah,3fh
mov cx,0FFFFh
xor dx,dx
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
push fs
pop es
mov ax,0301h
mov dx,0
mov cx,0001h
xor bx,bx
int 13h
mov ah,09
mov dx,offset ok
int 21h
xor ax,ax
int 16h
ret
error:
mov ah,09
mov dx,offset errormsg
int 21h
xor ax,ax
int 16h
ret

Binary file not shown.

View File

@ -1,121 +0,0 @@
<?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

@ -1,33 +0,0 @@
//---------------------------------------------------------------------------
#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;
}
//---------------------------------------------------------------------------

Binary file not shown.

Binary file not shown.

View File

@ -1,166 +0,0 @@
//---------------------------------------------------------------------------
#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();
}
//---------------------------------------------------------------------------

Binary file not shown.

View File

@ -1,184 +0,0 @@
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

View File

@ -1,47 +0,0 @@
//---------------------------------------------------------------------------
#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

View File

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

View File

@ -1,120 +0,0 @@
<?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>

Binary file not shown.

Binary file not shown.

View File

@ -1,135 +0,0 @@
//---------------------------------------------------------------------------
#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;
}
//---------------------------------------------------------------------------

47
makefile Normal file
View File

@ -0,0 +1,47 @@
all: boot/boot12.bin lib/3d.lib noyau/systeme.sys commande.ce
sync
install:
(sudo apt-get install yasm qemu fusefat cgdb)
clean:
make -C final clean
make -C lib clean
make -C noyau clean
make -C programs clean
sync
backup: clean
(tar cf - . | gzip -f - > ../backup.tar.gz)
copy:
make -C final
test: all copy qemu
view:
(hexdump -C ./final/cos2000.img|head -c10000)
debug-boot: all copy qemu-debug
(sleep 2;cgdb -x ./debug/boot.txt)
debug-loader: all copy qemu-debug
(sleep 2;cgdb -x ./debug/loader.txt)
debug-system: all copy qemu-debug
(sleep 2;cgdb -x ./debug/system.txt)
qemu-debug:
(qemu-system-i386 -m 1G -fda ./final/cos2000.img -s -S &)
qemu:
(qemu-system-i386 -m 1G -fda ./final/cos2000.img -s)
noyau/systeme.sys:
make -C noyau
boot/boot12.bin:
make -C boot
lib/3d.lib:
make -C lib

View File

@ -1,38 +0,0 @@
asm= lzasm /z/t
lnk= elink
all: systeme.sys boot.bin
systeme.sys: video.obj disque.obj systeme.obj
$(lnk) systeme.obj systeme.sys
systeme.obj: ..\lib\detect.lib ..\lib\video.lib video.sys disque.sys
$(asm) systeme.asm
disque.sys:
$(lnk) disque.obj disque.sys
video.sys:
$(lnk) video.obj video.sys
boot.bin: boot.obj
$(lnk) boot.obj boot.bin /bs
video.obj:
$(asm) video.asm
disque.obj:
$(asm) disque.asm
boot.obj:
$(asm) boot.asm
clean:
del *.obj
del *.exe
del *.bak
del *.lib
del *.com
del *.bin
del *.sys
del *.err

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

83
noyau/makefile Normal file
View File

@ -0,0 +1,83 @@
GCC=gcc -O0 -g -nostdinc -ffreestanding -fno-builtin -Wall -w -I ../include -m32 -fno-pie -no-pie -c -o
ASM=gcc -nostdinc -ffreestanding -fno-builtin -m32 -c -fno-pie -no-pie -I ../include -D__ASSEMBLY__ -c -o
LINK=ld -m elf_i386 -n
CONVERT=dos2unix
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
REMOVE=rm -f
CHANGEPERM=chmod 644
NM=nm
OBJCOPY=objcopy -O binary -R .note -R .comment -S
OBJDEBUG=objcopy --only-keep-debug
ZOFFSET=sed -n -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p'
VOFFSET=sed -n -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|__bss_start\|_end\)$$/\#define VO_\2 _AC(0x\1,UL)/p'
COMP=gzip -9 -f
BUILD=../tools/build
MKPIGGY=../tools/mkpiggy
all: system.sys
system.sys: piggy.o voffset.h zoffset.h realmode/setup.bin
$(BUILD) realmode/setup.bin system.bin zoffset.h system.sys
sync
allpiggy.o: piggy.o decompress.o header.o
$(LINK) -T allpiggy piggy.o decompress.o header.o
voffset.h: system
$(NM) system|$(VOFFSET)>voffset.h
zoffset.h: piggy.o
$(NM) piggy.o|$(ZOFFSET)>zoffset.h
togit: clean indent
piggy.o: piggy.S
$(ASM) $@ $^
system: system.o system_asm.o ../lib/libs.o
$(LINK) -T system.ld system.o system_asm.o ../lib/libs.o
$(OBJDEBUG) system system.sym
$(NM) system > system.map
system.bin: system
$(OBJCOPY) $^ $@
system.bin.gz: system.bin
cat $^|$(COMP) > $@
piggy.S: system.bin.gz
$(MKPIGGY) $^ > $@
realmode/setup.bin:
make -C realmode
system.o: system.c
$(GCC) $@ $^
system_asm.o: system_asm.S
$(ASM) $@ $^
clean:
make -C realmode clean
$(REMOVE) system
$(REMOVE) piggy.S
$(REMOVE) *.o
$(REMOVE) *.tmp
$(REMOVE) *.sym
$(REMOVE) *.map
$(REMOVE) *.gz
$(REMOVE) *.h
$(REMOVE) *.out
$(REMOVE) *.bin
$(REMOVE) *.sys
$(REMOVE) *.s
$(REMOVE) *.c~
sync
indent:
make -C realmode indent
$(CHANGEPERM) *.c
$(CONVERT) *.c
$(INDENT) *.c
$(REMOVE) *.c~
sync

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -1,139 +0,0 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="Project1.exe"/>
<OBJFILES value="Project1.obj Unit1.obj"/>
<RESFILES value="Project1.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
ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi teedb.bpi
tee.bpi vcldbx.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 OpenGLPanel_DP.bpi IcsBcb60.bpi ZComponent.bpi
ZPlain.bpi ZCore.bpi ZDbc.bpi ZParseSql.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="Project1.cpp"/>
<INCLUDEPATH value="D:\CBuilder6\Bin;&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="D:\CBuilder6\Bin;&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-ID:\CBuilder6\Bin
-I&quot;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer&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 -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="Project1.res" FORMNAME="" UNITNAME="Project1.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Project1.cpp" FORMNAME="" UNITNAME="Project1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="Form1" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
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=COS2000
FileDescription=Cos2000 lib explorer
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=Cos2000 lib explorer
ProductVersion=1.0.0.0
Comments=FOR CE ONLY
[Excluded Packages]
..\lib\DragDrop_B5.bpl=(untitled)
..\lib\Moje_B5.bpl=(untitled)
..\lib\DriveDir_B5.bpl=(untitled)
..\lib\tb2k_cb6.bpl=(untitled)
..\lib\tb2kdsgn_cb6.bpl=(untitled)
..\lib\tbx_cb6.bpl=(untitled)
..\lib\tbxdsgn_cb6.bpl=(untitled)
d:\cbuilder6\Bin\dclite60.bpl=Borland Integrated Translation Environment
[HistoryLists\hlIncludePath]
Count=1
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=1
Item0=D:\CBuilder6\Bin;C:\Documents and Settings\admin\Bureau\perso\cos\CE explorer;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[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
</IDEOPTIONS>
</PROJECT>

View File

@ -1,34 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "CE explorer";
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;
}
//---------------------------------------------------------------------------

Binary file not shown.

Binary file not shown.

View File

@ -1,273 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include <math.h>
#include <stdio.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
tree(AnsiString file,int offset,TTreeNode* rootnode)
{
FILE* in;
#pragma option -a1
struct CE {
char checks[2];
unsigned char major;
unsigned int checksum;
unsigned char compressed;
unsigned short exports;
unsigned short imports;
unsigned short sections;
unsigned short starting;
} myce;
#pragma option -a
long pointeur=0;
if ((in = fopen(file.c_str(), "rb"))!= NULL)
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&myce, sizeof(myce), 1, in);
TTreeNode* currentnode;
TTreeNode* subcurrentnode;
TTreeNode* subsubcurrentnode;
if (offset==0)
{
fseek(in, 0L, SEEK_END);
Form1->TreeView->Items->AddChild(rootnode,"Adresse réelle: 0x0000")->ImageIndex=31;
Form1->TreeView->Items->AddChild(rootnode,"Adresse : 0x0000")->ImageIndex=31;
}
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Entête");
currentnode->ImageIndex=10;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
if (AnsiString(myce.checks,2)!="CE")
{
rootnode->ImageIndex=4;
Form1->TreeView->Items->AddChild(currentnode,"Type : ceci n'est pas un fichier CE")->ImageIndex=1;
}
else
{
rootnode->ImageIndex=2;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Type : "+AnsiString(myce.checks,2));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)0+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)0,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Version : "+IntToStr(myce.major));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)2+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)2,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Checksum : 0x"+IntToHex((int)myce.checksum,8));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)3+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)3,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0004")->ImageIndex=31;
if (myce.compressed>=1)
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier compressé avec RIP");
else
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Fichier sans compression");
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)7+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)7,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0001")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur exportation : 0x"+IntToHex(myce.exports,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)8+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)8,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur Importation : 0x"+IntToHex(myce.imports,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)10+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)10,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Pointeur sections : 0x"+IntToHex(myce.sections,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)12+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)12,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,"Point d'entrée : 0x"+IntToHex(myce.starting,4));
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex((int)14+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex((int)14,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille: 0x0002")->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x0010")->ImageIndex=31;
char imported[30];
AnsiString imports[30]={""};
AnsiString exports[30]={""};
AnsiString sections[30]={""};
unsigned short iaddrs[30]={0};
unsigned short eaddrs[30]={0};
unsigned short saddrs[30]={0};
unsigned short ssize[30]={0};
AnsiString libraries[30]={""};
AnsiString alib;
int i=0;
pointeur=myce.imports;
int nblib=0;
int nbimp=0;
if (myce.imports!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Importations");
currentnode->ImageIndex=14;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
imports[i]=AnsiString((char*)&imported);
iaddrs[i]=pointeur;
pointeur+=imports[i].Length()+5;
alib=imports[i].SubString(0,imports[i].Pos(":")-1);
int j;
for(j=0;(j<nblib)&&(alib!=libraries[j])&&(libraries[j]!="");j++);
if ((libraries[j]=="")&&(alib!="")) {
libraries[j]=alib;
nblib++;
}
i++;
} while(imports[i-1]!="");
nbimp=i-1;
for(int i=0;i<nblib;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,libraries[i]);
subcurrentnode->ImageIndex=13;
for(int j=0;j<nbimp;j++)
{
if (imports[j].SubString(0,imports[j].Pos(":")-1)==libraries[i])
{
subsubcurrentnode=Form1->TreeView->Items->AddChild(subcurrentnode,imports[j].SubString(imports[j].Pos(":")+2,255));
subsubcurrentnode->ImageIndex=3;
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse réelle: 0x"+IntToHex((int)iaddrs[j]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subsubcurrentnode,"Adresse : 0x"+IntToHex((int)iaddrs[j],4))->ImageIndex=31;
}
}
}
currentnode->Text="importations ("+IntToStr(nbimp)+"/"+IntToStr(nblib)+")";
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.imports,4))->ImageIndex=31;
}
else
{
nbimp=0;
}
i=0;
pointeur=myce.exports;
int nbexp=0;
if (myce.exports!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Exportations");
currentnode->ImageIndex=14;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
exports[i]=AnsiString((char*)&imported);
pointeur+=exports[i].Length()+1;
fseek(in, pointeur+offset, SEEK_SET);
fread(&eaddrs[i],sizeof(eaddrs[i]),1,in);
pointeur+=2;
i++;
} while(exports[i-1]!="");
nbexp=i-1;
for(int i=0;i<nbexp;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,exports[i]);
subcurrentnode->ImageIndex=3;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(eaddrs[i]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(eaddrs[i],4))->ImageIndex=31;
}
currentnode->Text="exportations ("+IntToStr(nbexp)+")";
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.exports,4))->ImageIndex=31;
}
else
{
nbexp=0;
}
pointeur=myce.sections;
i=0;
int nbsec=0;
if (myce.sections!=0)
{
currentnode=Form1->TreeView->Items->AddChild(rootnode,"Sections");
currentnode->ImageIndex=12;
Form1->TreeView->Items->AddChild(currentnode,"Adresse réelle: 0x"+IntToHex((int)pointeur+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(currentnode,"Adresse : 0x"+IntToHex((int)pointeur,4))->ImageIndex=31;
do
{
fseek(in, pointeur+offset, SEEK_SET);
fread(&saddrs[i],sizeof(saddrs[i]),1,in);
pointeur+=2;
fseek(in, pointeur+offset, SEEK_SET);
fread(&ssize[i],sizeof(ssize[i]),1,in);
pointeur+=2;
fseek(in, pointeur+offset, SEEK_SET);
fread(&imported, sizeof(imported), 1, in);
sections[i]=AnsiString((char*)&imported);
pointeur+=sections[i].Length()+1;
i++;
} while(ssize[i-1]!=0);
nbsec=i-1;
for(int i=0;i<nbsec;i++)
{
subcurrentnode=Form1->TreeView->Items->AddChild(currentnode,sections[i]);
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse réelle: 0x"+IntToHex(saddrs[i]+offset,4))->ImageIndex=31;
Form1->TreeView->Items->AddChild(subcurrentnode,"Adresse : 0x"+IntToHex(saddrs[i],4))->ImageIndex=31;
if (saddrs[i]!=0) tree(file,saddrs[i],subcurrentnode);
subcurrentnode->ImageIndex=2;
Form1->TreeView->Items->AddChild(subcurrentnode,"Taille : 0x"+IntToHex(ssize[i],4))->ImageIndex=31;
}
Form1->TreeView->Items->AddChild(currentnode,"Taille : 0x"+IntToHex((int)pointeur-myce.sections,4))->ImageIndex=31;
currentnode->Text="Sections ("+IntToStr(nbsec)+")";
}
else
{
nbsec=0;
}
if (offset==0)
{
fseek(in, 0L, SEEK_END);
int size = ftell(in);
Form1->TreeView->Items->AddChild(rootnode,"Taille : 0x"+IntToHex(size,4))->ImageIndex=31;
}
}
fclose(in);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ouvrir1Click(TObject *Sender)
{
if (OpenDialog->Execute())
tree(OpenDialog->FileName,0,Form1->TreeView->Items->Add(Form1->TreeView->Items->GetFirstNode(),ExtractFileName(OpenDialog->FileName)));
TTreeNode* node=Form1->TreeView->Items->GetFirstNode();
while(node!=NULL)
{
node->SelectedIndex=node->ImageIndex;
node=node->GetNext();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Quitter1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <Dialogs.hpp>
#include <ComCtrls.hpp>
#include <ImgList.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *Fichier1;
TMenuItem *Ouvrir1;
TOpenDialog *OpenDialog;
TTreeView *TreeView;
TImageList *ImageList;
TMenuItem *N1;
TMenuItem *Quitter1;
TRichEdit *RichEdit1;
void __fastcall Ouvrir1Click(TObject *Sender);
void __fastcall Quitter1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

View File

@ -1,108 +0,0 @@
net segment
org 0100h
assume cs:net,ds:net
start:
jmp deb
taille dw 0
signe db 'rip'
signe2 db 64 dup (0)
p1 db '@'
p2 db '@'
min db 4
deb:
mov BL,DS:[0080h]
xor BH,BH
or BX,BX
mov byte ptr [0081h+BX],00h
mov AX,3D02h
mov DX,0082H
int 21h
mov bx,ax
mov ah,3fh
mov cx,0ffffh
mov dx,offset data
int 21h
mov taille,ax
mov ah,3eh
int 21h
mov si,82h
mov di,offset signe2
mov cx,64
rep movsb
mov di,offset signe2
mov cx,64
mov al,2eh
repne scasb
push di
mov si,di
mov di,offset data
add di,taille
mov cx,3
rep movsb
mov ax,di
pop di
mov cx,3
mov si,offset signe
rep movsb
mov di,ax
mov cx,taille
mov si,offset data
mov dx,1
boucle:
lodsb
cmp al,[si]
jne pas
inc dl
loop boucle
jmp fin
pas:
cmp dl,min
jb suite
cmp dl,1
jne go
suite:
mov bx,cx
mov cx,dx
rep stosb
mov cx,bx
mov dl,1
loop boucle
jmp fin
go:
mov ah,al
mov al,p1
stosb
mov al,dl
stosb
mov al,ah
stosb
mov al,p2
stosb
mov dl,1
loop boucle
fin:
mov ah,3ch
mov cx,0
mov dx,offset signe2
int 21h
mov bx,ax
mov ah,40h
mov cx,di
sub cx,offset data
sub cx,taille
mov dx,offset data
add dx,taille
int 21h
mov ah,3eh
int 21h
mov ah,41h
mov dx,82h
int 21h
ret
data db 0
net ends
end start
net

View File

@ -1,88 +0,0 @@
net segment
org 0100h
assume cs:net,ds:net
start:
jmp deb
taille dw 0
signe2 db 64 dup (0)
p1 db '@'
p2 db '@'
deb:
mov BL,DS:[0080h]
xor BH,BH
or BX,BX
mov byte ptr [0081h+BX],00h
mov AX,3D02h
mov DX,0082H
int 21h
mov bx,ax
mov ah,3fh
mov cx,0ffffh
mov dx,offset data
int 21h
mov taille,ax
mov ah,3eh
int 21h
mov si,82h
mov di,offset signe2
mov cx,64
rep movsb
mov di,offset signe2
mov cx,64
mov al,2eh
repne scasb
mov si,offset data
mov cx,3
rep movsb
mov cx,taille
mov di,offset data
add di,taille
mov dx,1
boucle:
lodsb
cmp al,p1
je pas
suite:
stosb
loop boucle
jmp fin
pas:
mov al,p2
cmp [si+2],al
jne suite
lodsb
mov bx,cx
mov cl,al
xor ch,ch
lodsb
rep stosb
mov cx,bx
sub cx,3
inc si
loop boucle
fin:
mov ah,3ch
mov cx,0
mov dx,offset signe2
int 21h
mov bx,ax
mov ah,40h
mov cx,di
sub cx,offset data
sub cx,taille
mov dx,offset data
add dx,taille
int 21h
mov ah,3eh
int 21h
mov ah,41h
mov dx,82h
int 21h
ret
data db 0
net ends
end start
net