소스 검색

Merge pull request #24 from Rhodez-x/imada

Anniversary build
go32
Jørn Guldberg 5 년 전
committed by GitHub
부모
커밋
54edc168ba
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
4개의 변경된 파일59개의 추가작업 그리고 33개의 파일을 삭제
  1. +27
    -4
      CLI/CLI.nasm
  2. +3
    -3
      bootloader.nasm
  3. +7
    -20
      kernel.nasm
  4. +22
    -6
      lib/svim.nasm

+ 27
- 4
CLI/CLI.nasm 파일 보기

@ -84,6 +84,28 @@ CLI_CONFIRM_INPUT:
mov [CLI_Command_Buffer], bx
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
print_help_message:
; Prints a list of available commands
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
push si
mov si, .command_list_string
call print
pop si
ret
.command_list_string:
db 13, 10
db "Available commands:", 13, 10
db " help: Prints this screen", 13, 10
db " dumpmem: Prints the contents of a memory region (At the moment hardcoded)", 13, 10
db " keyprint: Prints the character and keycode for a key presssd", 13, 10
db " clear: Clears the screen", 13, 10
db " formatdisk: Initialize the file system", 13, 10
db " createfile: Name a file, in the file system", 13, 10
db " fsinfo: Displays info about the file system", 13, 10
db " ls: Lists the named files", 13, 10
db " svim: SingOS' text editor", 13, 10, 0
; Executes the command.
CLI_EXECUTE:
pusha
@ -133,11 +155,11 @@ CLI_EXECUTE:
.end:
popa
ret
.tmp dw 0
.Num_Commands dw 8
.Command_Name_List dw .CMD1, .CMD2, .CMD3, .CMD4, .CMD5, .CMD6, .CMD7, .CMD8
.Command_Function_Pointers dw dumpmem_hardcoded_args, keyprint, svim, vsfs_list_files_command, vsfs_create_file, vsfs_format_disk, vsfs_get_fs_info, os_clear_screen
.Num_Commands dw 9
.Command_Name_List dw .CMD1, .CMD2, .CMD3, .CMD4, .CMD5, .CMD6, .CMD7, .CMD8, .CMD9
.Command_Function_Pointers dw dumpmem_hardcoded_args, keyprint, svim, vsfs_list_files_command, vsfs_create_file, vsfs_format_disk, vsfs_get_fs_info, os_clear_screen, print_help_message
.CMD1 db 'dumpmem', 0
.CMD2 db 'keyprint', 0
.CMD3 db 'svim', 0
@ -146,5 +168,6 @@ CLI_EXECUTE:
.CMD6 db 'formatdisk', 0
.CMD7 db 'fsinfo', 0
.CMD8 db 'clear', 0
.CMD9 db 'help', 0

+ 3
- 3
bootloader.nasm 파일 보기

@ -70,9 +70,9 @@ start:
call printCRLF
call printCRLF
xor ax, ax
mov al, [disk_identifier]
call dumpax
; xor ax, ax
; mov al, [disk_identifier]
; call dumpax
mov dl, [disk_identifier]
mov ax, 0x7e0

+ 7
- 20
kernel.nasm 파일 보기

@ -6,23 +6,6 @@ start_sing:
; VSFS is loaded:
mov [global_disk_identifier], dl ; saving disk_identifier, this is the number the disk that we are booting from.
; This number is set by the bios
call printCRLF ; only for debug
xor ax, ax
mov al, dl
call dumpax
call printCRLF
mov ah, 08h
mov dl, [global_disk_identifier]
mov bx, 0x0
mov es, bx
mov di, 0x0
int 13h
call dump_general_registers
call printCRLF
call printCRLF
call printCRLF
jmp sing_ready
%include "mem_lib/mem_lib.nasm"
@ -36,9 +19,11 @@ jmp sing_ready
sing_ready: ; SingOS is ready for the user:
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
print_format example_format_string, 0xdead, 0xbeef, 0xbabe, 420
call printCRLF
@ -55,6 +40,8 @@ sing_ready: ; SingOS is ready for the user:
call dump_status_flags
call printCRLF
call print_help_message
; call dump_status_flags
; call printCRLF
@ -306,8 +293,8 @@ global_vars:
global_disk_identifier db 0 ; set by the bios passed by the bootloader,
; this is the bios ID
data:
welcome db 9;This is SingOS! v0.0.3', 13, 10, 'Press ESC to halt.', 13, 10, 0
data:
welcome db 4;###############################################################################", 13, 10, "# Welcome to SingOS anniversary edition. #", 13, 10, "# This build marks 1 year of SingOS! #", 13, 10, "###############################################################################", 13, 10, 'Press ESC to halt.', 13, 10, 13, 10, 0
exit_message db 13, 10, 'Goodbye from SingOS',13,10,'The system has halted.', 0
command_line db 13, 10, 'groot@SingOS $ ', 0
number_one_zstring db '71', 0

+ 22
- 6
lib/svim.nasm 파일 보기

@ -145,14 +145,14 @@ svim:
mov bx, .buffer_for_svim
xor ax, ax
mov ah, 0x02 ;Read sectors from drive
mov al, 0x01 ;Number of sectors to read (8 * 512 = 4096 bytes)
mov al, 0x04 ;Number of sectors to read (8 * 512 = 4096 bytes)
mov cl, 0x01 ;First sector to read (bits 0-5), upper bits of cylinder (bits 6-7)
mov dh, 0x00 ;Head number
mov dl, [global_disk_identifier] ;Drive number
int 0x13
mov bx, .buffer_for_svim
add bx, 510
add bx, 2046
mov ax, [bx]
mov [.buffer_counter_svim], ax
; print buffer
@ -168,7 +168,23 @@ svim:
int 0x16
cmp ax, 0x1c0d ; enter key
jne .no_enter
call printCRLF
mov bx, .buffer_for_svim
add bx, [.buffer_counter_svim]
mov BYTE [bx], 13 ; put char in the buffer
mov BYTE [bx + 1], 10 ; put char in the buffer
mov bx, [.buffer_counter_svim]
add bx, 0x02
mov [.buffer_counter_svim], bx
xor bx, bx
xor cx, cx
xor dx, dx
mov ax, 0x0e0d
int 0x10
mov ax, 0x0e0a
int 0x10
jmp .svim_loop
.no_enter:
@ -201,7 +217,7 @@ svim:
;ES:BX Buffer Address Pointer
mov ax, [.buffer_counter_svim]
mov bx, .buffer_for_svim
add bx, 510
add bx, 2046
mov [bx], ax
mov bx, ds
@ -212,7 +228,7 @@ svim:
mov ch, al ; move the fileindex in the ch
mov ah, 0x03 ;Write sectors to drive
mov al, 0x01 ;Number of sectors to write (8 * 512 = 4096 bytes)
mov al, 0x04 ;Number of sectors to write (8 * 512 = 4096 bytes)
mov cl, 0x01 ;First sector to read (bits 0-5), upper bits of cylinder (bits 6-7)
mov dh, 0x00 ;Head number
mov dl, [global_disk_identifier] ;Drive number
@ -270,5 +286,5 @@ svim:
.welcome_svim_enter_fileindex db 'Enter fileindex: ', 0
.seperate_line db '________________________________________________________________________________', 0
.fileindex_for_open_file dw 0
.buffer_for_svim times 512 dw 0 ; db 'this is the buffer', 0, times 32 db 0
.buffer_for_svim times 2048 db 0 ; db 'this is the buffer', 0, times 32 db 0
.buffer_counter_svim dw 0

불러오는 중...
취소
저장