Skip to content

Conversation

@KitsuneSemCalda
Copy link
Contributor

No description provided.

KitsuneSemCalda and others added 30 commits October 21, 2025 22:33
avoid the archicteture related from non-archicteture related
to start the vga, serial and jump to early_init
is redudant, bug generator, garbage ... etc.
* feat(log.h): add a function kdebug to make a trace of code

* build(xmake): add flags to ignore narrowing or conversion constant

* refactor(kdebug): add a trace code on gdt/tss initialize

* refactor(kdebug): add a log tracing on InterruptController

* refactor(kdebug): add kdebug to tracing 8259Pic

* refactor(kdebug): add a trace debug on apic

* refactor(kdebug): add a kdebug log on Physical Memory Manager to follow execution

* refactor(kdebug): add a log trace on TLSF-Heap

* refactor(kdebug): add tracing log on VirtualMemoryManager

* refactor(kdebug): put kdebug to tracing pit

* refactor(kdebug): add a kdebug to tracing on filesystems

* refactor(kdebug): add a tracing debug on cpu
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

15 similar comments
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.


- [ ] Create a Adapter class to `BlockDevice`

- [x] Create a base class **Hardware Interrupt** to be inherited by ([8259Pic](https://en.wikipedia.org/wiki/Intel_8259) / [APIC](https://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller) ...)

Check warning

Code scanning / Markdownlint (reported by Codacy)-1-19216319227

Expected: 80; Actual: 208 Warning

Expected: 80; Actual: 208
- [ ] Create a Adapter class to `BlockDevice`

- [x] Create a base class **Hardware Interrupt** to be inherited by ([8259Pic](https://en.wikipedia.org/wiki/Intel_8259) / [APIC](https://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller) ...)
- [x] Create a base class **Timer** to be inherited by ([PIT](https://en.wikipedia.org/wiki/Programmable_interval_timer), [APIC Timer](https://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller#APIC_timer) ...)

Check warning

Code scanning / Markdownlint (reported by Codacy)-1-19216319227

Expected: 80; Actual: 224 Warning

Expected: 80; Actual: 224
- [ ] Enforce memory protection between user processes and kernel.

- [ ] **Advanced Memory Management:**
- [ ] Implement kernel heap for dynamic allocations (already has TLSFHeap, but ensure it's robust).

Check warning

Code scanning / Markdownlint (reported by Codacy)-1-19216319227

Expected: 80; Actual: 101 Warning

Expected: 80; Actual: 101

- [ ] **File System Enhancements:**
- [ ] Implement a real disk filesystem (e.g., FAT32, ext2/3/4).
- [ ] Extend VFS with full POSIX file operations (e.g., `stat`, `link`, `unlink`, `mkdir`, `rmdir`).

Check warning

Code scanning / Markdownlint (reported by Codacy)-1-19216319227

Expected: 80; Actual: 102 Warning

Expected: 80; Actual: 102
- [ ] Implement a basic network driver (e.g., for a virtual NIC in QEMU).
- [ ] Implement a basic USB driver.

### Toolchain

Check notice

Code scanning / Markdownlint (reported by Codacy)-1-19216319227

Multiple headings with the same content Note

Multiple headings with the same content
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawfinder (reported by Codacy)-0-19216309139 found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark-lint (reported by Codacy)-18-19216309139 found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

uintptr_t lapic_base = 0; ///< Mapped LAPIC base
uint64_t apic_ticks_per_ms = 0; ///< Timer ticks per ms

uint32_t read(uint32_t reg);

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Error

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20).

String m_name = "IOAPIC";

uint32_t read(uint32_t reg);

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Error

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20).
///< (heap-allocated)
uint32_t lba_first; ///< LBA of the first sector of the partition
uint32_t sectors_count; ///< Total number of sectors in the partition
uint8_t type; ///< Partition type identifier (e.g., MBR partition type)

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Error

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362).
* @param offset Offset in the partition to start reading from
* @return Number of bytes read on success, negative error code on failure
*/
static int read(VNode *vnode, FileDescriptor *fd, void *buffer, size_t size,

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Error

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20).

/**
* @brief Block device interface for ATA devices
*

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Error

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362).
* @return 0 on success or negative on error.
*/
inline int open(FileDescriptor *fd, int flags) {
int ret = ops && ops->open ? ops->open(this, fd, flags) : 0;

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Error

Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362).
char buf[512]; ///< Temporary buffer for formatted message
va_list args;
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. Error

If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification.
inline String operator+(const String& lhs, const char* rhs) {
if (!rhs) return lhs;
String result;
result.reserve(lhs.length() + strlen(rhs) + 1);

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Error

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126).
inline String operator+(const char* lhs, const String& rhs) {
if (!lhs) return rhs;
String result;
result.reserve(strlen(lhs) + rhs.length() + 1);

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Error

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126).
* @param s Null-terminated C-style string.
*/
constexpr StringView(const char* s) noexcept
: m_data(s), m_size(s ? strlen(s) : 0) {}

Check failure

Code scanning / Flawfinder (reported by Codacy)-9-19216319227

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Error

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126).
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawfinder (reported by Codacy)-0-19216319227 found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark-lint (reported by Codacy)-18-19216319227 found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@KitsuneSemCalda KitsuneSemCalda merged commit 6ee6b6f into main Nov 9, 2025
36 of 40 checks passed
@KitsuneSemCalda KitsuneSemCalda deleted the refactor-FKernel branch November 9, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants