klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
sdfgsdfg has joined #osdev
sprock has quit [Ping timeout: 240 seconds]
sprock has joined #osdev
<Ameisen> I still couldn't come up with a general solution
<Ameisen> GCC unfortunately ignores __attribute__((const)) on a lambda.
ajoberstar has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]
sdfgsdfg has quit [Quit: ZzzZ]
sonny has joined #osdev
gog has joined #osdev
stosby has joined #osdev
sonny has quit [Ping timeout: 240 seconds]
MrBonkers has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
MrBonkers has joined #osdev
sdfgsdfg has joined #osdev
CaCode has joined #osdev
sonny has joined #osdev
gxt has quit [Ping timeout: 276 seconds]
gxt has joined #osdev
CaCode_ has joined #osdev
CaCode- has joined #osdev
CaCode has quit [Ping timeout: 240 seconds]
CaCode_ has quit [Ping timeout: 240 seconds]
sonny has left #osdev [Closing Window]
xing_song has quit [Read error: Connection reset by peer]
sdfgsdfg has quit [Quit: ZzzZ]
xing_song has joined #osdev
stosby has quit [Read error: Connection reset by peer]
xing_song has quit [Read error: Connection reset by peer]
xing_song has joined #osdev
xing_song has quit [Read error: Connection reset by peer]
xing_song has joined #osdev
xing_song has quit [Read error: Connection reset by peer]
xing_song has joined #osdev
nyah has quit [Ping timeout: 240 seconds]
CaCode- has quit [Quit: Leaving]
blockhead has quit []
wand has quit [Remote host closed the connection]
wand has joined #osdev
mahmutov has joined #osdev
mahmutov has quit [Ping timeout: 256 seconds]
x88x88x has joined #osdev
freakazoid333 has quit [Ping timeout: 252 seconds]
ElectronApps has joined #osdev
xing_song has quit [Read error: Connection reset by peer]
xing_song has joined #osdev
stosby has joined #osdev
pretty_dumm_guy has joined #osdev
ravan has quit [Remote host closed the connection]
ravan has joined #osdev
xing_song has quit [Read error: Connection reset by peer]
xing_song has joined #osdev
xing_song has quit [Read error: Connection reset by peer]
xing_song1 has joined #osdev
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
xing_song1 has quit [Read error: Connection reset by peer]
diamondbond has joined #osdev
xenos1984 has quit [Quit: Leaving.]
ElectronApps has quit [Remote host closed the connection]
bradd has quit [Quit: No Ping reply in 180 seconds.]
bradd has joined #osdev
diamondbond has quit [Ping timeout: 260 seconds]
xenos1984 has joined #osdev
Vercas8 has joined #osdev
Vercas has quit [Ping timeout: 276 seconds]
Vercas8 is now known as Vercas
wolfshappen has quit [Ping timeout: 240 seconds]
ElectronApps has joined #osdev
gog has quit [Ping timeout: 245 seconds]
gog has joined #osdev
GeDaMo has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
sortie has quit [Quit: Leaving]
sortie has joined #osdev
gog has quit [Read error: Connection reset by peer]
gog has joined #osdev
<gog> mew!
* moon-child pets god
* gog purrs and offers blessings
* moon-child gives behind-ear and under-chin scratches
mctpyt has quit [Ping timeout: 245 seconds]
nyah has joined #osdev
Bonstra has quit [Remote host closed the connection]
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
Burgundy has joined #osdev
ahalaney has joined #osdev
dennis95 has joined #osdev
nj0rd has quit [Quit: WeeChat 3.4]
nj0rd has joined #osdev
stosby has left #osdev [WeeChat 3.4]
<j`ey> if I have a .S file, that has .section .init, "ax", and then a bunch of functions, is there a guarantee the linker or something wont change the order?
<zid> if you have no .cfi directives or whatever it can't even tell which bit is in which function
<zid> it's just some .text with some code in it
<j`ey> true
<j`ey> it has the .global stuff.. but those are just labels i guess
<Mutabah> pretty sure the linker can only shuffle segments (well, segments from files) - it can't re-order within the file-segment
<zid> function sections has been a thing for a while, not sure how much the linker has to be aware of that though
<zid> or if it's just gcc or whatever doing .text.function34
<Mutabah> zid: They're just different sections for each function
<zid> which would require none being aware
<j`ey> Mutabah: segments ~= sections?
* Mutabah is away (Sleep)
<j`ey> damnit!
<Mutabah> ... right when I set away
<j`ey> :-)
<Mutabah> segments are a load-time concept
<Mutabah> segments are defined using the contents of sections
<Mutabah> e.g. there'd be a read-execute segment that contains .text and .rodata, followed by a read-write segment that contains .data and .bss
* Mutabah vanishes for real
<j`ey> oh right
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
<zid> elf calls them program headers
<zid> idk why
scoobydoo has quit [Remote host closed the connection]
scoobydoo has joined #osdev
x88x88x has quit [Ping timeout: 240 seconds]
x88x88x has joined #osdev
ElectronApps has quit [Remote host closed the connection]
mahmutov has joined #osdev
freakazoid343 has joined #osdev
x88x88x has quit [Ping timeout: 240 seconds]
UsbSick has quit [Read error: Connection reset by peer]
x88x88x has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
mctpyt has joined #osdev
scoobydoo has joined #osdev
dude12312414 has joined #osdev
xenos1984 has quit [Quit: Leaving.]
UsbSick has joined #osdev
x88x88x has quit [Ping timeout: 240 seconds]
mahmutov_ has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
mahmutov has quit [Ping timeout: 256 seconds]
x88x88x has joined #osdev
xenos1984 has joined #osdev
dennis95 has quit [Quit: Leaving]
jimbzy has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
jimbzy has joined #osdev
x88x88x has quit [Ping timeout: 260 seconds]
x88x88x has joined #osdev
mahmutov_ has quit [Ping timeout: 240 seconds]
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
sonny has joined #osdev
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
mahmutov_ has joined #osdev
elastic_dog has quit [Ping timeout: 240 seconds]
sonny has quit [Ping timeout: 240 seconds]
elastic_dog has joined #osdev
ravan has quit [Remote host closed the connection]
jimbzy has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
dude12312414 has joined #osdev
sonny has joined #osdev
rb has quit [Read error: Connection reset by peer]
rwb has joined #osdev
rwb is now known as rb
<Ameisen> I did some testing on string comparisons for empty/null in C#: https://tinyurl.com/yxjtd4vq
<bslsk05> ​redirect -> sharplab.io: SharpLab
<Ameisen> thought someone might find it interesting.
<Ameisen> we actually did a breakdown of s == "" in the csharp channel to realize that if your string is empty but not the exact same object as "", it takes a rather horrible codepath
x88x88x has quit [Ping timeout: 240 seconds]
sonny has quit [Ping timeout: 252 seconds]
mimmy has joined #osdev
x88x88x has joined #osdev
x88x88x has quit [Ping timeout: 240 seconds]
sonny has joined #osdev
sonny has quit [Client Quit]
gxt has quit [Remote host closed the connection]
immibis_ has joined #osdev
gxt has joined #osdev
x88x88x has joined #osdev
biblio has joined #osdev
nvmd has quit [Quit: Later, nerds.]
biblio has quit [Client Quit]
jimbzy has joined #osdev
wolfshappen has joined #osdev
darkstardevx has joined #osdev
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #osdev
sdfgsdfg has joined #osdev
mimmy has quit [Ping timeout: 240 seconds]
Burgundy has quit [Ping timeout: 256 seconds]
Burgundy has joined #osdev
mimmy has joined #osdev
mimmy has quit [Ping timeout: 240 seconds]
mahmutov_ has quit [Ping timeout: 268 seconds]
ahalaney has quit [Quit: Leaving]
GeDaMo has quit [Remote host closed the connection]
UsbSick has quit [Remote host closed the connection]
gog has quit []
gog has joined #osdev
mimmy has joined #osdev
mimmy has quit [Ping timeout: 256 seconds]
<kazinsal> geist: have you run into any issues with enabling MSI on devices behind bridges? I'm running into one where no matter what I do I can't actually set the enable bit in the MSI control word and I'm wondering if it's because VMware "helpfully" gives each device its own bridge
biblio has joined #osdev
<zid> something something bus mastering
<geist> hmmm, perhaps you have to enable something on the bridge?
<zid> bus mastering? :p
<geist> and re: device per bridge, i think that's essentially a PCIe thing by spec
<geist> i think you can still stuff built in devices on bus 0, but for the most part each socket is supposed to have its own bridge for some reason
<kazinsal> interesting, I'll try frobbing the bridge a bit
<geist> but i might give it a try in a sec anyway, grabbed an unused ryzen box and setting it up for some os hackery. even have an actual i210 to plug into it
<geist> might need to ask you some questions about grub + PXE in a sec
darkstardevx has quit [Read error: Connection reset by peer]
<kazinsal> for sure
mimmy has joined #osdev
<geist> zid: reminds me, did you see i found the problem? qemu emulation bug with e1000e
<geist> only with plain MSI, so it's probably why it's not well tested, since the device also exports MSI-X
mimmy has quit [Ping timeout: 240 seconds]
<zid> yea more or less
<zid> I was erm, there, I think
<geist> ah i thought only kaz was active at the time. but anyway, interesting stuff
<geist> now i know a bit more how the interrupt delay stuff works. it's not bad, basically a freebie
<geist> and with e1000e you have to set it anyway
<geist> if you leave it at zero, which is invalid according to the manual, the driver hard codes it to 128µs
<kazinsal> aha, I am Doing Something Wrong
<kazinsal> as MSI doesn't get enabled on qemu either
<kazinsal> lowermost bit of the control word is still zero after being written to
<geist> does it work for things not on the other side of a bridge?
<geist> ah okay
<geist> fwiw here's the code i cobbled together to enable MSI: https://github.com/littlekernel/lk/blob/wip/pci/dev/bus/pci/bus_mgr.cpp#L449
<bslsk05> ​github.com: lk/bus_mgr.cpp at wip/pci · littlekernel/lk · GitHub
<kazinsal> might take a peek at that if I get stuck here. the data and address fields get written to properly but not the control field
darkstardevx has joined #osdev
<geist> yah also take care to note 64bit vs 32bit, it changes the layout annoyingly
<geist> though it doesn't move the control register (offset 2)
mimmy has joined #osdev
<bslsk05> ​IRCCloud pastebin | Raw link: https://irccloud.com/pastebin/raw/ImDKd6fr
<kazinsal> time to dive back into whatever pitiful documentation exists that I can find without needing to give PCI-SIG a paycheque
<geist> yah honeslty i didn't most of it just using the osdev wiki
<geist> had to dive in the real docs a bit to get a feel for how capabilities work though
<geist> s/didn't/did
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<kazinsal> oh, derf. wild guess figured it out. turns out I've never actually *written* an unaligned 16-bit field to the PCI config space and my wrapper for that doesn't work right.
<kazinsal> today's entry in "bugs that are half a decade old"...
<geist> yah i was literally just thinking that a few seconds ago, like maybe the 16bit write accessor is busted
<geist> but figured you'd find it soon enough
<kazinsal> I searched my codebase for `KePCIConfigWrite16` and turns out that my MSI code was the only place to use it...
<geist> trying to keep from helicopter debugging everyone stuff all the time
<kazinsal> totes
<geist> also note you need to do the lapic EOI thing now in case you hadn't already. that took some amount of reworking, since i had never wired that up yet
<kazinsal> yep, got that thrown into my interrupt mess
<kazinsal> awesome, now getting interrupts over MSI
<geist> was thinking about it. i *guess* it's dangerous to over EOI lapic stuff, like even after plain PIC ones, since you might accidentally EOI a new irq
<geist> so i had to add the whole 'what type of IRQ is this vector' struct and whatnot to make sure i do it right
<kazinsal> yeah, I was considering the same so I EOI only on MSI vectors
<kazinsal> LAPIC EOI*
<geist> also as i was re-reading the lapic section in the intel manual it mentions that you explicitly dont EOI things like NMI and INIT/STARTUP/etc
<geist> though i guess most of that isn't a general concern
<geist> since those dont come in as what appears to be hardware irqs
<gog> mew
blockhead has joined #osdev
<junon> Welp dealing with my first phys-sec threat against me on Github right now. Wild stuff.
<junon> All because I deleted a super abusive comment on one of my repos lol.
<junon> I don't want to say much about it publicly but wow, not fun to read some of the stuff I just read lol.
<geist> ugh, sorry about that
sdfgsdfg has quit [Quit: ZzzZ]
<junon> The individual in question uses the third person, sometimes plural, to refer to themselves. They believe that serial murder being criminalized is "hubris". They believe tyrants (implicitly, like me) would be killed and replaced in the "real world". They also reside not too far from me.
<junon> So Github is investigating now lol.
ohnx has joined #osdev
<junon> They have multiple repositories with pages and pages of, uh... "prose", if you can call it that, talking about their beliefs and stuff - mostly incoherent. It's clear they have some problems, but it's not fun to have such anger directed at oneself.
<kazinsal> this sounds like someone we know
<zid> also known as psychotic ramblings
<junon> I don't even want to maintain the repo that they were commenting on ._. I don't like maintaining node.js anymore.
<junon> kazinsal: yeah thought the same thing. Different 'vibe' though, not the same individual I don't think.
<junon> But yeah, I thought the same thing haha
<junon> node.js stuff*, not node.js proper, sorry
<kazinsal> "repository archive due to project being rewritten in a real programming language"
<kazinsal> archived*
<junon> I'd make the news if I did that
* blockhead would love to find that node.js is no longer being maintained ;)
<junon> it has 100 million+ downloads per week
<junon> I'm the sole maintainer >.>
<kazinsal> oh no
<kazinsal> are you the person behind leftpad()
<junon> no no but I totally understand the frustrations lol
<blockhead> leftpad? i used to use metapad when i ran windows and i run leafpad now.
<blockhead> run as in use, not as in i'm the programmer of it, btw
<zid> junon: Not even good enough to maintain leftpad? smh :(
<junon> blockhead: we're talking about different things haha
<zid> one day you'll get there
<bslsk05> ​www.theregister.com: How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript • The Register
<blockhead> don't use javascript. next. :p
<kazinsal> always relevant
<junon> zid: I maintain two of the top-3 repositories on npm
<zid> junon: My comiserations
<junon> that diagram is accurate.
* blockhead reads
<junon> HAHA
<blockhead> dear lord, this is so many levels of stupid that i'm in pain
<junon> solution: grunt
<junon> problem: grunt
<junon> solution: gulp
<junon> very, very true
<zid> javascript eco is infact, many levels of stupid
<zid> browsers weren't supposed to be turing machines
darkstardevx has quit [Remote host closed the connection]
<junon> problem: gulp takes 35 seconds to rebuild 1 line of javascript into a debug bundle
<junon> solution: rewrite it in rust (esbuild)
<junon> I agree
<blockhead> this is almost as bad as the package for either python or perl that tells if you a number is even or odd
<junon> Javascript was not meant to do any of what it does. And the fact that the language standards committee accepts literally anything into the standard is a huge problem too.
<zid> The day the web got falling snowflakes on every page at christmas is the day the web died :P
<zid> so like, 2004
<junon> I miss the days of the windows 98 cursor with trails
<zid> I *miss* DHTML now
* blockhead always thought of javascript as bad html and should be purged accordingly. what you'd just linked me to only further confirms this.
<zid> What I wouldn't give for 4 lines of slow javascript on select pages to do stupid effects, rather than 4000000 lines on every page doing god knows what
<zid> (other than reimplementing half my browser itself in an ad-hoc fashion)
<zid> dropdown widgets? I think you mean 10kB of CSS that requires four external requests.
scoobydoo has quit [Read error: Connection timed out]
<junon> OS doesn't do what you want? Use a browser! Browser doesn't do what you want? Use a fuck ton of javascript! Javascript doesn't do what you want? Use webassembly! Webassembly doesn't do what you want? Use Electron with native modules!
<junon> A web app's lifecycle isn't complete until it's living rent-free on your machine using 500MiB of ram just to boot up.
<junon> (this, plus the super pushy, rude, thankless Node.js community, are why I don't like doing Node.js anymore)
<zid> Using 0 existing technologies that aren't part of a framework you made
<zid> on top of someone else's
<junon> And also why almost every other Node.js maintainer I've ever worked with, respected, met, etc. has left the scene, too.
<blockhead> then run an os in the web assembly in the broswer? :p
<zid> I know the old joke is that people who do web "aren't real programmers" and people who say it get looked down on, but tbh, I'm started to agree more and more
<junon> And now this person writing this stuff is kind of, eh... idk. Makes me want to leave the Node.js community entirely, too. I'm not far off.
<zid> whatever it is they're doing? That isn't what I do
<blockhead> oh, and dockerize it ;)
scoobydoo has joined #osdev
<junon> my package gets 10x downloads over React. Anything I do to it makes about 20 people immediately open tickets with garbage.
<junon> Github does nothing for it either.
<junon> Reported abuse time and time again with little to no response. Hopefully telling them "hey my physical security is being pushed a bit" gets their attention.
<junon> Anyway. Had to rant, sorry for the hubbub in here haha. I know it's not related.
<blockhead> your story interesting and informative in its own way
<junon> I like the people in this channel more than pretty much any other corner of the internet anyway
* blockhead agrees. i should hang here more often but I'm not actually making an OS at this time
* blockhead reads about things like forth on a boot sector and then gets the urge to write one
<junon> Only place I've been able to ask noob questions in a while. Feels nice.
<junon> Reminds me of when I was just starting out actually. The wealth of knowledge across everyone in here is always astounding to me.
<junon> Asking a single question and someone who had been lurking for weeks emerges and just knowledge-dumps a wall of text. Gets me pumped every time. I love it.
<zid> You're just still only asking babby questions is all ;)
<junon> That's okay
<zid> ask something that isn't x86 in the first few chapters and watch the tumbleweeds
<junon> Probably true. I enjoy being the babby for now though. Been a minute since I've been challenged like this. Having a clear vision of what I want the end result to be, and having to fill in 100% of the in-between, asking dumb questions, etc. My professional work is usually straightforward - not necessarily boring, just familiar and safe.
mimmy has quit [Ping timeout: 240 seconds]
<zid> I give it a few weeks until you've done more crap than I have
<junon> x86 has a lot of moving pieces and a lot of the "why" questions have weird answers lol. I understand something best when I understand the motivations behind the design, and x86... is hard to understand lol
<zid> you could always just go forwards through time
<blockhead> on an off i've been trying to learn x86 and ... yeesh, what an ugly mess
<zid> Imagine transistors cost 10 cents each to sell in a design and.. it makes a hell of a lot more sense
<klange> don't bother
<junon> A lot of "oh it must be that way because someone smarter than me knows something I don't" but then finding out "nope someone at IBM made a dumb mistake" lol
* blockhead misses z80 assembly. that was nice
<klange> wasted my entire life with this shit, gotten me nowhere
<junon> I saw your tweet klange
<zid> x86 is very sprawling though, it's barely worth knowing about even half of it
<junon> Do you think you'll revisit the OS stuff at some point?
<blockhead> it may be i can get by with a subset of the instruction set
<ohnx> is there anything that I need to do (e.g. passing args) with i386 qemu do get its timer/PIC to work? I think I told the PIC to remap to 0x20 and 0x28, my isr should be working correctly (the handler gets called when I have asm instructions to int 0xsomething), and i think i initialized the timer, but i don't seem to be seeing any timer ticks hit my interrupt handler
<zid> sounds like you failed to init the pic and/or timer how you imagined you did
<junon> ohnx: did you unmask the relevant interrupts?
<ohnx> the mask is set to 0 rn
<ohnx> zid: is there some way to verify stuff like the pic being set up correctly
<junon> qemu has `info pic` I think
<zid> info ioapic
<junon> ^ yeah
<zid> info pic is deprecated but still works
<zid> and you wrote roughly 17 17 32 40 4 2 1 1 0 0 to the pic regs? :P
<ohnx> yes that exactly (0x20 0xA0 0x21 0xA1 ...)
<zid> sti?
<junon> what an unfortunately named instruction...
<ohnx> yup
<zid> -d int for qemu to make sure you definitely didn't get an interrupt?
<ohnx> sorry for image but this is the output of info pic: https://i.imgur.com/dGdtF3Q.png
mimmy has joined #osdev
<zid> oh I had the qemu command backwards
<zid> If -d int doesn't show anything, I blame the timer code
<zid> but I don't know how that timer works off the top of my head
<zid> If you can't get it there's always "Attaching gdb to qemu itself" :P
<ohnx> ok -d int doesn't show anything, so it must be the timer config then?
<zid> That'd be my guess.
<junon> ohnx what's the full command line for qemu?
<junon> you might be hiding output if you're not careful
<junon> you can omit any filenames or whatever, if you need.
<ohnx> junon: qemu-system-i386 -kernel $< -serial stdio -d int
mimmy has quit [Client Quit]
<junon> the serial might be the problem, just a guess. idk if you can -d int with -serial.
<zid> there are people who don't -monitor stdio?
<junon> I use a tcp port personally
<klange> zid: -serial mon:stdio
<ohnx> i switch the qemu machine view to monitor
<junon> klange: what's that do?
<klange> Multiplexes.
<junon> both serial + qemu monitor to stdio?
<junon> oooooo
<klange> `^A c` switches between serial and monitor
* junon rubs hands
<klange> Defaults to serial.
<junon> thanks
<ohnx> ooh, that is helpful, thanks
<junon> klange: have you considered writing a "what I learned making an OS from scratch over 10 years" article?
<junon> I know that's a lot of work, but it'd be a killer read.
<junon> Especially now that you're stepping away from it.
<ohnx> timer setup is just `outb(0x43, 0x36); outb(0x40, divisor & 0xFF); outb(0x40, (divisor >> 8) & 0xFF);`, right? channel 0 select, write lo/hi, square wave gen?
<klange> "a bunch of useless information about outdated technology" isn't much of an article
biblio has quit [Quit: Leaving]
<junon> Thought processes, design decisions, problems you faced, your outlook on OS development now, etc. is more what I was thinking.
<zid> Just as an aside, it'd be nice if more people documented their workflow
<graphitemaster> "We tricked a rock into thinking with electricity and in the process we tamed it with a bunch of ugly hacks that are hidden with layers of gnarly code and most people are blissfully comfortable with this but it should keep them up at night, many might say this was all a big mistake"
<graphitemaster> There's my article.
<junon> yeah, that too
<klange> - Absolutely never get into OS dev thinking it will get you a job. A single commit in Linux is worth more than a decade of building your own OS.
<zid> ..probably true