1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00
This commit is contained in:
Adrien Bourmault 2020-02-02 13:33:57 +01:00
parent 45bffd5cf9
commit 43d62e167e
6 changed files with 85 additions and 3 deletions

View File

@ -115,7 +115,8 @@ KernSources = kernel/ke/cpuid.c kernel/mm/paging.c \
kernel/sh/shell.c kernel/sh/shcmds.c \ kernel/sh/shell.c kernel/sh/shcmds.c \
kernel/sh/musage.c kernel/io/ata.c \ kernel/sh/musage.c kernel/io/ata.c \
kernel/sh/argv.c kernel/ke/pit.c \ kernel/sh/argv.c kernel/ke/pit.c \
kernel/sh/testcmds.c kernel/mm/palloc.c kernel/sh/testcmds.c kernel/mm/palloc.c \
kernel/io/acpi.c
KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources))
KernDep=$(patsubst %.c,$(KOBJDIR)/%.d,$(KernSources)) KernDep=$(patsubst %.c,$(KOBJDIR)/%.d,$(KernSources))

View File

@ -31,7 +31,7 @@ global newStackEnd
global GDT64 global GDT64
[section .text] [section .text]
KERNEL_STACK equ 16 * 1024 * 1024 ; 16MB of stack KERNEL_STACK equ 1 * 1024 * 1024 ; 1MB of stack
newKernelEnd dq 0x0 newKernelEnd dq 0x0
newStackEnd dq 0x0 newStackEnd dq 0x0

38
include/io/acpi.h Normal file
View File

@ -0,0 +1,38 @@
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Desc: ACPI, Hardware detection related //
// //
// //
// Copyright © 2018-2019 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_ACPI_H
#define _IO_ACPI_H
//----------------------------------------------------------------------------//
void IoTestAcpi(void);
//----------------------------------------------------------------------------//
#endif

View File

@ -33,6 +33,7 @@
#include <io/vga.h> #include <io/vga.h>
#include <io/keyb.h> #include <io/keyb.h>
#include <io/cursor.h> #include <io/cursor.h>
#include <io/acpi.h>
#include <po/shtdwn.h> #include <po/shtdwn.h>
#include <init/boot.h> #include <init/boot.h>
@ -81,6 +82,9 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
KeGetCpuInfos(); KeGetCpuInfos();
IoEnableKeyb(); IoEnableKeyb();
// ACPI
IoTestAcpi();
// Command line (kernel mode) // Command line (kernel mode)
ShStartShell(); ShStartShell();

39
kaleid/kernel/io/acpi.c Normal file
View File

@ -0,0 +1,39 @@
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Desc: ACPI, Hardware detection related functions //
// //
// //
// Copyright © 2018-2019 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 <init/boot.h>
#include <io/vga.h>
void IoTestAcpi(void)
{
if (BtFirmwareInfo.romValid)
KernLog("\tRom Table is valid at %p\n", BtFirmwareInfo.romTable);
if (BtFirmwareInfo.apmValid)
KernLog("\tApm Table is valid at %p\n", BtFirmwareInfo.apmTable);
return;
}