diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-01 23:57:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-01 23:57:19 +0200 |
| commit | d445096b8403ad0bdbf0095c50f66ba01fde9f33 (patch) | |
| tree | 4fa3fb3217cf256306bff76fc4509070f651de99 /Private/Source | |
| parent | d190e44fa474808ad31028835f04e4df2c840073 (diff) | |
Kernel: Bringing support 48-bit ATA PIO.
Kernel: Adding support for IPCEP.
Kernel: Improve scheduler, create heap according to process kind.
Kernel: PRD transfer enum for upcoming ATA DMA driver.
Kernel: Add kErrorNoEntrypoint.
NewBoot: Add 48-bit support for ATA PIO.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/ProcessScheduler.cxx | 33 | ||||
| -rw-r--r-- | Private/Source/URL.cxx | 8 |
2 files changed, 20 insertions, 21 deletions
diff --git a/Private/Source/ProcessScheduler.cxx b/Private/Source/ProcessScheduler.cxx index 5d8a7f56..59b9bcea 100644 --- a/Private/Source/ProcessScheduler.cxx +++ b/Private/Source/ProcessScheduler.cxx @@ -146,37 +146,36 @@ void ProcessHeader::Exit(Int32 exit_code) { SizeT ProcessScheduler::Add(Ref<ProcessHeader> &process) { if (!process) return -1; + + if (!process.Leak().Image) { + if (process.Leak().Kind != ProcessHeader::kLibKind) { + return -kErrorNoEntrypoint; + } + } + if (!mTeam.AsArray().Count() > kSchedProcessLimitPerTeam) return -kErrorOutOfTeamSlot; if (process.Leak().Ring != (Int32)ProcessSelector::kRingKernel) return -1; kcout << "ProcessScheduler::Add(Ref<ProcessHeader>& process)\r\n"; - process.Leak().HeapPtr = rt_new_heap(kUserHeapUser | kUserHeapRw); - process.Leak().ProcessId = mTeam.AsArray().Count(); - process.Leak().HeapCursor = process.Leak().HeapPtr; + /// Create heap according to type of process. + if (process.Leak().Kind == ProcessHeader::kUserKind) + process.Leak().HeapPtr = rt_new_heap(kUserHeapUser | kUserHeapRw); + else if (process.Leak().Kind == ProcessHeader::kLibKind) + process.Leak().HeapPtr = rt_new_heap(kUserHeapUser | kUserHeapRw || kUserHeapShared); + else + process.Leak().HeapPtr = rt_new_heap(kUserHeapDriver | kUserHeapRw); process.Leak().StackFrame = reinterpret_cast<HAL::StackFrame *>( ke_new_ke_heap(sizeof(HAL::StackFrame), true, false)); MUST_PASS(process.Leak().StackFrame); - UIntPtr imageStart = reinterpret_cast<UIntPtr>(process.Leak().Image); - - process.Leak().SetEntrypoint(imageStart); - mTeam.AsArray().Add(process); - if (!imageStart && process.Leak().Kind == ProcessHeader::kUserKind) { - process.Leak().Crash(); - } - - if (!imageStart && process.Leak().Kind == ProcessHeader::kDriverKind) { - if (process.Leak().Ring == 3) - process.Leak().Crash(); - else - ke_stop(RUNTIME_CHECK_PROCESS); - } + process.Leak().ProcessId = mTeam.AsArray().Count() - 1; + process.Leak().HeapCursor = process.Leak().HeapPtr; return mTeam.AsArray().Count() - 1; } diff --git a/Private/Source/URL.cxx b/Private/Source/URL.cxx index fba6bca9..c384c378 100644 --- a/Private/Source/URL.cxx +++ b/Private/Source/URL.cxx @@ -16,10 +16,10 @@ Url::Url(StringView &strUrl) : m_urlView(strUrl, false) {} Url::~Url() = default; constexpr const char *kURLProtocols[] = { - "https", // http with tls. - "http", // http - "file", // filesystem protocol - "ftp", // file transfer protocol + "file", // Filesystem protocol + "ping", // Ping protocol. + "telnet", // Telnet protocol + "ssh", // SSH protocol }; constexpr const int kUrlOutSz = 3; //! such as: :// |
