Browse Source

Changed text editor to reflect new screen

Stephen D 7 months ago
parent
commit
5633638ae8
2 changed files with 16 additions and 4 deletions
  1. 11 0
      drivers/screen.asm
  2. 5 4
      textedit.asm

+ 11 - 0
drivers/screen.asm

@ -8,6 +8,17 @@ kernel_scn_cls:
8 8
	xor di, di				;set to 0
9 9
	mov cx, (640*480)/2
10 10
	rep stosw
11
12
	;; set cursor pos to 0,0
13
	push dx
14
	push bx
15
	mov dx, 0
16
	mov ah, 0x02
17
	mov bx, 0					;tmp
18
	int 0x10
19
	pop bx
20
	pop dx
21
	
11 22
	pop es
12 23
	pop ax
13 24
	pop cx

+ 5 - 4
textedit.asm

@ -2,14 +2,14 @@
2 2
sedit_init:
3 3
	pusha
4 4
5
	mov cx, 0xFF
5 6
	mov bx, SEDIT_INIT_MSG		;Init msg
6 7
	call print
7 8
8 9
	mov [SEDIT_EDITOR_BUFFER], byte 0
9 10
10
	;; set the video mode, clearing the screen
11
	mov ax, 0x03
12
	int 0x10
11
	;; clear the screen
12
	call kernel_scn_cls
13 13
	
14 14
	;; read in from disk
15 15
	mov dh, 0
@ -18,6 +18,7 @@ sedit_init:
18 18
	mov bx,	SEDIT_EDITOR_BUFFER
19 19
	call read_sector
20 20
21
	mov cx, 0xFF
21 22
	;; print it out
22 23
	call print
23 24
@ -54,7 +55,7 @@ sedit_loop:
54 55
	mov bx, SEDIT_EDITOR_BUFFER
55 56
	add bx, [SEDIT_CURSOR_POSITION]
56 57
	mov [bx], al				;Append character to text buffer
57
58
	mov bx, 0xFF
58 59
	call print_char				;pretty temporary
59 60
60 61
	;; Increment cursor position