-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor f kernel #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
avoid the archicteture related from non-archicteture related
to start the vga, serial and jump to early_init
is redudant, bug generator, garbage ... etc.
…_mode to change test mode
* 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
|
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
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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
| - [ ] 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
| - [ ] 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
|
|
||
| - [ ] **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
| - [ ] 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
There was a problem hiding this 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.
There was a problem hiding this 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
|
|
||
| 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
| ///< (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
| * @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
|
|
||
| /** | ||
| * @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
| * @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
| 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
| 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
| 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
| * @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
There was a problem hiding this 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.
There was a problem hiding this 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.
No description provided.