summaryrefslogtreecommitdiffhomepage
path: root/dev/zka/src
diff options
context:
space:
mode:
Diffstat (limited to 'dev/zka/src')
-rw-r--r--dev/zka/src/ACPIFactoryInterface.cc13
-rw-r--r--dev/zka/src/UserProcessScheduler.cc16
2 files changed, 20 insertions, 9 deletions
diff --git a/dev/zka/src/ACPIFactoryInterface.cc b/dev/zka/src/ACPIFactoryInterface.cc
index c7d2914f..230b6ed6 100644
--- a/dev/zka/src/ACPIFactoryInterface.cc
+++ b/dev/zka/src/ACPIFactoryInterface.cc
@@ -29,11 +29,11 @@ namespace Kernel
RSDT* xsdt = reinterpret_cast<RSDT*>(rsp_ptr->RsdtAddress);
- Int64 num = (xsdt->Length - sizeof(SDT)) / sizeof(UInt32);
+ Int64 num = (xsdt->Length - sizeof(SDT)) / sizeof(Int64);
/***
- crucial to avoid - overflows.
- */
+ crucial to avoid underflows.
+ */
if (num < 1)
{
/// stop here, we should have entries...
@@ -64,7 +64,8 @@ namespace Kernel
if (signature_index == (cAcpiSignatureLength - 1))
{
- kcout << "ACPI: Found the SDT" << endl;
+ kcout << "ACPI: SDT Signature: " << sdt->Signature << endl;
+ kcout << "ACPI: SDT OEM ID: " << sdt->OemId << endl;
return ErrorOr<voidPtr>(reinterpret_cast<voidPtr>(xsdt->AddressArr[index]));
}
}
@@ -74,10 +75,10 @@ namespace Kernel
}
/***
- @brief check SDT header
+ @brief Checksum on SDT header.
@param checksum the header to checksum
@param len the length of it.
-*/
+ */
bool ACPIFactoryInterface::Checksum(const Char* checksum, SSizeT len)
{
if (len == 0)
diff --git a/dev/zka/src/UserProcessScheduler.cc b/dev/zka/src/UserProcessScheduler.cc
index bbe644dc..0081367a 100644
--- a/dev/zka/src/UserProcessScheduler.cc
+++ b/dev/zka/src/UserProcessScheduler.cc
@@ -423,6 +423,12 @@ namespace Kernel
SizeT process_index = 0; //! we store this guy to tell the scheduler how many
//! things we have scheduled.
+ if (mTeam.mProcessAmount < 1)
+ {
+ kcout << "UserProcessScheduler::Run(): This team doesn't have any process!\r";
+ return 0;
+ }
+
for (; process_index < mTeam.AsArray().Capacity(); ++process_index)
{
auto& process = mTeam.AsArray()[process_index];
@@ -430,9 +436,6 @@ namespace Kernel
//! check if process needs to be scheduled.
if (UserProcessHelper::CanBeScheduled(process))
{
- // Set current process header.
- this->CurrentProcess() = process;
-
process.PTime = static_cast<Int32>(process.Affinity);
UserProcessScheduler::The().CurrentProcess().Leak().Status = ProcessStatusKind::kFrozen;
@@ -440,6 +443,9 @@ namespace Kernel
kcout << "Switch to '" << process.Name << "'.\r";
+ // Set current process header.
+ this->CurrentProcess() = process;
+
// tell helper to find a core to schedule on.
if (!UserProcessHelper::Switch(process.Image, &process.StackReserve[process.StackSize - 1], process.StackFrame,
process.ProcessId))
@@ -494,6 +500,10 @@ namespace Kernel
process.Status == ProcessStatusKind::kDead)
return No;
+ if (process.Status == ProcessStatusKind::kStarting &&
+ process.Image)
+ return Yes;
+
if (!process.Image &&
process.Kind == UserProcess::kExectuableKind)
return No;