1

Switch more char/short/int/long to sized type

This commit is contained in:
2022-12-07 18:39:13 +01:00
parent ae98dc586e
commit c87e691588
40 changed files with 213 additions and 206 deletions

View File

@ -33,7 +33,7 @@ BIOScall_params* BC_params = reinterpret_cast<BIOScall_params*>(BIOS16_PARAM_BAS
* im 4. GDT-Eintrag (siehe startup.asm). *
*****************************************************************************/
BIOS::BIOS() {
unsigned char* codeAddr = reinterpret_cast<unsigned char*>(BIOS16_CODE_MEMORY_START);
auto* codeAddr = reinterpret_cast<uint8_t*>(BIOS16_CODE_MEMORY_START);
// mov eax, 25000 (Adresse wohin aktuelles esp gesichert wird)
*codeAddr = 0x66;
@ -312,11 +312,11 @@ BIOS::BIOS() {
*---------------------------------------------------------------------------*
* Beschreibung: Fuehrt einen BIOS-Aufruf per Software-Interrupt durch. *
*****************************************************************************/
void BIOS::Int(int inter) {
unsigned char* ptr = reinterpret_cast<unsigned char*>(BIOS16_CODE_MEMORY_START);
void BIOS::Int(uint8_t inter) {
auto* ptr = reinterpret_cast<uint8_t*>(BIOS16_CODE_MEMORY_START);
// Interrupt-Nummer in 16-Bit Code-Segment schreiben (unschoen, aber ...)
*(ptr + 48) = static_cast<unsigned char>(inter);
*(ptr + 48) = static_cast<uint8_t>(inter);
CPU::disable_int(); // Interrupts abschalten
bios_call();

View File

@ -10,23 +10,25 @@
#ifndef BIOS_include__
#define BIOS_include__
#include <cstdint>
// Speicherseite fuer Rueckgabewerte von BIOS-Aufrufen
constexpr const unsigned int RETURN_MEM = 0x9F000;
// Struktur fuer Parameteruebergabe fuer einen BIOS-Aufruf
struct BIOScall_params {
unsigned short DS;
unsigned short ES;
unsigned short FS;
unsigned short Flags;
unsigned int DI;
unsigned int SI;
unsigned int BP;
unsigned int SP;
unsigned int BX;
unsigned int DX;
unsigned int CX;
unsigned int AX;
uint16_t DS;
uint16_t ES;
uint16_t FS;
uint16_t Flags;
uint32_t DI;
uint32_t SI;
uint32_t BP;
uint32_t SP;
uint32_t BX;
uint32_t DX;
uint32_t CX;
uint32_t AX;
} __attribute__((packed));
// kein Auffuellen von bytes auf Wortgrenzen
@ -47,7 +49,7 @@ public:
}
// BIOS-Aufruf, per Software-Interrupt
static void Int(int inter);
static void Int(uint8_t inter);
};
#endif