32-bit x86 kernel that I work on because its awesome and I have nothing better to do. I kinda just do whatever I feel like with it because that is fun to do. I do not have a todo list anywhere because I just figure it all out along the way. Perhaps one day I'll write my own bootloader for it but probably not because Multiboot2 is fine enough I feel.
#Word
1 messages · Page 1 of 1 (latest)
Got my scheduler working fine enough with the 2 tests I've done. Hooray!
And by 2 tests I mean I had a process run while another one was running and then deleted it and then went back to process 1
and it didn't crash 100% of the time
this is fire, keep it up 🙏
cool, is the source available anywhere?
It is available here: https://github.com/ajmoritz2/wordOS
GitHub
Word. Contribute to ajmoritz2/wordOS development by creating an account on GitHub.
Whether or not it compiles for anyone but myself is something I have not tested yet and do slightly doubt that it will
Been trying to get this to run on hardware
VMs really do just make it all so easy huh
Okay so progress on the real hardware part. My initial boot page tables decided to not map on real hardware due to some logic i put in
Yep so I gotta use PAE
my computers map the fb above 4 Gi
Might cry or explode or both
Do long mode instead :^)
Probably a better idea, but for some silly/stupid reason 32bit calls my name
Maybe it is a siren song....
Okay ngl PAE is kinda fun
I'm enjoying putting it in
It just kinda makes sense and juggling around pages is so whimsical
Especially because I haven't gotten to the annoying part where I make up for hardcoded mistakes past
32 bit is better than 64 bit
don't listen to the glowies
who cares
fsb are also glowies
So I got my stuff transferred over now but now I gotta figure out how recursive paging is going to work
Or even if I want to do that
Since I still only get 4 gigs of address space, do I want all of that memory just sitting there
Well I guess it's only 8 mini bytes I'm missing out on
Okay I got the fb working when I jerryrig
Now lets try not to be Jerry and start being tom
Okay time to rework my scheduling
Although tbf I think it will be easier this time because I don't have to fuck with cr3
I'll just keep the 3rd entry in the pdpt the same for all processes
And from there change the bottom 3 entries where necessary
Perhaps PAE is a blessing in disguise
Kinda like Shrek 2
We are getting places a bit
Scheduling works on qemu now so just gotta get it to work on hardware
Ngl not sure why this happened but that's a tomorrow problem, not a now problem
okayyyyy stuff kinda works-ish now
uhhhh only issue is spaghetti code didnt set up ps/2 correctly
but ofc it works in qemmu
soooo now comes the fun part of debugging why my ps/2 keyboard doesnt send interrupts on hardware
I know my ioapic works fine, and there isnt an override, so thats good at least
and i also know the ps/2 exists because I get a keyboard scancode and whatnot
which leaves me with I just didn't set it up because a year ago me was more focused on quantity rather than quality work
and since I didn't start doing stuff on hardware until recently, it worked unfortunately
oh yea and my ACPI code needs to be completely reworked at some point because of how ass it is
like cmon why did I do less than the bare minimum when I wrote it the first time
sooooo
now with my properly tested and I guess initialized ps/2 controllor i now have another issue
I think I have to disable legacy usb because I am being told my ps/2 is non-functional
well not really non-functional, but it fails the self test
or whatever the A9 send is called
nvm my code is just ass i guess
0x45 is NOT a valid response
okay yea no its definitly the legacy usb stuff because I'm getting undefined behavior that is not the same every single time
aaaand my bios doesnt have an option dis disable it...
so I guess i have to write a pci driver and whatnot now
wait no im just stupid once again
well possibly
I think what I actually need to do is get rid of function wrappers because they might be fucking with my serial communication too much
or i could also just be stupid +10
is legacy usb is ps/2 keyboard emulation
I think it's supposed to be, but I've read it's hella glitchy and rarely works
ok so i forgot polling the ps/2 existed
but now i remember and the irq not firing is the issue...
not really sure why, so now i guess i check if its enabled or something like that
okay it just straight up wasnt enabled l0000l
yea im a bit slow...
This might be awesome
Okay lmao I should probably zero out memory before I use it
That would be why it make the yellowing
Now all I gotta do is fix up my scheduling to have it work proper and then time for pci!
Ooo interesting bug I've just ran into
I forgot to invalidate the tlb cache but my code works on real hw
It doesn't work on qemu however
This tells me they do their tlbs differently
Kinda funny
Okay so funny issue now
Because my processes are quite separate, I cannot use the terminal unless directly in the terminal process
I feel like I now need to add some sort of IPC, at least at a base level so this issue does not persist
I forgot I would have issues with this
...
okay i've been wrong about all my guesses, and now i m no closer to figuring this out
its something with the scheduling messing with memory i think
Ok I am closer
The pdpt does not change when the process changes
This might be causing issues
(It most definitely is)
I will fix this tomorrow or probably not tomorrow but at least I know a possible cause!
I did not fix this tomorrow
BUTTT
I found out why for reals
My function returns are not saved on process switch or something
So my function caller gets back garbage
Working on stuff is hard
I just haven't
HELP
Well I don't actually need help
I just need time....................,.
I'm gonna freak out
It was exactly what I thought this entire time
Stupid tlb
I was not clearing it at all
So the stack I was using was just not the right one
Now I could either PCIe time or remake my ACPI parser
I think I know which one I'll do
okay actually I'm still debugging this problem l00l
it keeps appearing in new ways
i think the stack is being silly now and switching before I want it to but I can't prove it just yet
and I also just need to spend more time
so hopefully this weekend it should be good because I have time
please
I just wanna rework my acpi parser
and then pcie
and then fs
and then fat or something maybe tar first idk
okay its not my enemy anymore
i forgot my stacks switch, but my esp doesnt for a bit and then I was trying to write to the new one with the old stack pointer, referencing variables from the old one, and then calling a function return with the new, with the frame still on the old. Therefore I did not do anything correctly
will probably have to rewrite this for the 5th time
I was accidentally enabling interrupts again in the middle of my process creation code
Figures the stack would be fucked
Welp now I'm just gonna figure out why sometimes it just forward an instruction with a fast timer speed
Yea so it's because of interrupt gates vs trap gates
Anyhow my memory allocator is bugged I found out, so I gotta go fix that
It doesn't not in fact use memory that was already used but freed under certain circumstances
But now I gotta do hw instead of working on this stuff
Story of the past 2 months
I actually don't know how to find time to do this
It's like once per week I get a chance and it's so sad :(
Forgot to set the new size of memory nodes when splitting nodes...
Time to rework my acpi table parsing now!
Then I can ACTUALLY for real start file systems
oop
did all that, now working on implementing ahci
got pci in a "working" state
pcie because im fancy B)
then yea gonna do ahci but its finals so not yet
idt the code is pushed either...
oh well
til you can segfault printf if you redefine malloc in the code
figured this out testing my realloc fn
took me a second to figure out this was the problem
god I love c
i should probably start posting little itty bitty code snippets in here sometimes huh
Someone might steal my horrible already on the internet code though!!!!!
SATA does not make any sense to me at all
I just cannot wrap my head around what any of the specification means
and then how I combine it all with AHCI
makes no sense whatsoever to me
Nvm it does I've just been putting virtual addresses in spots where they should have been physical
Like it says in the specs
I should probably read them more carefully or something but idc
AHCI is "working"
My MSIs are not
Idk why
Probably I don't have a bit set somewhere
Time to comb through the 2000000 manuals
Checking every single bit
okay the are working now
me when i dont set the pxie bits...
now i gotta have it go to the apic to generate an interrupt on write
Read command is sending but I'm not getting nothing in my data sad face emoji
i cant figure out why im not getting any data
all my bits are set correctly according to my understanding
which is obviosly wrong but dang
do I need to set something else up for DMA access
because i know there exists a DMA setup FIS
but from what I've read that shouldn't matter because it sets up the DMA on the first read request i think???
The read is going through but the data isn't being read
I know it's all happening because qemu tells me in the block stats
But like ts does not transfer over
I also know there is data because I had qemu copy the block to another file and there was more than 0s
Okay I can read it with command 0x20 which is regular sector read
But I really want DMA to be implemented
And it is supported im pretty sure
I will check again, but I know 48 bit addressing is
tspmo im gonna play runescape for a bit now
okay last thing imma try before i explode is reseting the port
but after that i honestly dont know what else to do
okay well I figured it out???
something about my prd table's last entry needs to have the MSB set whatever that means. something something I shifted it over 9 and now it can work???
This isn't specified in ANY of the specs I've read, maybe its in ATA-x but I dont have $70 to spend on a stupid pdf file and I cant find it anywhere online
Busy semester. This will all be on the farthest back simmer burner until it ends
They hate hobbies here
And non-required fun
This does not pertain to my os but I wanna yap about it
I saw a video on lots and lots of recursion
Trillions even
And the end got me thinking
Would it be possible to reduce a return address even farther by jumping into 16 bit mode of the cpu
But I don't think it would be because iirc there isn't paging for 16 bit and it's a whole debacle to jump into it again
You'd have to set up proper segmentation, although that's not tooo hard to do for just this purpose
Maybe this summer I make a kernel specifically tailored to generating the largest amount of recursion possible
Probably not, but maybe...
I mean you wouldn't need an allocator or anything and maybe you'd want apic parsing just to get a basic disk filesystem going
And maybe a compression algorithm although that wouldn't be too hard considering what data would be stored
Idk
Food for thought
who bro talking too 🙏, same i also do that but nice os
I tried pushing a 1gb file on accident
Then I couldn't figure out how to go backwards in commits
I spent two hours last night trying to recover everything and I think it's all bueno now
Now I know for next time!
Hmm my hardware has an ahci controller but idt it has anything connected to it
None of the ports seem to have anything going on
Or at least there are no active ports that don't have a signature 0xffffffff
There is an nvme controller though!
I suspect that is what the drive is connected to, but I really cba writing an nvme driver rn
relatable
I have been chipping away at implementing fat32 as my first filesystem
Oops
I'll just have incurable brain damage in my abstractions and the number of bad decisions I've made will increase by 1
Or actually more than 1
Working with the structs and offsets being weird
I forgot to give them packed attribute
Took me too long to figure out why I was getting nonsensical values from the data
Compiler just added padding
For some reason the cpu needs it to be "even"
Doesn't really need it to be aligned, it's just more efficient
But the compiler will make sure it is the case for efficiency sake and then it makes me sad
I've been reading the Abraham operating systems book and it's so cool to read about all the theory
I've been looking into file systems and idk there are just so many things I've never thought about that have huge impacts
And like they make sense after I read them but I haven't put much thought into it
Just as an easy off the dome example, ssd and hdd are best used with different file systems
Obviously this makes sense, but I've just never thought about it
Also read a paper on PancakeFS
Interesting bit of stuff, I need to look into it more (I just skimmed)
Ugh I can't figure out how I want to store all this stuff in memory
Im thinking about loading a directory every time you want to access it
And then unloaded non accessed ones, although I'll keep the root loaded
Obv this WILL need to change
But I'm just throwing something together for now to keep me going
But only having 1 hour per week to work on this isn't very useful
Oh well maybe over the summer and next semester I'll be able to make real progress
Maybe I should look into other implementations
Actually not maybe, I should
I should and will also write this all out on paper before implementation
Also I suck at string parsing and will now make something that makes it easier and me not be so garbage