Commit c8ba4a36 authored by Adrien Bourmault's avatar Adrien Bourmault 💻

Some tests

parent 1d551216
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Desc: Basic Read Only ATA Long mode Driver //
// //
// //
// Copyright © 2018-2020 The OS/K Team //
// //
// This file is part of OS/K. //
// //
// OS/K is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// any later version. //
// //
// OS/K is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
//----------------------------------------------------------------------------//
#ifndef _KERNEL_H
#include <kernel.h>
#endif
#ifndef _IO_ATA_H
#define _IO_ATA_H
//#include <ke/idt.h>
//----------------------------------------------------------------------------//
void IoReadVGAFonts(void* buffer);
//----------------------------------------------------------------------------//
#endif
;=----------------------------------------------------------------------------=;
; GNU GPL OS/K ;
; ;
; Desc: Basic Read Only ATA Long mode Driver ;
; (x86_64 architecture only) ;
; ;
; ;
; Copyright © 2018-2020 The OS/K Team ;
; ;
; This file is part of OS/K. ;
; ;
; OS/K is free software: you can redistribute it and/or modify ;
; it under the terms of the GNU General Public License as published by ;
; the Free Software Foundation, either version 3 of the License, or ;
; (at your option) any later version. ;
; ;
; OS/K is distributed in the hope that it will be useful, ;
; but WITHOUT ANY WARRANTY; without even the implied warranty of ;
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;
; GNU General Public License for more details. ;
; ;
; You should have received a copy of the GNU General Public License ;
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
;=----------------------------------------------------------------------------=;
global IoReadVGAFonts
IoReadVGAFonts:
;-----------------------------------------------------------------------;
; x64/LM VGA Fonts reading function ;
; rsi : address of the buffer ;
;-----------------------------------------------------------------------;
;in: edi=4k buffer
;out: buffer filled with font
;clear even/odd mode
push rdi
mov rdi, rsi
mov dx, 03ceh
mov ax, 5
out dx, ax
;map VGA memory to 0A0000h
mov ax, 0406h
out dx, ax
;set bitplane 2
mov dx, 03c4h
mov ax, 0402h
out dx, ax
;clear even/odd mode (the other way, don't ask why)
mov ax, 0604h
out dx, ax
;copy charmap
mov esi, 0A0000h
mov ecx, 256
;copy 16 bytes to bitmap
.loopp:
movsd
movsd
movsd
movsd
;skip another 16 bytes
add esi, 16
loop .loopp
;restore VGA state to normal operation
mov ax, 0302h
out dx, ax
mov ax, 0204h
out dx, ax
mov dx, 03ceh
mov ax, 1005h
out dx, ax
mov ax, 0E06h
out dx, ax
pop rdi
ret
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Desc: Basic Read Only ATA Long mode Driver //
// //
// //
// Copyright © 2018-2020 The OS/K Team //
// //
// This file is part of OS/K. //
// //
// OS/K is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// any later version. //
// //
// OS/K is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
//----------------------------------------------------------------------------//
#include <drivers/graphics.h>
void IoVGAModeSetTest(void)
{
void *buffer = (void*)malloc(4*KB);
KernLog("Hey. This is a test\n");
IoReadVGAFonts(buffer);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment