Browse Source

Cool Animation

animation
Jakob Kjær-Kammersgaard 7 years ago
parent
commit
91bc53bb87
  1. 0
      DEBUG_32_GRAPHICS
  2. 2
      bootloader.nasm
  3. 25
      build
  4. 2
      build.sh
  5. 33
      go32bit.nasm
  6. 5
      kernel.nasm

0
DEBUG_32_GRAPHICS

2
bootloader.nasm

@ -28,6 +28,7 @@ start:
mov si, message ; Put address of the null-terminated string to output into 'si'
call print ; Call our string-printing routine
%ifdef DEBUG_MODE
mov si, enter_debug_mode
call print
call printCRLF
@ -43,6 +44,7 @@ start:
mov ah, 0x01 ; BIOS call to wait for key
int 0x16
jnz debug_mode
%endif
; entering system check:
mov si, enter_system_check

25
build

@ -1,17 +1,12 @@
#!/usr/bin/bash
# if [ "$1" == "build" ] || [ "$1" == "run" ]; then
# nasm -fbin bootloader.nasm -o bootloader.bin
# nasm -fbin kernel.nasm -o kernel.bin
# cat bootloader.bin kernel.bin > SingOS.img
# if [ $1 == "run" ]; then
# qemu-system-x86_64 -drive index=0,format=raw,file=SingOS.img
# else
# bash -c "echo;echo;echo 'Press [ENTER] to exit'; read line"
# fi
# fi
# echo "Done"
sh build.sh
defines="-d DEBUG_32_GRAPHICS"
if nasm -fbin $defines bootloader.nasm -o bootloader.bin \
&& nasm -fbin $defines kernel.nasm -o kernel.bin
then
cat bootloader.bin kernel.bin > SingOS.img
qemu-system-x86_64 -soundhw pcspk -drive index=0,format=raw,file=SingOS.img
else
echo "*** THERE WERE ERRORS ***"
read
fi

2
build.sh

@ -7,7 +7,7 @@ if [ "$1" != "run" ]; then
fi
if [ "$1" != "make" ]; then
qemu-system-x86_64 -drive index=0,format=raw,file=SingOS.img
qemu-system-x86_64 -soundhw pcspk -drive index=0,format=raw,file=SingOS.img
fi
echo "Done"

33
go32bit.nasm

@ -1,4 +1,3 @@
%define GDT_Paragraph 0x1000
%define GDT (GDT_Paragraph*16)
%define GDT_CodeSegIndex 1
@ -245,11 +244,13 @@ ProtectedModeBaby:
; Setup stack
mov esp, 0xffffffff
DrawStuff:
push ebp
mov ebp, esp
sub esp, 4
; push ebp
; mov ebp, esp
; sub esp, 4
mov ecx, 0
mov edx, 0
@ -258,19 +259,22 @@ ProtectedModeBaby:
LoopRows:
LoopCols:
mov ebx, ecx
sub ebx, 160
sub ebx, DWORD [things]
imul ebx, ebx
; shr ebx, 0
mov eax, ebx
mov ebx, edx
sub ebx, 100
sub ebx, DWORD [things]
imul ebx, ebx
add eax, ebx
shr eax, 8
xor eax, ecx
sub eax, edx
ror al, 7
sub eax, ecx
add eax, edx
sub eax, 431838
xor eax, DWORD [things]
shr ax, 3
mov byte [edi], al
;
@ -296,6 +300,16 @@ ProtectedModeBaby:
je BreakLoopRows
jmp LoopRows
BreakLoopRows:
add DWORD [things], 1
mov al, byte [things]
test al, 1
jmp DrawStuff
%if 0
WriteProtectedModeString:
lea esi, [ProtectedWelcomeStr]
@ -324,4 +338,5 @@ HALT:
;; Strings
;;;;;;;;;;;;;;;;;;;;;;;;
ProtectedWelcomeStr: db " Placeholder for SingOS - 32 bit edition! ", 0
things: dd 134558
align 512

5
kernel.nasm

@ -24,6 +24,11 @@ sing_loaded: ; SingOS is ready for the user:
mov bp, sp
sing_ready: ; SingOS is ready for the user:
%ifdef DEBUG_32_GRAPHICS
jmp Go32Bit
%endif
call os_clear_screen
mov si, welcome ; Put address of the null-terminated string to output into 'si'
call print ; Call our string-printing routine

Loading…
Cancel
Save