New Commit.

git-svn-id: https://spexeah.com:8443/svn/Asuro@4 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2015-09-18 17:21:37 +00:00
parent ad4301222a
commit e2d1d14da0
21 changed files with 44 additions and 220 deletions

BIN
Asuro.iso

Binary file not shown.

View File

@ -1,52 +0,0 @@
@echo off
set /a ERRCOUNT=0
echo =======================
echo == ASURO COMPILATION ==
echo =======================
echo.
echo Compiling ASM Stub...
echo.
nasm -f elf src\stub.asm -o lib\stub.o
if %ERRORLEVEL% GEQ 1 (
echo Failed to compile stub!
set /a ERRCOUNT=%ERRCOUNT%+1
) ELSE (
echo Success.
)
echo.
echo =======================
echo.
echo Compiling FPC Sources...
echo.
fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Tlinux -FElib\ src\kernel.pas
if %ERRORLEVEL% GEQ 1 (
echo Failed to compile FPC Sources!
set /a ERRCOUNT=%ERRCOUNT%+1
) ELSE (
echo Success.
)
echo.
echo =======================
echo.
echo Linking...
echo.
ld -A elf32-i386 --gc-sections -s -Tlinker.script -o bin\kernel.obj lib\stub.o lib\kernel.o lib\multiboot.o lib\system.o lib\console.o
if %ERRORLEVEL% GEQ 1 (
echo Failed linking!
set /a ERRCOUNT=%ERRCOUNT%+1
) ELSE (
echo Success.
)
echo.
echo =======================
echo.
if %ERRCOUNT% GEQ 1 (
echo %ERRCOUNT% Errors Occurred, please review.
) ELSE (
echo No errors.
)
echo.
echo =======================
echo.
echo Press any key to exit...
pause > nul

Binary file not shown.

View File

@ -7,7 +7,7 @@ echo "======================="
echo " " echo " "
echo "Compiling ASM Stub..." echo "Compiling ASM Stub..."
echo " " echo " "
nasm -f elf src/stub.asm -o lib/stub.o nasm -f elf src/stub/stub.asm -o lib/stub.o
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Failed to compile stub!" echo "Failed to compile stub!"
@ -21,7 +21,7 @@ echo "======================="
echo " " echo " "
echo "Compiling FPC Sources..." echo "Compiling FPC Sources..."
echo " " echo " "
fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Tlinux -FElib/ src/kernel.pas fpc -Aelf -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Tlinux -FElib/ src/kernel.pas
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Failed to compile FPC Sources!" echo "Failed to compile FPC Sources!"
@ -35,7 +35,13 @@ echo "======================="
echo " " echo " "
echo "Linking..." echo "Linking..."
echo " " echo " "
ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin lib/stub.o lib/kernel.o lib/multiboot.o lib/system.o lib/console.o objstring="";
for object in `find lib/ -name "*.o"`; do
objstring=$objstring$object" ";
done;
echo "Object Files: "$objstring
echo " "
ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Failed linking!" echo "Failed linking!"

View File

@ -1,72 +0,0 @@
#!/bin/sh
ERRCOUNT=0
echo "======================="
echo "== ASURO COMPILATION =="
echo "======================="
echo " "
echo "Compiling ASM Stub..."
echo " "
nasm -f elf src/stub.asm -o lib/stub.o
if [ $? -ne 0 ]
then
echo "Failed to compile stub!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Rintel -Tlinux -FElib/ src/kernel.pas
if [ $? -ne 0 ]
then
echo "Failed to compile FPC Sources!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
echo " "
echo "======================="
echo " "
echo "Linking..."
echo " "
ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin lib/stub.o lib/kernel.o lib/multiboot.o lib/system.o lib/console.o
if [ $? -ne 0 ]
then
echo "Failed linking!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
echo " "
echo "======================="
echo " "
echo "Creating ISO..."
echo " "
cp bin/kernel.bin iso/boot/asuro.bin
grub-mkrescue -o Asuro.iso iso
if [ $? -ne 0 ]
then
echo "Failed to create ISO!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
echo " "
echo "======================="
echo " "
if [ "$ERRCOUNT" -ne "0" ]
then
echo "$ERRCOUNT Errors Occurred, please review."
else
echo "No errors."
fi
echo " "
echo "======================="
echo " "

View File

@ -1,7 +0,0 @@
#!/bin/sh
ERRCOUNT=0
echo "======================="
echo "== ASURO =="
echo "======================="
./compile
./run

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.

View File

@ -19,6 +19,7 @@ var
xpos: Integer = 0; xpos: Integer = 0;
ypos: Integer = 0; ypos: Integer = 0;
procedure ktest();
procedure kclearscreen(); procedure kclearscreen();
procedure kwritechr(c: Char); procedure kwritechr(c: Char);
procedure kwritestr(s: PChar); procedure kwritestr(s: PChar);
@ -27,8 +28,34 @@ procedure kwritedword(i: DWORD);
implementation implementation
type
TCharacter = bitpacked record
Character : Char;
Attributes : Char;
end;
PCharacter = ^TCharacter;
TVideoMemory = Array[0..1999] of TCharacter;
PVideoMemory = ^TVideoMemory;
T2DVideoMemory = Array[0..24] of Array[0..79] of TCharacter;
P2DVideoMemory = ^T2DVideoMemory;
var var
vidmem: PChar = PChar($b8000); vidmem : PChar = PChar($b8000);
memory : PVideoMemory = PVideoMemory($b8000);
mem2d : P2DVideoMemory = P2DVideoMemory($b8000);
procedure ktest(); [public, alias: 'ktest'];
begin
memory^[0].Attributes:= #7;
memory^[0].Character:= 'T';
mem2d^[1][0].Attributes:=#7;
mem2d^[1][0].Character:='E';
while true do begin
end;
end;
procedure kclearscreen(); [public, alias: 'kclearscreen']; procedure kclearscreen(); [public, alias: 'kclearscreen'];
var var

View File

@ -26,6 +26,7 @@ implementation
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall; [public, alias: 'kmain']; procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall; [public, alias: 'kmain'];
begin begin
kclearscreen(); kclearscreen();
ktest();
kwritestr('FUCK YOU!'); kwritestr('FUCK YOU!');
kwritestr('Freepascal barebone OS booted!'); kwritestr('Freepascal barebone OS booted!');
xpos := 0; xpos := 0;

View File

@ -1,79 +0,0 @@
;/////////////////////////////////////////////////////////
;// //
;// Freepascal barebone OS //
;// stub.asm //
;// //
;/////////////////////////////////////////////////////////
;//
;// By: De Deyn Kim <kimdedeyn@skynet.be>
;// License: Public domain
;//
;
; Kernel stub
;
;
; We are in 32bits protected mode
;
[bits 32]
;
; Export entrypoint
;
[global kstart]
;
; Import kernel entrypoint
;
[extern kmain]
;
; Posible multiboot header flags
;
MULTIBOOT_MODULE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_MAP equ 1<<1
MULTIBOOT_GRAPHICS_FIELDS equ 1<<2
MULTIBOOT_ADDRESS_FIELDS equ 1<<16
;
; Multiboot header defines
;
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_MODULE_ALIGN | MULTIBOOT_MEMORY_MAP
MULTIBOOT_HEADER_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
;
; Kernel stack size
;
KERNEL_STACKSIZE equ 0x4000
section .text
;
; Multiboot header
;
align 4
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_HEADER_CHECKSUM
;
; Entrypoint
;
kstart:
mov esp, KERNEL_STACK+KERNEL_STACKSIZE ;Create kernel stack
push eax ;Multiboot magic number
push ebx ;Multiboot info
call kmain ;Call kernel entrypoint
cli ;Clear interrupts
hlt ;Halt machine
section .bss
;
; Kernel stack location
;
align 32
KERNEL_STACK:
resb KERNEL_STACKSIZE