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/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))
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -25,7 +25,7 @@
|
||||||
#include <init/boot.h>
|
#include <init/boot.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// BootInfo_t initialization. It is necessary because grub will potentially be
|
// BootInfo_t initialization. It is necessary because grub will potentially be
|
||||||
// wiped since it is below 1MB.... And we must reorganize all that stuff.
|
// wiped since it is below 1MB.... And we must reorganize all that stuff.
|
||||||
//
|
//
|
||||||
void BtInitBootInfo(multiboot_info_t *mbi, void *codeSeg)
|
void BtInitBootInfo(multiboot_info_t *mbi, void *codeSeg)
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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