-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disk.lib, wmemory.lib, fix monitor.lib, window.asm
- Loading branch information
1 parent
0596e02
commit d5eb5ce
Showing
7 changed files
with
170 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
;============================================== | ||
; KiddieOS - Disk/Memory Library Routines | ||
; Author: Francis | ||
; Version 1.0.0 | ||
;============================================== | ||
|
||
%IFNDEF __DISK_LIB__ | ||
%DEFINE __DISK_LIB__ | ||
|
||
;---------------------------------------------- | ||
; Disk & Memory Configurations | ||
;______________________________________________ | ||
SegmentAddr dw 0000h ; Segment Address | ||
OffsetAddr dw 0000h ; Offset Address | ||
Sector db 0 ; Sector | ||
Track db 0 ; Track | ||
Head db 0 ; Head | ||
Drive db 0 ; Driver | ||
NumSectors db 0 ; Number of Sectors | ||
|
||
Reader db 02h ; Reader | ||
Writer db 03h ; Writer | ||
|
||
SectorPerTrack db 0 ; Sector per Track | ||
TrackPerHead db 0 ; Track per Head | ||
;______________________________________________ | ||
|
||
;---------------------------------------------- | ||
; Routine Library | ||
ReadDisk: | ||
mov ah, byte [Reader] ; Move the value of Reader to AH | ||
call DiskOperation ; Call the interrupt 13h | ||
|
||
WriteDisk: | ||
mov ah, byte [Writer] ; Move the value of Writer to AH | ||
call DiskOperation ; Call the interrupt 13h | ||
|
||
DiskOperation: | ||
mov al, byte [NumSectors] ; Move the value of NumSectors to AL | ||
mov ch, byte [Track] ; Move the value of Track to CH | ||
mov cl, byte [Sector] ; Move the value of Sector to CL | ||
mov dh, byte [Head] ; Move the value of Head to DH | ||
mov dl, byte [Drive] ; Move the value of Drive to DLM | ||
mov bx, word [SegmentAddr] ; Move the value of SegmentAddr to BX ES:BX | ||
mov es, bx ; Move the value of BX to ES | ||
mov bx, word [OffsetAddr] ; Move the value of OffsetAddr to BX | ||
int 13h ; Call the interrupt 13h | ||
ret ; Return from the routine | ||
;---------------------------------------------- | ||
%ENDIF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
;============================================== | ||
; KiddieOS - Memory Library Routines | ||
; Author: Francis | ||
; Version 1.0.0 | ||
;============================================== | ||
|
||
%IFNDEF __WMEMORY_LIB__ | ||
%DEFINE __WMEMORY_LIB__ | ||
|
||
;---------------------------------------------- | ||
; Memory & Windows Configurations | ||
;______________________________________________ | ||
%DEFINE WindowAddress 0800h:0500h ; Window Address | ||
|
||
%DEFINE Window_Bar 3000h ; Window Bar | ||
%DEFINE Window_Width 3001h ; Window Width | ||
%DEFINE Window_Height 3003h ; Window Height | ||
%DEFINE Window_PositionX 3005h ; Window Position X | ||
%DEFINE Window_PositionY 3007h ; Window Position Y | ||
%DEFINE Window_Bar_Color 300Ah ; Window Bar Color | ||
%DEFINE Window_Back_Color 300Bh ; Window Background Color | ||
%DEFINE ButtonClose 300Ch ; Button Close | ||
%DEFINE ButtonMaximize 300Dh ; Button Maximize | ||
%DEFINE ButtonMinimize 300Eh ; Button Minimize | ||
|
||
M_InitialPositionX dw 0000h ; Initial Position X | ||
M_InitialPositionY dw 0000h ; Initial Position Y | ||
StateWindowBar dw 0000h ; State Window Bar | ||
SavePositionX dw 0000h ; Save Position X | ||
SavePositionY dw 0000h ; Save Position Y | ||
SaveWidth dw 0000h ; Save Width | ||
SaveHeight dw 0000h ; Save Height | ||
;---------------------------------------------- | ||
|
||
|
||
|
||
|
||
%ENDIF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[BITS 16] | ||
[ORG 0500h] | ||
|
||
pusha | ||
call DefineWindow | ||
popa | ||
jmp ReturnKernel | ||
|
||
DefineWindow: | ||
mov ah, 0Ch ; Função 0Ch da interrupção 10h: Definir janela de texto | ||
mov al, 55 ; Cor do pixel superior esquerdo | ||
mov cx, 50 ; Coluna do pixel superior esquerdo | ||
mov dx, 50 ; Linha do pixel superior esquerdo | ||
jmp Window | ||
|
||
Window: | ||
LineUp: | ||
int 10h ; Chama a interrupção 10h para mover o cursor | ||
inc cx ; Incrementa CX - coluna | ||
cmp cx, 100 ; Compara CX com 100 | ||
jne LineUp ; Se CX for diferente de 100, pula para LineUp | ||
LineRight: | ||
int 10h ; Chama a interrupção 10h para mover o cursor | ||
inc dx ; Incrementa DX - linha | ||
cmp dx, 100 ; Compara DX com 100 | ||
jne LineRight ; Se DX for diferente de 100, pula para LineRight | ||
LineDown: | ||
int 10h ; Chama a interrupção 10h para mover o cursor | ||
dec cx ; Decrementa CX - coluna | ||
cmp cx, 50 ; Compara CX com 50 | ||
jne LineDown ; Se CX for diferente de 50, pula para LineDown | ||
LineLeft: | ||
int 10h ; Chama a interrupção 10h para mover o cursor | ||
dec dx ; Decrementa DX - linha | ||
cmp dx, 50 ; Compara DX com 50 | ||
jne LineLeft ; Se DX for diferente de 50, pula para LineLeft | ||
ret ; Retorna da sub-rotina | ||
|
||
|
||
ReturnKernel: | ||
ret |