Skip to content

Commit

Permalink
fixed sector problems with games
Browse files Browse the repository at this point in the history
  • Loading branch information
kamkanev committed Aug 24, 2024
1 parent 9974dcc commit 3533b50
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ run:
floppy: main
dd if=/dev/zero of=floppy.bin count=2876 bs=512
cat boot.bin files.bin shell.bin \
./games/tetris.img \
./games/snake.img \
./games/tetris.img \
./pong/pong.bin \
floppy.bin > RockOS.img
rm -f *.bin

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions files.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

[bits 16] ;tell NASM to wotk with 16bit code

db 'pong', 0, 0, 0, 0
db 'snake', 0, 0, 0
db 'tetris', 0, 0
db 'space', 0, 0, 0
db 'pong', 0, 0, 0, 0

times 512 - ($ - $$) db 0 ;fill trailing zeros to get exacly 512 bytes long binary file
11 changes: 6 additions & 5 deletions memory_map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

start end size description

0x0000_0000 0x0000_01FF 512 bytes bootloader (sector 1)
0x0000_0200 0x0000_03FF 512 bytes files (sector 2)
0x0000_0400 0x0000_05FF 512 bytes shell (sector 3)
0x0000_0600 0x0000_07FF 512 bytes pong (sector 4)
0x0000_0800 0x0000_09FF 512 bytes tetris (sector 5)
0x0000_0000 0x0000_01FF 512 bytes bootloader (sector 0)
0x0000_0200 0x0000_03FF 512 bytes files (sector 1)
0x0000_0400 0x0000_05FF 512 bytes shell (sector 2)
0x0000_0600 0x0000_07FF 512 bytes snake (sector 3)
0x0000_0800 0x0000_09FF 512 bytes tetris (sector 4)
0x0000_0A00 0x0000_0BFF 512 bytes pong (sector 5)
.
.
.
2 changes: 1 addition & 1 deletion shell.asm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ search_file:
je .return

mov bx, 0 ;file name index
mov dl, 4 ;sector of first executable on USB or flsh drive
mov dl, 3 ;sector of first executable on USB or flsh drive

.next_game:
mov ax, [file_list + bx]
Expand Down

0 comments on commit 3533b50

Please sign in to comment.