problem with printing on screen
problem with printing on screen
i could not print on the screen using interrupt 10 when i am in real,mode..
help me..!!!
help me..!!!
As I said post your code, we are not psychic.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
are you writing a bootloader? If you are loaded by grub try this:
esi is the addr of the string to print. Your lucky that I'm in a giving mood
Code: Select all
texmem: dd 0xB8000;text memory
cline: dd 0xB8000;current line
color: db 0x0A;green
kputc:;put a char on the screen
cmp al,"$"
je bnline
mov ebx,[texmem]
mov ah,[color]
mov [ebx],al
inc ebx
mov [ebx],ah
inc ebx
mov [texmem],ebx
jmp kpute
bnline:
mov eax,[cline]
add eax,0xA0
mov [cline],eax
mov [texmem],eax
kpute:
ret
kputs:;put a string on the screen
lodsb
or al,al
jz kpdone
call kputc
jmp kputs
kpdone:
ret
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
I thought only some BIOS's leave the interrupts enabled post-bios?
have you tried putting a STI before your code?
have you tried putting a STI before your code?
Website: https://joscor.com
Code: Select all
org 0x7c00
bits 16
Start:
mov al,'A'
mov bx,0x0003
mov ah,0x0e
int 0x10
jmp $
times 510 - ($-$$) db 0
dw 0xAA55
Code: Select all
@@: mov bx, 0007h
mov ah, 0Eh
push si
int 10h
pop si
inc si
output_string: mov al, [si]
and al, al
jg @b
ret
You should do something like this...
assemble it with nasm,like this...
if you have a programe called bootable
you can write this to a boot sector of a floppy ,like this...
google to download it...
Also you can use Debug programe which comes with Dos
becareful this will destroy all data on your floppy disk.
Thanx.
Code: Select all
;----------------------------------------------------------------------
; Simple boot program that prints the letter 'H'
; and then hangs
;----------------------------------------------------------------------
org 0x7c00 ; This is where BIOS loads the bootloader
; Execution begins here
entry:
jmp short begin ; jump over the DOS boot record data
; --------------------------------------------
; Boot program code begins here
; --------------------------------------------
; boot code begins at 0x003E
begin:
mov ah, 0x0 ; Function to print a character to the screen
mov al, 'H' ; Which character to print
mov bl, 7 ; color/style to use for the character
int 0x10 ; print the character
hang:
jmp hang ; just loop forever.
;---------------------------------------------
size equ $ - entry
%if size+2 > 512
%error "code is too large for boot sector"
%endif
times (512 - size - 2) db 0
db 0x55, 0xAA ;2 byte boot signature
Code: Select all
nasmw h.asm –o h.bin
you can write this to a boot sector of a floppy ,like this...
Code: Select all
bootable h.bin a:
Also you can use Debug programe which comes with Dos
Code: Select all
debug
-n h.bin
-l 0
-w 0 0 0 1
Thanx.
The man who follows the crowd will usually get no further than the crowd.
The man who walks alone is likely to find himself in places
no one has ever been before.
The man who walks alone is likely to find himself in places
no one has ever been before.