Before creating folders, you must answer the 5 questions.
- educational
- research
- minimalist
- extensible
This affects:
- complexity
- flexibility
- number of abstraction levels
Minimum set:
- run
- manage memory
- manage execution
- respond to events
Everything else is optional.
It is very important to explicitly state:
- no binary compatibility
- no legacy
- no automagic
Don't implement – name and describe.
Required subsystems:
Responsible for:
- taking control
- initialization
- transitioning to the running state
Responsible for:
- processor modes
- execution context
- switching
Responsible for:
- memory accounting
- isolation
- allocation
Responsible for:
- hardware events
- timers
- system responses
Responsible for:
- tasks
- processes
- scheduling
Common mechanisms:
- synchronization
- queues
- basic data structures
Use non-random folder names What's important for the system and for understanding you, not drt/tree, etc.
We will always use the following structure:
kernel/
├─ entry/
│ └─ start
├─ platform/
│ └─ cpu
│ └─ memory
│ └─ interrupts
├─ core/
│ └─ scheduler
│ └─ execution
│ └─ events
├─ services/
│ └─ sync
│ └─ time
│ └─ objects
├─ internal/
│ └─ types
│ └─ config
│ └─ contracts
The most common mistake is shifting responsibility.
You must decide in advance:
- who can call whom
- who CANNOT
- where is the single entry point
Example:
- entry → platform
- platform → core
- core → services
- services DO NOT interfere with platform