flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Move cursor console without interrupt Goto page Previous 1, 2, 3 Next |
Author |
|
DimonSoft 28 Mar 2020, 17:48
revolution wrote:
If it’s OS construction then how is the OP expected to even load his operating system without BIOS services or output any meaningful messages in case bootloading fails? Or do you mean the case when the OP intentionally made BIOS services unavailable while staying in real mode? |
|||
28 Mar 2020, 17:48 |
|
revolution 28 Mar 2020, 17:59
DimonSoft wrote: If it’s OS construction then how is the OP expected to even load his operating system without BIOS services or output any meaningful messages in case bootloading fails? Or do you mean the case when the OP intentionally made BIOS services unavailable while staying in real mode? You can load your boot loader and whatnot using the BIOS. But once you switch to protected mode (or whatever mode) then you need to use your own drivers with their own IN/OUT code. |
|||
28 Mar 2020, 17:59 |
|
Fulgurance 28 Mar 2020, 18:48
I have tested with port 0x61 and 0x64, but nothing. I don't understand ...
If Thomas can look my topic T_T |
|||
28 Mar 2020, 18:48 |
|
Tomasz Grysztar 28 Mar 2020, 19:04
Fulgurance wrote: If Thomas can look my topic T_T However, for console/video handling kelvar uses VESA BIOS, so it is not going to help with that. But for programming VGA directly (without BIOS) I have another recommendation - the good old MODES.ASM example (it is in TASM syntax, though not that hard to convert into fasm*). This sample is what I had been learning from when I wrote VGA drivers for my TitanOS (the one that I have lost in a HDD crash, so unfortunately I'm not able to share that code). ________ * I have also made a set of macros that allow to assemble MODES.ASM with fasmg without any alterations to source code. These macros work with an old (pre-CALM) version of 80386.INC, you'd need to get that old version from GitHub history. Or you can get it as a part of complete package of demonstrations of assembling legacy sources with fasmg. But this is mostly just a curiosity. |
|||
28 Mar 2020, 19:04 |
|
Fulgurance 28 Mar 2020, 21:22
Thanks for your example. I try to understand.
I have impression is necessary to use 0x64 and 0x61port. What is the use of this ports ? What is the difference between cmp and test fonction ? |
|||
28 Mar 2020, 21:22 |
|
DimonSoft 28 Mar 2020, 21:28
revolution wrote:
Sorry, I was under impression that the question was related to real mode. It really wasn’t. Then again, AFAIK, it’s not really a good idea to rely on VGA being properly emulated by modern video cards. It might be to some degree, but… The Intel HD Graphics card in the notebook I use to type this message requires additional setup to support 800x600 mode which is far newer than VGA’s 13h mode and the rest. I wouldn’t bet a single penny for its complete support of legacy VGA ports’ interface. |
|||
28 Mar 2020, 21:28 |
|
N-LG 28 Mar 2020, 21:41
"cmp" make a "sub" but dont save the result and "test" make an "And" and dont save the result
for understanding the use of keybord i recommend the reading of http://www.stanislavs.org/helppc/8042.html |
|||
28 Mar 2020, 21:41 |
|
Fulgurance 29 Mar 2020, 10:32
Sorry, but your webpage isn't accessible (404 error)
|
|||
29 Mar 2020, 10:32 |
|
N-LG 29 Mar 2020, 10:56
that strange, i can read the page (attached to this post)
|
|||||||||||
29 Mar 2020, 10:56 |
|
Fulgurance 29 Mar 2020, 12:06
It's possible my security settings is little aggressive.
|
|||
29 Mar 2020, 12:06 |
|
N-LG 29 Mar 2020, 15:12
I had never looked at the rest of the site but it seems to me to be a kind of pro Russian blog and anti West, there may be in the site itself blocking depending on the origin of the reader
I found another source for this doc: http://helppc.netcore2k.net/hardware/8042 he had fun recreating the initial presentation of the helppc program developed by David Jurgen http://helppc.netcore2k.net/ the hardware section is quite useful when starting a hobby OS (it was for me) |
|||
29 Mar 2020, 15:12 |
|
Fulgurance 29 Mar 2020, 16:15
Tomasz Grysztar, i have studied your code, and i have tried to apply what i have looked, but, i have the same result ... What is wrong into my code ?
If i have understand good, in firt i need to get the current scancode with 0x60 port. I save it into ah register. In second, i read 0x64 status port to check if signal is finished, or not, and if it's even, i compare current scancode. No ? Look my code: Code: Format binary as "img" org 0x7C00 use16 BootSector16: mov ax,0xB800 mov es,ax xor ax,ax mov bp,ax mov byte [es:bp],'>' inc bp mov byte [es:bp],00000111b mov bx,0x1 call MoveConsoleCursor Main16: xor si,si .update: call GetCurrentScanCode cmp ah,[CharactersScanCodeTable+si] jne Main16 inc bx call MoveConsoleCursor cmp si,0x1A jge Main16 inc si jmp .update include "MoveConsoleCursor.fasm" include "GetCurrentScanCode.fasm" CharactersTable: db 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' CharactersScanCodeTable: db 0x10,0x30,0x2e,0x20,0x12,0x21,0x22,0x23,0x17,0x24,0x25,0x26,0x32,0x31,0x18,0x19,0x1e,0x13,0x1f,0x14,0x16,0x2f,0x2c,0x2d,0x15,0x11 ReleasedCharactersScanCodeTable: db 0x90,0xb0,0xae,0xa0,0x92,0xa1,0xa2,0xa3,0x97,0xa4,0xa5,0xa6,0xb2,0xb1,0x98,0x99,0x9e,0x93,0x9f,0x94,0x96,0xaf,0xac,0xad,0x95,0x91 db 510-($-$$) dup 0x90 dw 0xAA55 |
|||
29 Mar 2020, 16:15 |
|
Fulgurance 29 Mar 2020, 16:16
Code: use16 GetCurrentScanCode: in al,0x60 mov ah,al in al,0x64 test al,1 jnz GetCurrentScanCode ret |
|||
29 Mar 2020, 16:16 |
|
Fulgurance 29 Mar 2020, 16:16
Code: use16 MoveConsoleCursor: mov dx,0x3d4 mov al,0x0f out dx,al mov dx,0x3d5 mov al,bl out dx,al mov dx,0x3d4 mov al,0x0e out dx,al mov dx,0x3d5 mov al,bh out dx,al ret |
|||
29 Mar 2020, 16:16 |
|
N-LG 29 Mar 2020, 16:40
no, First you have to read de 64h port to check if data are available and if the bit is set, read the 60h port
Code: use16 GetCurrentScanCode: in al,0x64 test al,1 jz GetCurrentScanCode in al,0x60 mov ah,al ret |
|||
29 Mar 2020, 16:40 |
|
Fulgurance 29 Mar 2020, 16:47
I have tested, but nothing append when i input into my keyboard :C
|
|||
29 Mar 2020, 16:47 |
|
N-LG 29 Mar 2020, 17:09
i test on my own os what is the state or register 64h and evry time the irq is call the 1st bit of 64h is at 1
you never desactivate the irq in your code, maybe the bios irq for the keyboard read and delete data from 60h register before your code try to add a "cli" instruction in the start of your code edit i test your code with a cli in the start of your code and it work but just for one key (the A) et bizzarement votre clavier semble être un azerty.... |
|||
29 Mar 2020, 17:09 |
|
Fulgurance 29 Mar 2020, 17:38
Yes, i have mapped for azerty
Yes, i think something is bad. I have updated my code. Now, cursor move but after i stay pressed into some key during loooong ago ... I think something is bad into my code, bad update or other thing .... Look: Code: Format binary as "img" org 0x7C00 use16 BootSector16: cli mov ax,0xB800 mov es,ax xor ax,ax mov bp,ax mov byte [es:bp],'>' inc bp mov byte [es:bp],00000111b mov bx,0x1 call MoveConsoleCursor Main16: .reset: xor si,si .update: call GetCurrentScanCode cmp ah,[CharactersScanCodeTable+si] jne .updateIndex .updateCursor: inc bx call MoveConsoleCursor .updateIndex: cmp si,0x1A jge .reset inc si jmp .update include "MoveConsoleCursor.fasm" include "GetCurrentScanCode.fasm" CharactersTable: db 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' CharactersScanCodeTable: db 0x10,0x30,0x2e,0x20,0x12,0x21,0x22,0x23,0x17,0x24,0x25,0x26,0x32,0x31,0x18,0x19,0x1e,0x13,0x1f,0x14,0x16,0x2f,0x2c,0x2d,0x15,0x11 ReleasedCharactersScanCodeTable: db 0x90,0xb0,0xae,0xa0,0x92,0xa1,0xa2,0xa3,0x97,0xa4,0xa5,0xa6,0xb2,0xb1,0x98,0x99,0x9e,0x93,0x9f,0x94,0x96,0xaf,0xac,0xad,0x95,0x91 db 510-($-$$) dup 0x90 dw 0xAA55 |
|||
29 Mar 2020, 17:38 |
|
N-LG 29 Mar 2020, 18:22
i have understand why it was sooo long:
Code: org 0x7C00 use16 BootSector16: cli mov ax,0xB800 mov es,ax xor ax,ax mov bp,ax mov byte [es:bp],'>' inc bp mov byte [es:bp],00000111b mov bx,0x1 call MoveConsoleCursor Main16: .reset: xor si,si call GetCurrentScanCode ;i change this because you wait for .update: ; a key for every scan code you test cmp ah,[CharactersScanCodeTable+si] jne .updateIndex .updateCursor: push bx ;to write carac to screen shl bx,1 ; mov al,[si+CharactersTable] ; mov ah,7 ; mov [es:bx],ax ; pop bx ; inc bx call MoveConsoleCursor .updateIndex: cmp si,0x19 ;stop to lettre 25 jae .reset ;jg a jl are for signed number ja and jb are for non-signed number inc si jmp .update GetCurrentScanCode: in al,0x64 test al,1 jz GetCurrentScanCode in al,0x60 mov ah,al ret MoveConsoleCursor: mov dx,0x3d4 mov al,0x0f out dx,al mov dx,0x3d5 mov al,bl out dx,al mov dx,0x3d4 mov al,0x0e out dx,al mov dx,0x3d5 mov al,bh out dx,al ret CharactersTable: db 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' CharactersScanCodeTable: db 0x10,0x30,0x2e,0x20,0x12,0x21,0x22,0x23,0x17,0x24,0x25,0x26,0x32,0x31,0x18,0x19,0x1e,0x13,0x1f,0x14,0x16,0x2f,0x2c,0x2d,0x15,0x11 ReleasedCharactersScanCodeTable: db 0x90,0xb0,0xae,0xa0,0x92,0xa1,0xa2,0xa3,0x97,0xa4,0xa5,0xa6,0xb2,0xb1,0x98,0x99,0x9e,0x93,0x9f,0x94,0x96,0xaf,0xac,0xad,0x95,0x91 db 510-($-$$) dup 0x90 dw 0xAA55 |
|||
29 Mar 2020, 18:22 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.