#Lumen
1 messages ยท Page 1 of 1 (latest)
Severance?
?
Show
osdev starter pack: limine template
They didntuse the template as stated in chat
what chat?
#osdev-misc-0 message
yes... I should know about all the message being sent everywhere
you should
bad on your part if you don't
smh
mb
so uh, what this
I'll connect my brain to discord
I just saw thread button and clicked cause bored
no
lmao
what's the point of having a filesystem if you don't even output anything?
always start with the starter pack
just write a shitty audio driver and make it just play never gonna give you up on boot
and do nothing else
shit that's a great idea
THIS
make it the perfect meme os
actually make it display a single image, the caked up luigi
but you need to actually use the framebuffer, so just loop nyan cat
good idea from my friends : make it a python interpreter (without libs)
libraries

own them liberals and write nyan cat in that python interpreter
gotta make myself something to eat first
the kernel is very mysterious and important
its used for microdata refinement
it has confidential informations
Displaying text isn't too hard
flanterm
and nanoprintf for printf
Oh yeah, that too lol
welp that works
I'd like to be lib independant later but for now it does the job
it was actually very simple lol
btw what res is the limine framebuffer ?
?
you can get it from the response
or
set it yourself
I guess it isn't 1920x1080
the fb response has the values
let's see now that I can print text ๐
you can set it like this
or do that
thanks for the info tho
now what should I do ?
memory management ?
first I'm gonna work on a good kprintf implementation
Do you have a GDT and IDT? (This might be a stupid question but imma ask just in case)
not yet
Ah okay, yeah you have to set those up first
After you finish that ofc
hell yeah
Awesome!
now time for the GDT and IDT
ok I don't understand anything
that's so cool
maybe I should stop there for today
enough coding
doesn't limine set them at boot time ?
Yeah, but they're kind of barebones, the kernel's supposed to set them up itself once it's booted
oke
ok I'm lost
my brain doesn't want to understand somehow
I'm pretty sure it's something actually easy
why don't newbies understand that using llm for this results in literally nothing
it makes your situation works, because you offload your thinking to chatgpt
I might wanna take a look at the Intel SDM
I think I am getting it
if I'm not wrong that's the way
L: Long-mode code flag. If set (1), the descriptor defines a 64-bit code segment. When set, DB should always be clear. For any other type of segment (other code types or any data segment), it should be clear (0).
does this mean I should set it to 0 for my data seg ?
(sounds stupid but we never know I just wanna be sure)
I believe so?
I believe so too
at this point we'll see if it works or breaks lmao
maybe I'm doing shit
programming be like
now I guess I need to do a smol bit of assembly to load the gdt
yep I'm defo wrong either on the asm or in the gdt
I guess it's not in the gdt itself if I can do lgdt without problems
or is it ?
man idk
That's not necessarily true, iirc it doesn't really matter what's in the GDTR until you try to reload the Segment Registers (so if you haven't loaded the GDT properly things are gonna go wrong)
Or I suppose a better way of phrasing it is changes in the GDTR don't take affect until the segment registers are reloaded
because I tried doing that with inline assembly (with as syntax ofc)
What segments do you have in your GDT?
code and data
Also I believe it's recommended to write a assembly subroutine instead of using inline assembly
null as first entry
can you give qemu logs? (just use -no-reboot -no-shutdown to make sure it doesn't reboot and -d int to see all interrupts being fired)
oke
thanks to you I just saw an error in my makefile
I defined my qemu flags in a variable QEMU_FLAGS and it was referenced as QEMUFLAGS so it wouldn't work
oh, yeah that would be a problem XD
there's a lot of things
just send the entire log

you can use pastebin
Ah, you're getting a Page fault and then a General Protection Fault
so it means ?
Uhh, I don't totally know XD. But my guess is you're loading the GDT wrong
np!
I'm gonna write it in a separate .asm file
with nasm syntax I guess it should be easier
I just copy pasted what was written in the wiki gdt tutorial page (as long as I understand what I'm writing it's okay ig)
well at least now I know the problem comes from my gdt
That's a start!
because the asm should be good now
so the fault comes from the gdt
holy shit it works
I found the problem
find the difference between this :
and that :
-# I feel very stupid rn
YAY!
that's a big hell yeah
now time for the IDT
for now I don't need a more complicated gdt as I'm not going in usermode for now nor dealing with multitasking
It's all apart of learning!
that's why I'm here
problems are the (un)funny part of programming
oh wait no
the problem is still here
-# I feel stupider
-# I didn't look at the window title being "QEMU (paused)"
I think I know where I messed up
gimme a sec
ah
I'm using the whole gdt as the address of the gdt
that's a problem
well that's a thing but qemu still crashes
asked it to print 0 in hex and then the value in hex and it shows me this
so it's not my kprintf impl that is causing a problem
apparently my gdt doesn't have an address
it's not null it's just
im gonna cry
it was
here's the real one
(0xFFFFFFFF was just for testing)
yeah, that looks much better
I might aswell just rewrite my entire gdt code
BIGGEST HELL YEAH IN LIFE
QEMU DIDN'T PAUSE
WHICH MEANS IT WORKS
IT'S 4:30 AM I CAN FINALLY GO TO SLEEP
๐ ๐ ๐
great job!
now I'm gonna work on the IDT
well that's even more confusing than the gdt
not by not reading
and I will understand the idt too
I am reading rn
I recommend using code formatter if you don't use it already. Makes code look all good lookin
never thought about it
Oh and by the way, you can use pre-commit git hook so it automatically formats the code before commiting to the stash
ew
What?
honestly I like the way I write my code
Code formatter lets you make it format code how you want
there's also this site:
https://zed0.co.uk/clang-format-configurator/
I mean I see pretty little need for a formatter. It's not super hard to format clean code yourself as you go.
I get it if it's a project with multiple people where your editors might do different things automatically
but that's not really the case for a personal project
for now I don't have a big codebase, even if I wanted to format my code I'd do it by hand
and for now I want to get to work on the isr
wait can I use the interrupt gcc attribute so I can write my handler in C ?
but it also limits my control over it...
meh better do some asm
you can but I recommend just doing it in asm
can I make the base of it in asm, and then call a c function for like displaying information ?
yes
good
so basically what I need to do is :
- pushad
- call the c func
- popad
- iret
?
oh wait
no pushad and no popad in long mode
yeah
so I'll have to push all regs myself
just make a macro to push/pop everything
Its fantastic for projects with many people contributing though i really agree you should format your code from the getgo, otherwise its a pain to read and modify
I'm gonna stop there for the week end
if you can get past setting up paging i will officially consider myself dumb
bet
ok so right now I have a physical memory allocator ig
time for paging itself
(I didn't work much these last days now I'm back (I think ?) )
@halcyon breach you stupid af gang
what ๐ญ
yes im stupid
i dunno how i coudlnt get past implementing paging
stfu
most useless comment on a thread
for hobby osdev
don't be a dickhead
dw paging's hard it took me a little while to get it too, it's easier after the first time you'll learn to love it
Yep. Takes quite a while to get a good implementation done.
It's one of the first "big" components you write which require following documentation, which is hard if you've never worked with documentation before.
People that get paging done very fast (usually) either:
- Have done it before
- Copy pasta from tutorial
- Have something half working