Added scripts for debug

git-svn-id: https://spexeah.com:8443/svn/Asuro@24 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-05-16 13:27:16 +00:00
parent 85f0849123
commit 2ce7ccc265
14 changed files with 35 additions and 10 deletions

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

View File

@ -19,9 +19,18 @@ fi
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Pi386 -Tlinux -FElib/ src/kernel.pas
if [ "$1" = "-d" ]
then
echo "Compiling Debug FPC Sources..."
echo " "
fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Pi386 -Tlinux -FElib/ src/kernel.pas
else
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Pi386 -Tlinux -FElib/ src/kernel.pas
fi
if [ $? -ne 0 ]
then
echo "Failed to compile FPC Sources!"

View File

@ -3,5 +3,10 @@ ERRCOUNT=0
echo "======================="
echo "== ASURO =="
echo "======================="
./compile.sh
if [ "%1" == "-d"]
then
./compile.sh -d
else
./compile.sh
fi
./run.sh

2
compile_and_run_debug.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
./compile_and_run.sh -d

2
compile_debug.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
./compile.sh -d

Binary file not shown.

BIN
lib/gdt.ppu Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/types.ppu Normal file

Binary file not shown.

View File

@ -4,7 +4,8 @@ interface
uses
util,
types;
types,
console;
procedure create(base : dword; limit : dword; flags : byte);
procedure init();
@ -22,7 +23,7 @@ type
implementation
var
GDTarr : array [0..5] of TSegmentDescriptor;
GDTarr : array [0..2] of TSegmentDescriptor;
GDTptr : PSegmentDescriptor;
GDT_length : integer = 0;
@ -38,19 +39,19 @@ begin
descriptor_ptr:= @descriptor[0];
s_descriptor_ptr:= @s_descriptor;
if limit <= 65536 then begin
descriptor[6] := $40 //1 <-- Will be overwritten by 2.
descriptor[6] := $40;
end else begin
if (limit and $FFF) <> $FFF then begin
limit := (limit SHR 12) - 1;
end else begin
limit := limit SHR 12;
end;
descriptor[6] := $C0; //2 <-- Will be overwritten by 3;
descriptor[6] := $C0;
end;
descriptor[0] := limit and $FF;
descriptor[1] := (limit shr 8) and $FF;
descriptor[6] := descriptor[6] or ((limit shr 16) and $F); //3 <-- has now overwritten both $C0 and $40 is now equal to limit or'd with limit shifted right 16 bits and constant $0F
descriptor[6] := descriptor[6] or ((limit shr 16) and $F);
descriptor[2] := base and $FF;
descriptor[3] := (base shr 8) and $FF;

View File

@ -19,11 +19,12 @@ var
c : byte;
mbi : Pmultiboot_info_t;
mbm : DWORD;
dds : DWORD;
begin
mbi:= mbinfo;
mbm:= mbmagic;
gdt.init();
//gdt.init();
console.init();
console.writestringln('Booting Asuro...');
if (mbm <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
@ -33,6 +34,11 @@ begin
util.halt_and_catch_fire;
end;
console.clear();
asm
MOV dds, DS
end;
console.writehexln(dds);
util.halt_and_catch_fire;
console.setdefaultattribute(console.combinecolors(Green, Black));
console.writestringln('Asuro Booted Correctly!');
console.writestringln('');