Added scripts for debug
git-svn-id: https://spexeah.com:8443/svn/Asuro@24 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
85f0849123
commit
2ce7ccc265
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
15
compile.sh
15
compile.sh
@ -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!"
|
||||
|
@ -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
2
compile_and_run_debug.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
./compile_and_run.sh -d
|
2
compile_debug.sh
Normal file
2
compile_debug.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
./compile.sh -d
|
Binary file not shown.
BIN
lib/gdt.ppu
Normal file
BIN
lib/gdt.ppu
Normal file
Binary file not shown.
BIN
lib/kernel.o
BIN
lib/kernel.o
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
BIN
lib/libpkernel.a
BIN
lib/libpkernel.a
Binary file not shown.
BIN
lib/types.ppu
Normal file
BIN
lib/types.ppu
Normal file
Binary file not shown.
11
src/gdt.pas
11
src/gdt.pas
@ -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;
|
||||
|
@ -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('');
|
||||
|
Loading…
x
Reference in New Issue
Block a user