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 "======================="
echo " " echo " "
echo "Compiling FPC Sources..."
echo " " if [ "$1" = "-d" ]
fpc -Aelf -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Pi386 -Tlinux -FElib/ src/kernel.pas 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 ] if [ $? -ne 0 ]
then then
echo "Failed to compile FPC Sources!" echo "Failed to compile FPC Sources!"

View File

@ -3,5 +3,10 @@ ERRCOUNT=0
echo "=======================" echo "======================="
echo "== ASURO ==" echo "== ASURO =="
echo "=======================" echo "======================="
./compile.sh if [ "%1" == "-d"]
then
./compile.sh -d
else
./compile.sh
fi
./run.sh ./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 uses
util, util,
types; types,
console;
procedure create(base : dword; limit : dword; flags : byte); procedure create(base : dword; limit : dword; flags : byte);
procedure init(); procedure init();
@ -22,7 +23,7 @@ type
implementation implementation
var var
GDTarr : array [0..5] of TSegmentDescriptor; GDTarr : array [0..2] of TSegmentDescriptor;
GDTptr : PSegmentDescriptor; GDTptr : PSegmentDescriptor;
GDT_length : integer = 0; GDT_length : integer = 0;
@ -38,19 +39,19 @@ begin
descriptor_ptr:= @descriptor[0]; descriptor_ptr:= @descriptor[0];
s_descriptor_ptr:= @s_descriptor; s_descriptor_ptr:= @s_descriptor;
if limit <= 65536 then begin if limit <= 65536 then begin
descriptor[6] := $40 //1 <-- Will be overwritten by 2. descriptor[6] := $40;
end else begin end else begin
if (limit and $FFF) <> $FFF then begin if (limit and $FFF) <> $FFF then begin
limit := (limit SHR 12) - 1; limit := (limit SHR 12) - 1;
end else begin end else begin
limit := limit SHR 12; limit := limit SHR 12;
end; end;
descriptor[6] := $C0; //2 <-- Will be overwritten by 3; descriptor[6] := $C0;
end; end;
descriptor[0] := limit and $FF; descriptor[0] := limit and $FF;
descriptor[1] := (limit shr 8) 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[2] := base and $FF;
descriptor[3] := (base shr 8) and $FF; descriptor[3] := (base shr 8) and $FF;

View File

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