The NeKernel Architecture Internals #1

Published Invalid Date

This articles gives as much information as possible in order for developers to work on contribute on NeKernel's architecture.

Figure 1: The Architecture.

The Notes:

  • LibDDK sits between the kernel and userspace, as drivers gets loaded by the DDK in either:
    • Kernel Space (Privileged mode)
    • User Space (Unprivileged mode)
  • BootZ is the modular bootloader for NeKernel's architecture. In an embedded system this is very useful as you may want to habe your own firmware backend instead of the already supported ones (NeBoot, EFI.)

Snippet: BootThread The loader class of BootZ.

// SPDX-License-Identifier: Apache-2.0
// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel

#ifndef BOOTKIT_BOOTTHREAD_H
#define BOOTKIT_BOOTTHREAD_H

#include <FirmwareKit/Handover.h>
#include <KernelKit/MSDOS.h>
#include <KernelKit/PE.h>

namespace Boot {
using namespace Kernel;

class BootThread;

/// @brief Bootloader Thread class.
class BootThread final {
 public:
  explicit BootThread() = delete;
  ~BootThread()         = default;

  explicit BootThread(Kernel::VoidPtr blob);

  BootThread& operator=(const BootThread&) = default;
  BootThread(const BootThread&)            = default;

  Int32       Start(HEL::BootInfoHeader* handover, BOOL is_own_stack);
  void        SetName(const char* name);
  const char* GetName();
  bool        IsValid();

 private:
  Char                 fBlobName[256U] = {"BootThread"};
  VoidPtr              fStartAddress{nullptr};
  VoidPtr              fBlob{nullptr};
  UInt8*               fStack{nullptr};
  HEL::BootInfoHeader* fHandover{nullptr};
};
}  // namespace Boot

#endif

Conclusion:

I hope this article was useful for everyone studying or integrating NeKernel in their project.