mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
Acpi
This commit is contained in:
parent
45bffd5cf9
commit
43d62e167e
3
Makefile
3
Makefile
@ -115,7 +115,8 @@ KernSources = kernel/ke/cpuid.c kernel/mm/paging.c \
|
||||
kernel/sh/shell.c kernel/sh/shcmds.c \
|
||||
kernel/sh/musage.c kernel/io/ata.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))
|
||||
KernDep=$(patsubst %.c,$(KOBJDIR)/%.d,$(KernSources))
|
||||
|
@ -31,7 +31,7 @@ global newStackEnd
|
||||
global GDT64
|
||||
|
||||
[section .text]
|
||||
KERNEL_STACK equ 16 * 1024 * 1024 ; 16MB of stack
|
||||
KERNEL_STACK equ 1 * 1024 * 1024 ; 1MB of stack
|
||||
newKernelEnd dq 0x0
|
||||
newStackEnd dq 0x0
|
||||
|
||||
|
38
include/io/acpi.h
Normal file
38
include/io/acpi.h
Normal 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
|
@ -33,6 +33,7 @@
|
||||
#include <io/vga.h>
|
||||
#include <io/keyb.h>
|
||||
#include <io/cursor.h>
|
||||
#include <io/acpi.h>
|
||||
#include <po/shtdwn.h>
|
||||
#include <init/boot.h>
|
||||
|
||||
@ -81,6 +82,9 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
||||
KeGetCpuInfos();
|
||||
IoEnableKeyb();
|
||||
|
||||
// ACPI
|
||||
IoTestAcpi();
|
||||
|
||||
// Command line (kernel mode)
|
||||
ShStartShell();
|
||||
|
||||
|
39
kaleid/kernel/io/acpi.c
Normal file
39
kaleid/kernel/io/acpi.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user