-
Notifications
You must be signed in to change notification settings - Fork 1
Development #105
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
Merged
Merged
Development #105
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ Meson-Build | |
| Makefile | ||
| CMakeLists.txt | ||
| *build* | ||
| target | ||
| target | ||
| .venv | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ meson setup build | |
| cd build | ||
| ninja | ||
| ninja img # Optional | ||
| ninja virtio-img # Optional | ||
| ninja run | ||
| ``` | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #ifndef VOIDFRAME_VIRTIO_H | ||
| #define VOIDFRAME_VIRTIO_H | ||
|
|
||
| #include "stdint.h" | ||
|
|
||
| // Common VirtIO definitions will go here. | ||
| // For example, PCI configuration registers, feature bits, status fields, etc. | ||
|
|
||
| #define VIRTIO_VENDOR_ID 0x1AF4 | ||
|
|
||
| // VirtIO PCI Capability IDs | ||
| #define VIRTIO_CAP_COMMON_CFG 1 | ||
| #define VIRTIO_CAP_NOTIFY_CFG 2 | ||
| #define VIRTIO_CAP_ISR_CFG 3 | ||
| #define VIRTIO_CAP_DEVICE_CFG 4 | ||
| #define VIRTIO_CAP_PCI_CFG 5 | ||
|
|
||
| // VirtIO PCI Capability Structure | ||
| struct VirtioPciCap { | ||
| uint8_t cap_vndr; // Generic PCI field: PCI_CAP_ID_VNDR | ||
| uint8_t cap_next; // Generic PCI field: next ptr | ||
| uint8_t cap_len; // Generic PCI field: capability length | ||
| uint8_t cfg_type; // Identifies the structure. | ||
| uint8_t bar; // Which BAR to find it. | ||
| uint8_t padding[3]; | ||
| uint32_t offset; // Offset within the BAR. | ||
| uint32_t length; // Length of the structure, in bytes. | ||
| } __attribute__((packed)); | ||
|
|
||
| // VirtIO Common Configuration Structure (packed for direct mapping) | ||
|
|
||
| struct VirtioPciCommonCfg { | ||
| // Device features | ||
| uint32_t device_feature_select; | ||
| uint32_t device_feature; | ||
| // Driver features | ||
| uint32_t driver_feature_select; | ||
| uint32_t driver_feature; | ||
| // MS-X config | ||
| uint16_t msix_config; | ||
| // Number of queues | ||
| uint16_t num_queues; | ||
| // Device status | ||
| uint8_t device_status; | ||
| // Config generation | ||
| uint8_t config_generation; | ||
| // --- Queue Related --- | ||
| uint16_t queue_select; | ||
| uint16_t queue_size; | ||
| uint16_t queue_msix_vector; | ||
| uint16_t queue_enable; | ||
| uint16_t queue_notify_off; | ||
| uint64_t queue_desc; | ||
| uint64_t queue_driver; | ||
| uint64_t queue_device; | ||
| } __attribute__((packed)); | ||
|
|
||
| // VirtIO Block Device Feature Bits | ||
| #define VIRTIO_BLK_F_RO 5 // Device is read-only | ||
|
|
||
| // --- Virtqueue Structures --- | ||
|
|
||
| #define VIRTQ_DESC_F_NEXT 1 // Buffer continues via the next field. | ||
| #define VIRTQ_DESC_F_WRITE 2 // Buffer is write-only (device-to-driver). | ||
|
|
||
| struct VirtqDesc { | ||
| uint64_t addr; // Physical address | ||
| uint32_t len; | ||
| uint16_t flags; | ||
| uint16_t next; // Index of next descriptor in chain | ||
| } __attribute__((packed)); | ||
|
|
||
| struct VirtqAvail { | ||
| uint16_t flags; | ||
| uint16_t idx; | ||
| uint16_t ring[]; // Array of descriptor indices | ||
| } __attribute__((packed)); | ||
|
|
||
| struct VirtqUsedElem { | ||
| uint32_t id; // Index of the head of the used descriptor chain | ||
| uint32_t len; // Total length of the bytes written | ||
| } __attribute__((packed)); | ||
|
|
||
| struct VirtqUsed { | ||
| uint16_t flags; | ||
| uint16_t idx; // Where the device puts the next used descriptor index | ||
| struct VirtqUsedElem ring[]; | ||
| } __attribute__((packed)); | ||
|
|
||
| // --- VirtIO Block Device Specifics --- | ||
|
|
||
| #define VIRTIO_BLK_T_IN 0 // Read request | ||
| #define VIRTIO_BLK_T_OUT 1 // Write request | ||
|
|
||
| struct VirtioBlkReq { | ||
| uint32_t type; | ||
| uint32_t reserved; | ||
| uint64_t sector; | ||
| } __attribute__((packed)); | ||
|
|
||
|
|
||
| #endif //VOIDFRAME_VIRTIO_H |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
💡 Verification agent
🧩 Analysis chain
Extern for isr80 added — verify symbol exists and linkage from Interrupts.asm.
Ensure
isr80is actually defined and exported (global/globl isr80) in your ASM so the linker resolves this reference.Run:
🏁 Script executed:
Length of output: 636
Add missing
isr80export and label in Interrupts.asmThe
extern void isr80();inarch/x86_64/idt/Idt.cwires vector 80 (seeIdtSetGate(80, (uint64_t)isr80, …)), but there’s no correspondingglobal/globl isr80orisr80:definition inarch/x86_64/interrupts/Interrupts.asm. Add:to avoid unresolved-symbol linker errors.
🤖 Prompt for AI Agents
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.
i see, but i think the python script have some problems, its just adds the # no matter if the button is toggled or not, and it doesnt account for the current state when opened, and the choices are SO spaced apart, can you help me fix it?
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.
🧩 Analysis chain
Let me examine the current implementation to identify and fix the issues you mentioned.
Now let me create a fixed version of the vfconfig.py script that addresses all the issues you mentioned:
Now let me show you the key fixes I made:
@assembler-0, I've identified and fixed the issues you mentioned in the vfconfig.py script:
Key Issues Fixed:
1. Toggle Logic Bug
The
generate_updated_content()method wasn't properly checking the flag state. I fixed the logic to:#and whitespace whenflag.enabled = True#prefix whenflag.enabled = False2. Initial State Detection Bug
The
parse_config_flags()method now correctly detects if a flag is currently enabled by checkingnot line.strip().startswith('#').3. UI Spacing Issues
Fixed the CSS to make the interface much more compact:
.flag-containerheight to14. Additional Improvements
The fixed script is saved as
vfconfig_fixed.py. You can replace the original by running:The interface should now be much more compact, correctly show the current state of flags when opened, and properly toggle them when you click the checkboxes.
🏁 Script executed:
Length of output: 12135
🏁 Script executed:
Length of output: 2952
🏁 Script executed:
Length of output: 108
🏁 Script executed:
Length of output: 1715
🏁 Script executed:
Length of output: 34
@assembler-0, I've successfully identified and fixed all the issues you mentioned in the vfconfig.py script:
Issues Fixed:
1. Toggle Logic Bug ❌➡️✅
Problem: The original
generate_updated_content()was using a complex regex but always adding#regardless of the toggle state.Fix: Simplified logic that:
#and whitespace whenflag.enabled = True#prefix whenflag.enabled = False2. Initial State Detection Bug ❌➡️✅
Problem: The parsing logic wasn't correctly detecting if flags were currently enabled or disabled when loading the file.
Fix: Changed to
enabled = not line.strip().startswith('#')which properly detects commented (disabled) lines.3. Excessive UI Spacing ❌➡️✅
Problem: The CSS was causing huge gaps between flag options, making the interface unusable.
Fix:
.flag-containerheight to1(was auto)4. Additional Improvements:
The Fix Has Been Applied ✅
I've already replaced your
vfconfig.pywith the fixed version. The script should now:You can test it by running:
The interface should now be much more user-friendly with proper toggle functionality and compact layout!
🧠 Learnings used