Updated pic init

This commit is contained in:
2021-08-22 19:59:55 +02:00
parent 6b0f6ddfb7
commit ad023a8119
5 changed files with 76 additions and 88 deletions

View File

@@ -7,74 +7,13 @@
#include <stdbool.h>
typedef struct {
bool sse3: 1;
bool pclmul: 1;
bool dtes64: 1;
bool monitor: 1;
bool ds_cpl: 1;
bool vmx: 1;
bool smx: 1;
bool est: 1;
bool tm2: 1;
bool ssse3: 1;
bool cid: 1;
bool reserved: 1;
bool fma: 1;
bool cx16: 1;
bool etprd: 1;
bool pdcm: 1;
bool pcide: 1;
bool dca: 1;
bool sse4_1: 1;
bool sse4_2: 1;
bool x2APIC: 1;
bool movbe: 1;
bool popcnt: 1;
bool reserved2: 1;
bool aes: 1;
bool xsave: 1;
bool osxsave: 1;
bool avx: 1;
} cpu_features_ecx;
enum {
CPUID_VENDOR_ID = 0x00,
CPUID_FEATURE_FLAGS = 0x01,
CPUID_CACHE
};
typedef struct {
bool fpu: 1;
bool vme: 1;
bool de: 1;
bool pse: 1;
bool tsc: 1;
bool msr: 1;
bool pae: 1;
bool mce: 1;
bool cx8: 1;
bool apic: 1;
bool reserved: 1;
bool sep: 1;
bool mtrr: 1;
bool pge: 1;
bool mca: 1;
bool cmov: 1;
bool pat: 1;
bool pse36: 1;
bool psn: 1;
bool clf: 1;
bool reserved2: 1;
bool dtes: 1;
bool acpi: 1;
bool mmx: 1;
bool fxsr: 1;
bool sse: 1;
bool sse2: 1;
bool ss: 1;
bool htt: 1;
bool tm1: 1;
bool ia64: 1;
bool pbe: 1;
} cpu_features_edx;
enum cpu_features {
enum {
CPUID_FEAT_ECX_SSE3 = 1 << 0,
CPUID_FEAT_ECX_PCLMUL = 1 << 1,
CPUID_FEAT_ECX_DTES64 = 1 << 2,
@@ -134,6 +73,8 @@ enum cpu_features {
CPUID_FEAT_EDX_PBE = 1 << 31
};
static bool has_apic();
void cpuidx_print_info();
#endif //NEW_KERNEL_CPUIDX_H

14
include/myke/cpu/pic.h Normal file
View File

@@ -0,0 +1,14 @@
//
// Created by rick on 22-08-21.
//
#ifndef NEW_KERNEL_PIC_H
#define NEW_KERNEL_PIC_H
#include <sys/types.h>
void pic_init();
void pic_set_mask(uint16_t mask);
#endif //NEW_KERNEL_PIC_H