Browse Source

Cool Animation

animation
Jakob Kjær-Kammersgaard 5 years ago
parent
commit
91bc53bb87
6 changed files with 42 additions and 25 deletions
  1. +0
    -0
      DEBUG_32_GRAPHICS
  2. +2
    -0
      bootloader.nasm
  3. +10
    -15
      build
  4. +1
    -1
      build.sh
  5. +24
    -9
      go32bit.nasm
  6. +5
    -0
      kernel.nasm

+ 0
- 0
DEBUG_32_GRAPHICS View File


+ 2
- 0
bootloader.nasm View File

@ -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

+ 10
- 15
build View File

@ -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

+ 1
- 1
build.sh View File

@ -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"

+ 24
- 9
go32bit.nasm View File

@ -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
- 0
kernel.nasm View File

@ -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