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
<yuriko> rust stole my lunch money and called me a nerd
dutch has quit [Quit: WeeChat 3.8]
<Iris_Persephone> mrvn: write a Scratch compiler
<mrvn> Iris_Persephone: no recursion in scratch, fAIL
<klange> rust called me a murderer, so now i just go around killing people because why not
<Iris_Persephone> can't you just unravel any recursive calls into a loop
<mrvn> Ahh, I just got to the part in gravity that totaly violated gravity (orbital mechanics)
<Iris_Persephone> ooh that's fun
<Iris_Persephone> orbiting is when you try to fall but are going too fast in another direction
<mrvn> In orbit is the only place where you have to break to speed up.
<mrvn> So what does she do? Point the capsule straight towards the station and fire the rockets.
<Iris_Persephone> oh you mean the movie
<mrvn> Maybe at 100km we can ignore the curvature, but not that she's going in the wrong direction.
<mrvn> yep
<Iris_Persephone> yeah i didn't watch that one
<Iris_Persephone> is it bad
<Iris_Persephone> mrvn: what was she trying to do, deorbit?
<mrvn> Iris_Persephone: reach a chinese space station to get their rescue capsule because hers is damaged and can't deorbit.
bch has quit [Quit: quitter]
<Iris_Persephone> is it on the same orbit as hers
riverdc has quit [Quit: quitting]
<mrvn> For all they tell us it's 100km off the ISS. When she gets their you see atmospheric drag on it though. Not sure why the chinese space station is itself is deorbiting.
riverdc has joined #osdev
<Iris_Persephone> because if so she should lower her orbit so she has a higher period and can catch up
<mrvn> s/their/there/
<geist> i thought china was actually going to deorbit their station about the time the movie was made
<geist> as in that was an actual event happening
<mrvn> geist: ahh, so that might be knowledge not expressed in the film
<mrvn> (or I missed it)
<geist> yah it at least wasn't a far fetched idea at the time
<mrvn> Iris_Persephone: I think the station is 100km west. Is that leading or trailing?
<mrvn> Anyway, you either have to break or accelerate away from the station to get closer.
<Iris_Persephone> from the ISS? that's - hold on
<Iris_Persephone> 100km is basically nothing in space
<mrvn> Iris_Persephone: it's outside the local region where you can just accelerate to where you want to go.
<mrvn> (at least if you want to get there efficiently)
<zid> there's bands of useful orbits though
<zid> I forget the exact number but they typically just claim a certain height and you get so many km of clearance above and below you
<mrvn> hehe, she jumped out of the capsule and does a Wall-E. Remember the scene with the fire extinguisher?
<zid> before you're allowed to complai
<Iris_Persephone> wall-e was a good movie though
<Iris_Persephone> better than what they're putting out these days
<mrvn> zid: totally. And with the station deorbiting itself it must be below the orbit of the ISS. How is that not zipping past the ISS? A reference of 100km west makes no sense then.
<Iris_Persephone> "west" make no sense anyway because you're _in orbit_
<Iris_Persephone> like where is my compass
<Iris_Persephone> where the poles
<mrvn> Iris_Persephone: there is the earth as reference and you still have a magnetic field.
<mrvn> And there we go again. :) The broken up satelite pieces are back crossing the orbit. So what is the first thing to do after entering the chinese station? Take of the helmet. You know, just in case some of the debries punctures the station and such.
<Iris_Persephone> wait how
<Iris_Persephone> oh nvm she'd equalize pressure in the airlock presumably
<mrvn> hehe, the UI is chinese so she plays enee-minee-moe with the buttons. :)
<mrvn> Iris_Persephone: yeah. Even without the debrie, the station is deorbiting and breaking up. Would you take off your helmet?
dutch has joined #osdev
<heat> wall-e was a great movie
<Iris_Persephone> at that point I'd just not bother repressurizing behind me, it's not like anyone is on there
<mrvn> And hey, there is the second big screwup in the movie imho. The capsule is deorbiting and shaking from drag but her helmet is just floating around.
<heat> honestly top 10 movies ever i dont even care
<yuriko> Interstellar is top 10 movies of all time
<yuriko> if you're talking about space movies
<heat> wall-e is not just a space movie
<heat> wall-e is an everything movie
<heat> society movie really
<mrvn> Interstellar employed some great scientists
<heat> it has so many layers
<Iris_Persephone> is that the one with the- no wait that was Passengers I was thinking of
<Iris_Persephone> I was going to slam you :p
<yuriko> Interstellar is the one where earth is dying and they travel through a wormhole
<mrvn> Iris_Persephone: Wall-E is the garbage collecting robot left on earth while all he humans left in an ark waiting for the earth to recover.
<Iris_Persephone> I know which one Wall-E is
<Iris_Persephone> was confused about Interstellar
<mrvn> yuriko: watch the tides
<mrvn> touchdown
<yuriko> mrvn: link?
<klange> I like Contact.
<yuriko> contact is good too
Celelibi has quit [Ping timeout: 264 seconds]
<yuriko> oh this one, right? https://en.wikipedia.org/wiki/Tides_(film)
<mrvn> yuriko: for interstellar?
<mrvn> yuriko: I ment what out for the tides in interstellar
<mrvn> s/what/watch/
<yuriko> ah
<mrvn> Gravity has an intersting cast.
<mrvn> 2 big actors and 5 voices.
Celelibi has joined #osdev
nyah has quit [Quit: leaving]
MiningMarsh has joined #osdev
<geist> interesting sci fi movie you should watch instead: Moon
<zid> moon is great
<geist> yah one of those not well known great indie sci fi movies
<zid> I really like sam rockwell
<geist> same
<sortie> I gotta rewatch moon
Guest944 has quit [Ping timeout: 252 seconds]
slidercrank has quit [Ping timeout: 252 seconds]
<klange> I finally finished rewriting my compositor binding library, now I can work on adding new bindings to my vector rasterizer and maybe port some of my old Python apps...
divine has joined #osdev
fedorafansuper has joined #osdev
dutch has quit [Quit: WeeChat 3.8]
fedorafan has quit [Ping timeout: 248 seconds]
dutch has joined #osdev
fedorafansuper has quit [Ping timeout: 248 seconds]
[itchyjunk] has quit [Ping timeout: 252 seconds]
fedorafan has joined #osdev
[itchyjunk] has joined #osdev
gog has quit [Ping timeout: 248 seconds]
joe9 has quit [Quit: leaving]
robem has quit [Remote host closed the connection]
heat has quit [Ping timeout: 248 seconds]
smach has joined #osdev
elderK has joined #osdev
Turn_Left has joined #osdev
slidercrank has joined #osdev
Left_Turn has quit [Ping timeout: 248 seconds]
joe9 has joined #osdev
air has quit [Quit: cria 0.2.9cvs17 -- http://cria.sf.net]
air has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
fedorafan has quit [Ping timeout: 252 seconds]
gildasio1 has quit [Ping timeout: 255 seconds]
gildasio1 has joined #osdev
fedorafan has joined #osdev
smach has quit []
fedorafansuper has joined #osdev
fedorafan has quit [Ping timeout: 252 seconds]
slidercrank has quit [Ping timeout: 252 seconds]
elastic_dog has joined #osdev
danilogondolfo has joined #osdev
leon has quit [Quit: see you later, alligator]
leon has joined #osdev
leon has quit [Quit: see you later, alligator]
leon has joined #osdev
leon has quit [Remote host closed the connection]
leon has joined #osdev
leon has quit [Remote host closed the connection]
leon has joined #osdev
leon has quit [Remote host closed the connection]
leon has joined #osdev
DynamiteDan has quit [*.net *.split]
TaiAurori[m] has quit [*.net *.split]
\Test_User has quit [*.net *.split]
Irvise_ has quit [*.net *.split]
rorx has quit [*.net *.split]
bombuzal has quit [*.net *.split]
dinkelhacker has quit [*.net *.split]
FireFly has quit [*.net *.split]
bleb has quit [*.net *.split]
Mutabah has quit [*.net *.split]
ifreund has quit [*.net *.split]
mxshift has quit [*.net *.split]
corecode has quit [*.net *.split]
remexre has joined #osdev
ifreund has joined #osdev
Mutabah has joined #osdev
bleb has joined #osdev
DanielNechtan has joined #osdev
corecode has joined #osdev
ilovethinking has joined #osdev
dinkelhacker has joined #osdev
DynamiteDan has joined #osdev
gog has joined #osdev
Irvise_ has joined #osdev
<gog> hi
<gog> y'all know what's funny is that i have irq1 problems too
* kazinsal gives gog headpats
<gog> the keyboard controller works, i can read bytes from it
rorx has joined #osdev
<gog> but it doesn't shoot an irq
* gog prrr
<sham1> Are you masking any IRQs?
FireFly has joined #osdev
<gog> no, it's unmasked
<gog> i'm configuring it wrong i think
<gog> EFI sets it up to not send interrupts
<gog> afaik
* Amorphia patpat gog
<sham1> Well that would do it
<gog> i write 0x60 to 0x64 and then 0x33 to 0x60
<gog> but that must be wrong
* gog prr
<kazinsal> check your interrupt controller masks
* kazinsal gives gog scritchies
<Ermine> Drew had problems with irqs not firing iirc
<Ermine> gog: may I pet you
<gog> yes
<gog> kazinsal: pic is 0xfc
<gog> timer fires fine
* Ermine pets gog
* gog pr
* Ermine aws
* gog hisses at amazon web services
<sham1> S3?
<Ermine> I meant awws
<sham1> It's AWS now
* moon-child eats amazon web services
<Ermine> amazon web services are meh
xenos1984 has quit [Read error: Connection reset by peer]
<Ermine> But I didn't even comprehend their pricing model
xenos1984 has joined #osdev
<sham1> Speaking of eating, I should start boiling some water for my noodle soup
bauen1 has quit [Ping timeout: 255 seconds]
nyah has joined #osdev
<ilovethinking> how do i initialize the ps2 controller?
<ilovethinking> sham1: share sum w me
<nikolar> ilovethinking: isn't there a page about that on the wiki
<ilovethinking> nikolar: it has no information on initializing it (for some reason)
<ilovethinking> oh wait turns out it tells you how to do that on the ps/2 page itself, not the ps/2 keyboard page
<nikolar> there we go then
<gog> ilovethinking: i have the same problem as you rn :)
<gog> it won't fire irq1
<gog> but i'm doing my real job rn and can't look at it
<ilovethinking> gog: what u got?
<ilovethinking> could u link ur repo or sum
<Ermine> gog: are you on x86?
GeDaMo has joined #osdev
<gog> yes i am
<gog> ilovethinking: it's not in my repo
<gog> what i tried was writing 0x60 to 0x64 then 0x33 to 0x60
<gog> to enable both channels and interrupts
<gog> but that's clearly wrong
<gog> i'm skipping a lot by doing it like that
<gog> the controller works and i can read bytes from it
<gog> and my interrupt handlers work fine, IMR is 0xfc
<gog> timer fires on the right frequency
<gog> there is something wrong with it tho i can eventually make the timer stop working right by overflowing the stack or smth
bauen1 has joined #osdev
<kazinsal> my VAX smells like dead capacitors :rip:
<gog> noooo
bnchs has quit [Remote host closed the connection]
<GeDaMo> What does it taste like? :|
<Ermine> I guess you can solder new ones
Iris_Persephone has quit [Ping timeout: 260 seconds]
SerHack has joined #osdev
<SerHack> Hi everyone, just jumping into this amazing community :) So glad to have found
<SerHack> So glad to have found osdev*
<gog> hi
<SerHack> I was wondering if anyone could suggest me something to write about.. Let me explain: back in 2017 (maybe? IIRC), I followed the many tutorials online that anyone can find to create my own "toy" (the common x86 kernel with idt and gdt). Now I feel that part of those tutorials are pretty outdated, mentioning something really old. Do you feel there's something that I can write about? Like a new serie of articles to build your own kernel, taking advantages from
<gog> basically i found that i get things working in spite of the tutorial
<gog> don't write a new one
<gog> because yours will eventually be like this
<SerHack> Before taking a CS degree, I really wondered what words behind osdev wiki meant. I guess now I'll say something, well, too much obvious and I'll be hated (please don't hate me). For the average programmer, OSDEV wiki is too much technical (with technical I do not mean it's full of incomprehensible words, instead I find OSDEV wiki really fascinating). However there are too many concepts skipped. It's totally fine from my point of view, but I'd like to expand m
<SerHack> reader. This is why I asked what to write about.
<SerHack> gog: thanks for the feedback, I'm interested more about your journey. What did you do to get things working or if you were stuck?
<gog> fuck around and find out
<SerHack> I was asking pour parler... :/ Given example, for me, it depends on where I am getting stuck: if it's for an issue on my kernel, if it's for a new feature that I do not know how to implement..
<gog> QEMU with a debugger is invaluable
<gog> for the former
<gog> for the latter, i try to find an example of what to do and mold it to the specifics of my existing code
<gog> change things and see what works, what doesn't
<gog> just fuck around
<gog> little of what i'm doing is very goal-oriented with a specific purpose and design in mind
<gog> so maybe i'm not the best person to speak on it
<SerHack> Yeah, the "fucking around" (or more gently, the "trial and error") approach is one of the thing you always learn as a developer
k4m1_ has joined #osdev
riverdc_ has joined #osdev
ZipCPU_ has joined #osdev
ozarker_ has joined #osdev
nikolar_ has joined #osdev
bradd_ has joined #osdev
thaumavorio_ has joined #osdev
merry_ has joined #osdev
levitating_ has joined #osdev
colona_ has joined #osdev
gh0stbuster has joined #osdev
energizer_ has joined #osdev
GeDaMo has quit [*.net *.split]
riverdc has quit [*.net *.split]
levitating has quit [*.net *.split]
nikolar has quit [*.net *.split]
bradd has quit [*.net *.split]
ZipCPU has quit [*.net *.split]
energizer has quit [*.net *.split]
bxh7 has quit [*.net *.split]
ozarker has quit [*.net *.split]
ghostbuster has quit [*.net *.split]
MuonNeutrino has quit [*.net *.split]
merry has quit [*.net *.split]
thaumavorio has quit [*.net *.split]
colona has quit [*.net *.split]
k4m1 has quit [*.net *.split]
amj has quit [*.net *.split]
ZipCPU_ is now known as ZipCPU
merry_ is now known as merry
nikolar_ is now known as nikolar
MuonNeutrino has joined #osdev
amj has joined #osdev
GeDaMo has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
<ilovethinking> thats a lot of leaves
<gog> netsplit
ilovethinking has quit [Remote host closed the connection]
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
MiningMarsh has joined #osdev
kfv has joined #osdev
heat has joined #osdev
<gog> mew
<heat> gog
<gog> heat
<gog> pedro
<heat> ada
<gog> how goes it today
ilovethinking has joined #osdev
<ilovethinking> why is this channel in irc
<ilovethinking> why not smth else
<ilovethinking> like matrix or something
<Ermine> Because
<heat> because we're all based and escaped the matrix cobra tate trillionaire grindset blue pill red pill
<FireFly> idk the channel was on irc before matrix was a thing so I guess it didn't have a reason to move?
<ilovethinking> fair
ilovethinking has left #osdev [#osdev]
ilovethinking has joined #osdev
<ilovethinking> mb
<heat> ok, weird tidbit of the day: compilers seem to favour mov memory_location(%rip), %reg over mov (memory_location), %reg
<heat> (mcmodel=small, no pie, no pic)
* Ermine still haven't learnt at&t syntax. What a shame
<heat> mov reg, dword ptr [memory_location]
<heat> (i think)
<heat> and the riprel would be mov reg, dword ptr [rip + memory_location] but I haven't done riprel in intel syntax so
<sham1> RIP-relative depends on the assembler used. For example NASM does [rel symbol]
<gog> GNU uses @GOT or something
<gog> symbol@got
<ilovethinking> where did yall learn asm?
<sham1> But that's not RIP-relative is it, that's just the GOT entry
<gog> oh right
\Test_User has joined #osdev
<heat> gog, no, it's sym(%rip)
<gog> yes that's right!"
<gog> in fact i use that in some code XD
<gog> ilovethinking: i learned it by doing it
<gog> it's not that hard it's just very granular and tedious
<ilovethinking> i mean i can read asm but ive been needing it a lot recently
<ilovethinking> where can i practice it tho
<heat> editor
<heat> :))
<ilovethinking> ok
<gog> you can write assembly in regular programs
<gog> you can either link in assembly objects or use __asm__ templates
<Ermine> take some small C program you've written recently and rewrite it in asm
<ilovethinking> fuck idk if i wrote any small programs recently kekw
<ilovethinking> if i write code it's usually a big project
<ilovethinking> well not big but smth like that
<heat> sounds like you want advent of code in assembly
<bslsk05> ​carlosrafaelgn.com.br: Assembly x86 Emulator
Left_Turn has joined #osdev
<heat> i did do it for one day, was a PITA
bradd_ has quit [Ping timeout: 268 seconds]
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ilovethinking> what if i try doing leetcode problems with asm
<heat> no lol
Turn_Left has quit [Ping timeout: 255 seconds]
<heat> the gang handwrites a std::map implementation in assembly
<heat> would honestly rather blow my brains out
<ilovethinking> sounds like a cpp problem
<heat> no, it's a leetcode problem
<Ermine> ilovethinking: write a program that copies a file for example
<heat> you can't solve most of them without elaborate data structures
<heat> i.e not what you want to write in asm
<heat> advent of code is perfect but it's still a PITA
<ilovethinking> i still don't know the difference between text and data
<Ermine> .text is code and .data is initialized data
kfv has joined #osdev
<gog> .text being code is stupid who decided
<ilovethinking> how did the dude who wrote rollercoaster tycoon do it in assembly
<Ermine> hysterical raisins I guess
<ilovethinking> how did he manage to render graphics
<gog> chris sawyer is a legend
<gog> that's how
<gog> but also you can call external functions from assembly
<gog> you just have to know how to pass parameters to them
<\Test_User> if it can be done it can be done in assembly
kfv has quit [Quit: Textual IRC Client: www.textualapp.com]
<sham1> .text being code is hysterical raisins and from IBM, but it does make sense. It contains the program text
fedorafansuper has quit [Ping timeout: 252 seconds]
<sham1> .bss on the other hand is a weird name
<sham1> > Block Started by Symbol
<Ermine> Block Started by Symbol
<sham1> Like what, why
<Ermine> Hysterical raisins also
fedorafan has joined #osdev
<Ermine> Some caveat in some old assembler
<sham1> Yeah, but unlike .text it's less sensical
<ilovethinking> im trying to do a hello world in asm and im getting 100 errors
<Mutabah> I thought it was `blank state segment"
dutch has quit [Quit: WeeChat 3.8]
SpikeHeron has joined #osdev
MiningMarsh has quit [Ping timeout: 252 seconds]
<gog> bull shit storage
MiningMarsh has joined #osdev
<FireFly> I only remember it as "better save space" after reading that somewhere as a sorta-jocular backronym
<FireFly> well not backronym, but uh, whatever that would be
V-T60 has joined #osdev
_73 has quit [Remote host closed the connection]
<ilovethinking> 01000101 - is the 0th bit the one from the left (0) or the one from the right (1)?
fedorafan has quit [Ping timeout: 252 seconds]
[itchyjunk] has joined #osdev
fedorafan has joined #osdev
<froggey> the one from the right
jack_rabbit has joined #osdev
<froggey> unless you're dealing with IBM and POWER, then it's the other way around
knusbaum has quit [Ping timeout: 265 seconds]
<ilovethinking> thanks
joe9 has quit [Quit: leaving]
<ilovethinking> wha the fuck lol polling 0x60 is always 0xFA
<ilovethinking> ah okay i fugred it out
<ilovethinking> hooray polling the keyboard works
<ilovethinking> now i gotta get irq1 to fire
joe9 has joined #osdev
<gog> mew
<mrvn> ilovethinking: unless you are on powerpc or work at IBM then it's from the left.
<Ermine> gog: how is it going?
<gog> Ermine: busy at work trying to figure out how to get image metadata server-size since we use linux hosts and can't use System.Drawing
<gog> how you?
<Ermine> gog: I'm attending a lecture
<ilovethinking> mrvn: i polled the keeb as u told me to do
<Ermine> Is System.Drawing something from .NET ? Is it .NET Framework specific?
<ilovethinking> and i can confirm it works fine
<ilovethinking> so now i am 100% sure it's the irq problems
<gog> Ermine: it's .NET but it's not usable on ASP.Net Core apps
<gog> which is what we use
<gog> and on linux hosts even if it is present it might be missing image formats
<Ermine> Ah
<ilovethinking> fuck .NET
<ilovethinking> all my homies hate .NET
<Ermine> net
<gog> it pays my bills
<Ermine> Afaik they wanted to include some cross-platform gui in .Net 6. Idk if they actually did this
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 264 seconds]
<ilovethinking> does anyone know how to debug irq1 not firing
<ilovethinking> i have nothing to hook on
<ilovethinking> it just doesn't fire
<ilovethinking> i made sure my ps2 keyboard works by polling it, tested my idt
joe9 has quit [Quit: leaving]
<gog> the PS2 controller needs to be gently told to get to work
<gog> and not be afraid to speak up
Celelibi has quit [Ping timeout: 268 seconds]
<ilovethinking> sounds 1800ish
<ilovethinking> jkjkjk
<ilovethinking> geist: are you alive
<mrvn> ilovethinking: did you EOI the irq? Did you enable interrupts on the keyboard controler and cpu?
irl25519 has joined #osdev
slidercrank has joined #osdev
n1tram1 has joined #osdev
n1tram1 has quit [Ping timeout: 255 seconds]
<zid> gog: This is a good time to switch everything to .gog .empty and .datas
<gog> and .cats
<zid> what goes in that one
<gog> fishies
lav has joined #osdev
<ilovethinking> mrvn: wdym "enable interrupts on the keyboard controller and cpu"
<ilovethinking> how do i do that
<gog> lav lav
<Amorphia> gog: we takin over
<lav> gog gog
<gog> ilovethinking: you need to tell the PS/2 controller that it needs to send irq's, RFLAGS.IF needs to be set
<gog> Amorphia: we are
<lav> :3
<gog> :3
<ilovethinking> gog: so i pop the register, OR it with 0000000001... and then push it back?
<zid> or you know, sti
<ilovethinking> ah
<ilovethinking> lol
bauen1 has quit [Ping timeout: 260 seconds]
ilovethinking has quit [Remote host closed the connection]
ilovethinking has joined #osdev
<ilovethinking> but how come my ISRs work
<ilovethinking> without sti
<gog> bbiab heading home
gog has quit [Quit: Konversation terminated!]
ilovethinking has quit [Remote host closed the connection]
<zid> So starts the long trek across the frozen tundra
<zid> A dangerous prospect, as wild polar bears stalk the landscape, and cover is sparse due to the lack of trees.
<zid> Clinging to life by licking moss, the gog gets the nutrition it needs to push onwards
Celelibi has joined #osdev
ilovethinking has joined #osdev
gxt has quit [Ping timeout: 255 seconds]
<bslsk05> ​www.smithsonianmag.com: Fossilized Footprints Found in New Mexico Track Traveler With Toddler in Tow | Smart News| Smithsonian Magazine
gxt has joined #osdev
<zid> GeDaMo: teeny squardle
<geist> ilovethinking: what ISRs are working without sti?
<geist> if yo mean page faults, etc, those aren't interupts. those are exceptions
<geist> there's a distinction
<zid> swis work I assume
<zid> cus.. what else they gunna do, UD?
<GeDaMo> zid: it still took me long enough :P
SpikeHeron has quit [Quit: WeeChat 3.7.1]
<zid> I need.. 4/1/0/1/1
<zid> if this was in french it might be easier, cutir sounds like good french
<GeDaMo> The 8 is the plural of the 7
<zid> and starts with c p or l
<zid> TCUPLRIS not a word, weird
<zid> LRIPCUTS neither
<GeDaMo> All the right letters, not necessarily in the right order :P
<GeDaMo> I used reveal on the last 4 letter word I couldn't get, it was a programming language :|
<zid> lisp presumably
<zid> That's a speak impediment not a programming language
<zid> speech
<zid> okay done
<zid> no reveals, 7 bonuses
xenos1984 has quit [Ping timeout: 248 seconds]
xenos1984 has joined #osdev
<mrvn> geist: FYI I don't think I'm using sti anywhere. Interrupts are enabled when switching to user mode only. :)
<geist> yeah. of course.
<mrvn> GeDaMo: How do they proof that it's not just overlapping footprint from different days?
<geist> i'm akswering ilovethinking saying 'why are y isrs working if i dont use sti'. but the context is almost certainly they are talking about #GP and whatnot
<geist> but wanted to make sure
SpikeHeron has joined #osdev
<mrvn> geist: you missed the :)
<geist> probably, yes
<GeDaMo> mrvn: something to do with how long it takes the mud to set?
<mrvn> "The person holds a toddler on their hip, and their feet slip in the mud as they hurry along for nearly a mile, perhaps delivering the child to a safe destination before returning home alone." Ahh, sounds like the todlers footprint start in the middle out of nowhere.
<ilovethinking> geist: gp works too lol
<geist> yes, those are not interrupts. that's the point
<ilovethinking> okay
<ilovethinking> cool imma sti now
<geist> the intel SDM describes this. basically all IDT entries < 32 are 'exceptions' in that they are things generated by the cpu itself as a result of code running
<geist> and thus cannot be masked (as well as NMIs)
<ilovethinking> yes i know
<geist> though what you're calling an ISR can be used to handle an interrupt, it's really more of an exception/interrupt handler, depending on which what the case is
<ilovethinking> i read it up on the sdm
<ilovethinking> oh okay
<geist> what sti and cli do is unmask/mask *external* interrupts
<ilovethinking> i should sti after lidt right?
<geist> external to the cpu core itself in the classical sense
<geist> and though it's all part of the same chip, think of the PIC as being external to the core
<ilovethinking> geist: well, by external you mean hardware?
<ilovethinking> aside from the cpu
<geist> right
<ilovethinking> fair
<geist> in the classical sense, the way a motherboard was wired up with an original 8086, where all these things were physically separate chips
<mrvn> "int" on the cpu is an exception too, not an interrupt. The cpu can't generate any interrupts I think.
gog has joined #osdev
unimplemented has joined #osdev
<bslsk05> ​wiki.osdev.org: "8042" PS/2 Controller - OSDev Wiki
<ilovethinking> i don't understand the initialization step 4
<ilovethinking> "poll bit 0 of the Status Register"
<ilovethinking> ??? wjat
<ilovethinking> what*
<ilovethinking> "poll"?
<geist> poll means sit in a loop and read it continually
<ilovethinking> what does that do
<mrvn> ilovethinking: you can check if an IRQ is pending even if it's masked. Polling will let you see there is one ready to fire without having to worry that your IRQ handler is working or not.
<ilovethinking> also how do i poll without making my entire program stop? i don't have multithreading lmfao
<mrvn> Also reading a bit might reset the status on controllers allowing for the next IRQ to work at all.
<ilovethinking> or read from IO Port 0x60 without testing bit 0
<ilovethinking> "testing"?
<mrvn> ilovethinking: for testing purposes you just make everything stop and output the results of the poll.
<ilovethinking> will disabling the ps2 controller and then reading from 0x60 flush the buffer?
<mrvn> not sure if the buffer will survive the disabling
<geist> testing a bit means see if the value is 1
<geist> (or 0, depending on what you're testing for)
<ilovethinking> mrvn: it says step 1 is disabling the ps2 controller and step 4 is flushing the buffer
<ilovethinking> it doesn't make sense but i guess it survives it?
<mrvn> you might get garbage inputs while configuring
<mrvn> the keyboard might have 10 chars bufferes as well and when you turn on the PS/2 you suddenly get 10 keystrokes.
sortie has quit [Quit: Leaving]
<ilovethinking> so disabling it by itself flushes the buffer>
<ilovethinking> ig so
<mrvn> maybe, maybe not. does it matter?
craigo has quit [Ping timeout: 248 seconds]
<gog> the procedure is there for a reason and that reason probably has to do with the laws of physics causing the circuit to have strange properties when it's powered on
<ilovethinking> fuck physics
<gog> ok
<ilovethinking> but how can you read from 0x60
<ilovethinking> after the ps2 controller is disabled
<gog> it's still connected to the i/o bus
<gog> and its buffer is still doin buffer things
<ilovethinking> right
<zid> gog I wrote you a story when you left
<gog> zid what was the story
<gog> lmao
<gog> i did get the nutrition i needed
<gog> shit i didn't get cheese
<zid> ..bear cheese?
<gog> yes
<ilovethinking> "To send the reset, just send the byte 0xFF to each (usable) device."
<ilovethinking> which port? 0x60 or 0x64
<mrvn> yes
<gog> first one then the other
<ilovethinking> so first 0xFF to 0x60 and then to 0x64?
<zid> gog: That's how I deal with choices in general.
<gog> there's a controller command you send first, then you send the device command to the output
<zid> "Should I throw this away? Or just eat it?"
<heat> geist, random question but do you know if rip-relative mov's are equally fast as mov (memory_location), %reg?
<heat> i can't tell why the compiler seems to prefer rip-relative loads even on mcmodel=small
wootehfoot has joined #osdev
<mrvn> heat: shorter opcode?
<ilovethinking> gog: the command isn't written in the table
<zid> I think rip rel is just free
<zid> but that it doesn't memory rename on zen2
<mrvn> heat: (memory_location) needs 64bit. That's horribly large.
wootehfoot has quit [Max SendQ exceeded]
<gog> ilovethinking:
<gog> Write next byte to first PS/2 port output buffer (only if 2 PS/2 ports supported)
<gog> (makes it look like the byte written was received from the first PS/2 port)
<gog> wait no d4
<gog> d3
<gog> hahaha
<gog> i can't read
<gog> d4
<ilovethinking> s2
<ilovethinking> d2?
<mrvn> isn't there even a "mov imm8(pc), %reg"?
<ilovethinking> gog: i'm not sure if my keyboard is on port 1 or 1
<ilovethinking> or 2*
<heat> zid, rip rel lea don't seem free, at least going by the intel optimization manual
<heat> but it says little about rip rleative loads and stores apart from a few places where it says it doesn't fuse uops
bauen1 has joined #osdev
<mrvn> Has anyone tried using ChatGPT to write a basic kernel?
<mrvn> What's the opposite of a flat earther?
<gog> a toroid earther
<lav> globehead?
<gog> oh i thought you mean wrong but on the opposite dimensional vector
<gog> sorry
* Ermine is wannabe flat earther
* \Test_User places the earth in a giant hydrolic press
<gog> we must deal with this
<zid> this is gog dust, don't breathe this
* lav snort
<zid> lav: Are you named for the microphone or the toilet?
<lav> for the what or the what?
<zid> lavalier, or lavatory
<lav> ahh
<lav> well my mind is in the gutter ao toilet i guess
<lav> s/a/s/
<mrvn> 'I was not prepared for anyone, much less Matt Parker, to say "Well done, flat earthers" without a trace of irony in his voice,' lol
<zid> ao toilet, the azure telephone
<zid> 青トイレ is my next album
<gog> lav: u hooked on me
sortie has joined #osdev
<lav> gog: hell yeah >_>
<zid> azure toilet: Sat on me
bnchs has joined #osdev
dude12312414 has joined #osdev
<Ermine> If Earth was flat cartographic software was much simpler...
<Ermine> s/was much/would be much/
<mrvn> Ermine: but space flight would be so much harder
<mrvn> Ermine: What shape is your flat earth? Do you believe in the southern circular ice wall?
<mrvn> And what is beneath the earth?
<mrvn> .oO(It's turtles, all the way down)
<lav> turtles that continoualy accelerate upward
<Ermine> mrvn: I mean, if it was square or rectangle
<zid> they already do that, just dive up as towards earth's center of mass
<zid> define up*
fedorafan has quit [Ping timeout: 256 seconds]
<mrvn> lav: Oh, that's explains the expansion of the universe. All the turtles beneath those distance stars accelerate at different speeds.
<Ermine> There was an article on complications of writing software that takes Earth into account: it is actually a geoid, not ellipsoid, there are a lot of datums, etc...
fedorafan has joined #osdev
<ilovethinking> gog: so do i write to port 1 or port 2]
<gog> idk
<gog> i'm not working on the thing rn i'm making dinner
ilovethinking has quit [Remote host closed the connection]
<mrvn> Ermine: I love the flat earther argument that you can't see a curvature of the horizon. Because say the earth is a (circular) disk then there would be a curve. Only solution would be infinite plane and then can we get all the flat earther to pack up and move past the south pole?
xenos1984 has quit [Ping timeout: 248 seconds]
<Ermine> mrvn: I've heard some of then tried to make an expedition to the (assumed) edge of the earth, but they stopped trusting the ship captain or whatever
<mrvn> Ermine: visiting the southern ice wall is aparently something flat earthers try to do a lot
<mrvn> Given global warming they better hurry as well. When the ice wall melts and all the water flows off the edge of the world we are all going to die.
<Amorphia> lmfao
<Ermine> mrvn: it's hard when everyone who can sail ship inherently takes part in consirancy
<gog> aw damn that food was good
xenos1984 has joined #osdev
terminalpusher has joined #osdev
smach has joined #osdev
<Ermine> late "have a good meal"
<gog> :3
<lav> nya
<zid> My gender is big hat logan
<Matt|home> .. so ancient undead male
<gog> cool hat
<lav> the three pronouns: she, they, and educated
<zid> not sure how educated a cool hat is
<zid> it's fucking cool though, and a hat
irl25519 has quit [Quit: irl25519]
irl25519 has joined #osdev
<gog> i'm definitely not educated
smach has quit []
ilovethinking has joined #osdev
<ilovethinking> wait can yall see my messages
<lav> yeah
<geist> now that you've rejoined, yes
<mrvn> Everyone who can't read me say BOOO
<ilovethinking> i finally found a mobile irc client that works
<ilovethinking> hooray
<ilovethinking> geist: so how do i actually reset the ps/2 keyboard? do i write to port 1 or port 2
<mrvn> ilovethinking: yes. whatever you pluged your keyboard into
irl25519 has quit [Quit: irl25519]
<ilovethinking> mrvn: how do i figure out where i plugged it
<mrvn> press a key and see where it show ups
<ilovethinking> what? wdym
<lav> just try both?
<ilovethinking> yeah tbh why not
irl25519 has joined #osdev
<mrvn> and don't you want to support a mice or dual keyboard setup anyway?
irl25519 has quit [Quit: irl25519]
<gog> no mice
irl25519 has joined #osdev
<ilovethinking> mrvn: not yet
<geist> ilovethinking: look, i'm not here to debug it for you. you need to read up on this
<ilovethinking> also what do i do after setting up the keyboard? what i got rn is the idt and both physical/virtual memory management
<geist> they're on qemu, so it's plugged into whatever The Keyboard is
<ilovethinking> geist: okay
<geist> what are your overall goals?
<ilovethinking> sure
<ilovethinking> geist: i know this sounds stupid but i want to port something nano/vim-ish, nasm, and make an x86-64 asm compiler os
<ilovethinking> that does nothing else
<geist> what does 'asm compiler os' mean?
<ilovethinking> an operating system that upon boot provides you with nano/vim and lets you compile and run assembly code
<ilovethinking> i know it’s pointless but it’s an overengineered solution to a problem i have
<ilovethinking> basically i run arm
<ilovethinking> and can’t run x86-64 asm
<geist> so you want to support ARM architecture and not x86?
<ilovethinking> no
<ilovethinking> and since i have arm i want an os that is x86-64
<ilovethinking> so i can run x86-64 asm code
<nikolar> ilovethinking: what client is it
<ilovethinking> nikolar: irccloud
<nikolar> i am using revolution irc
<ilovethinking> nikolar: doesn’t exist on the app store
<nikolar> oh it's an android thing
<nikolar> didn't know you were on ios
heat has quit [Remote host closed the connection]
heat has joined #osdev
<ilovethinking> wait am i blind or is there no command to write to the first port input buffer? only possible to write to the output buffer
<mrvn> you want to write fake key presses into PS/2 controller?
<mrvn> no, you can't do that
unimplemented has quit [Quit: population dead]
<gog> 0xD2 (Write keyboard buffer) - Parameter written to input buffer as if received from keyboard.
<mrvn> I stand corrected
fedorafansuper has joined #osdev
fedorafan has quit [Ping timeout: 248 seconds]
<bnchs> hi
<lav> hi bnchs
selve has quit [Remote host closed the connection]
<ilovethinking> oh okay so i shall write to the output buffer in order to reset it?
selve has joined #osdev
<geist> is there a page on the wiki about how to initialize the ps2 controller?
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<geist> all this aside i highly suspect you dont have to initialize it on qemu
<geist> it probably is already generating keycodes, just try to read the data port and see if you can get something
<zid> or a real machine tbh, considering you know, the bios takes del/f1
<geist> right
<bnchs> how does the bios read keycodes?
<zid> half of POST on an early machine is dedicated to that chip :P
<zid> it has a very engineered test mode
<bnchs> i mean it's a lightweight firmware (runs off of a ROM chip)
<geist> bnchs: just like anything else. it just has code to deal with it
<geist> well, i wouldn't necessarily call it lightweight
<bnchs> yeah it just depends on the computer
<geist> but even in the original PC it has effectively a full driver for the keyboard, because you can read the next keystroke with an int bios call
<bnchs> i like how the OS can communicate with the BIOS
<geist> so coming out of boot phase of the bios initialization it will basically have by definition initialized the keyboard controller
<geist> yah using int as a trap is not entirely unique to intel hardware, but it definitely was already established by at least 8080, if not 8008
<geist> since 8080 and z80 uses more or les the same mechanism, they just dont have as many vectors
<zid> it's very unlikely that it does int16 if(!init) init(); at least, given it has already used the keyboard
<ilovethinking> fuck it i’ll debug the controller later i’m to fucking tired
<ilovethinking> too*
<bnchs> geist: yeah
<bnchs> i'm dealing with a m68k OS that uses a user-defined trap vector for OS calls (if that's the same thing)
<geist> zid: yah plus it'll have set up the int controller for it anyway, so it's already building a queue of pressed keys right off the bat
<geist> bnchs: yeah exactly. with 68k its at least a slightly different mechanism, in that you're not making straight vector calls, but the trap instruction (SVC? I forget, something like that) definitely has some dedicated vectors
ilovethinking has quit []
<geist> sys, trap, something, 0-8 iirc
<bnchs> it's TRAP
<bnchs> like TRAP #0x0 for calling user trap number 0
<zid> the gameboy has software interrupts but they're not vectorable so nobody uses them :P
<geist> it's a TRAP!
<zid> they go to specific rom addresses, and there isn't enough space between them to do much more than call to a different location, so the byte it would save.. doesn't get saved
<zid> really
<bnchs> i memorized the instruction because i spent time trying to correct ghidra over and over
<geist> heh
<bnchs> because the OS i'm using has a 16-bit word after the TRAP #0x0 (resembles function code)
<geist> ah and it pushes the return address forward a word i guess
<bnchs> yeah
<bnchs> but the OS has something called "trap handlers" (which are basically dynamic libraries loaded by the OS) that can be assigned to one of the free 7 user-defined trap vectors
<bnchs> so you could have a C I/O library on one of the vectors aswell
<bnchs> the problem is... you're only limited to 7 dynamic libraries per process
<zid> https://i.redd.it/j65ku2pm5zha1.png "Black to play, mate in 1", This is incredibly funny if you've seen a certain thing that happened lately, you're welcome.
<mrvn> One thing you probably have to do with the PS/2 controler is to set the keyboard mapping. The data you get back depends on what mode you use.
<bnchs> mrvn: is the layout really stored in the controller?
<bnchs> also i didn't think you can set the mapping
<bnchs> i thought it was hardcoded to QWERTY
<lav> there's like 3 modes you choose from
<mrvn> bnchs: it's not qwerty. It's what you get for a key press and key release.
<bnchs> yeah
<mrvn> I'm not sure if it programs the PS/2 controler of the keyboard itself but there are different modes and who knows what mode the bios uses.
<bnchs> it's a keycode i think
<mrvn> yep
<bnchs> but the hardcoded QWERTY is probably in the BIOS
<bnchs> sorry for being a dumbass
<mrvn> qwerty in mode 1 and mode 2 looks different
<zid> scancode -> look up in an array -> characters, is the typical method
<zid> which is why plugging a keyboard with different markings on doesn't do shit
<bnchs> yeah
<zid> but it does mean quake always works
<zid> cus the keys in the shape of wasd doesn't move
<bnchs> i wanna say something
<bnchs> sorting languages in terms of easy to implement correctly
<mrvn> Note: On real hardware you are probably talking to a simulated PS/2 because you have an USB keyboard.
<bnchs> from LTR languages (easy) to RTL languages (probably no big deal) to RTL with merging characters and overlapped symbols (hell)
<mrvn> what's an right to left language?
<bnchs> hebrew
<bnchs> RTL with merging characters and overlapped symbols is arabic
<mrvn> that's not a language you implement.
<zid> english is hard enough
<zid> keming information needs to be transparently included with the text
<bnchs> i mean in a text framebuffer
<mrvn> bnchs: are you trying to implement a text renderer?
<bnchs> no, but thinking of it
<mrvn> bnchs: do ascii
<zid> text mode is a hack to make quick broken looking english fast
<bnchs> like if i'm making a text renderer, i'm not implementing arabic
<mrvn> and if you need more do utf-8
<zid> it doesn't really work for many other languages at all
<mrvn> ucs32
<bnchs> i mean systems like arabic
* kof123 awards zid alkemy points for pun
<zid> it barely works for stuff like norwegian :P
<heat> zid, pls explain chess joke
<zid> heat: There was a famous 'chatgpt vs stockfish' game recently that was getting lots of meme views
<zid> chatgpt castles through its bishop and deletes it as one of its moves
<heat> ah yes
<heat> I know
<heat> i was not expecting a gothamchess reference in #osdev
<zid> It's just a meme
<zid> not a gothamchess reference
<mrvn> heat: check mate in 42 moves
<mrvn> stupid game,.
<heat> it is because that is the exact game
<zid> No
<heat> Yes
<heat> unless the youtube short lied to me
<zid> Okay, it's a reference to gothamchess, so let's rewind.
<bslsk05> ​'Chess in Futurama' by AadoChess (00:01:03)
<zid> to pls explain the chess joke
<heat> do you want me to explain the joke?
<zid> heat: It's a reference to gothamchess, I just wanted you to know he existed, but I thought I'd do it in a subtle way
ilovethinking has joined #osdev
<zid> It's not a meme
<zid> I was wrong, there
<heat> ok
gh0stbuster is now known as ghostbuster
<mrvn> "Who you gonna call? ghostbuster"
DanielNechtan is now known as bombuzal
<sham1> I thought I'd call the entry point
<ilovethinking> i set up the kbd_init function and now the keyboard handler gets called in the middle of the initializing process
<ilovethinking> ??????????
<ilovethinking> and then it doesn't even get called when i press a key
<mrvn> don't enable the IRQ until you are done initializing, don't forget to EOI the IRQ or you only get one.
<ilovethinking> by enable the irq you mean clearing the mask?
<heat> ​
<ilovethinking> or do you meet an sti
<ilovethinking> mean
<mrvn> yes
<ilovethinking> okaye
<ilovethinking> so i guess both
* mjg ports solaris to itanium
<mjg> fucking great man
<mjg> dead on dead
<ilovethinking> mrvn: it still sends a random interrupt even after initialization
<ilovethinking> i have an eoi
<ilovethinking> so weird
<geist> probably aren't eoiing it properlky
<geist> also you need to read the character out of the port or it might just fire again
<mrvn> and what scancode do you get?
<mrvn> geist: I would think the opposite. once it's fired you have to read it before it fires again
<mrvn> (from the problem description)
<geist> mrvn: possibly. depends on if it's edge or level. i honestly forget how these work
<geist> probably edge though
<geist> also yeah depends on what 'random initialization' means in this case
<geist> could just be a queued up scancode
<mrvn> geist: I believe x86 has both, it's a mess
<geist> s/random initialization/random interrupt
<mrvn> iirc when you initialize the keyboard you get an ACK
<ilovethinking> YOO IT WORKS
<ilovethinking> ahhhhh finally
<ilovethinking> ty mrvn and geist
<ilovethinking> imma go sleep now
<ilovethinking> nighty
LostFrog has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
ilovethinking has quit [Quit: i probably locked my mac and i got disconnected]
PapaFrog has joined #osdev
<heat> geist, did you see my earlier question regarding rip-relative loads and stores on x86?
<mrvn> heat: wasn't the instruction size relevant enough?
<geist> vs what i guess?
<geist> i'd assume that rip relative is pretty ideal in general
<geist> vs any sort of alternative sequence
<mrvn> mov imm8(RIP),rax vs. mov imm64,rax
<heat> vs i.e mov var, %reg
<mrvn> heat: what's var?
<heat> dereferencing the imm32 directly
<geist> where the imm32 is an address?
<heat> yes
<heat> again, mov var, %reg
<geist> ah yeah i'd think it's just it being PIC vs not pic
<geist> and it being all else held equal equivalent speed wise, so may as well use the PIC version even if it's a non pic binary
<heat> yeah but the compiler prefers rip-relative loads and stores on mcmodel=small no-pie no-pic too
<geist> yah probalby just why not
<heat> which makes me wonder if there really is no penalty with rip-rel here
<mrvn> heat: does it use imm8(RIP), imm16(RIP) or imm32(RIP)?
<geist> i doubt there's penalty for rip relative
<heat> because at least intel is pretty explicit in the optimization penalty for lea var(%rip), %reg
<geist> heck it even knows the address at decode time, it could compute it and store in the uop the full address
<heat> or at least it was in sandy bridge and they never updated it
danilogondolfo has quit [Remote host closed the connection]
<heat> geist, for reference: https://i.imgur.com/diJOPgl.png
* geist nods
<mrvn> heat: wow, they screwed up all the once you really want to use
<heat> they also explicitly mention they macro-fuse cmp/alu-instructions and jmps IF they do not do RIP-relative addressing
<mrvn> Isn't the address of RIP relative addressing based on the next opcode?
<geist> that being said i think they probably fixed some of that post sandy bridge
<geist> sandy bridge was a big leap forward but probably had some low hanging fruit that got nipped later
<mrvn> "An
<mrvn> effective address is formed by adding displacement to the 64-bit RIP of the next instruction."
<bslsk05> ​godbolt.org: Compiler Explorer
<mrvn> I can see how that makes RIP harder to use.
<heat> gcc's codegen here looks weird
<geist> yah and probably the front end can do the math, if it has a ALU for it
<geist> heat: you should call oiut a consistent -march between the two compilers
<mrvn> geist: only after full decoding the instruction and getting the RIP updated
<geist> since you dont know what the baseline it's trying to compile for
<geist> mrvn: sure, but that's still more knowable early on than more or less anything else
<geist> except an imm32
<geist> but there is no imm64 version of mov anyway, so it's not as useful in a 64bit envirionment
<heat> forced sandybridge, seems to not change anything
<geist> you only have movabs, but that just loads a 64bit constant into a register
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> isn't movabs technically still mov?
<heat> particularly in Intel syntax
<geist> sure but my point is you can't dereference it
<heat> yeah totally
<geist> in intel syntax i have no idea
<geist> so really that may be more of the thing than anything else: you're dereferencing a 32bit address,so you *could* use a small instruction
<geist> but maybe the compilers dont have a known path for mcmodel=small
<geist> so they emit the generalized version of it: rip relative, which works anywhere in 64bit land
<geist> possible the small mcmodel isn't really that well optimized becauase it's not used that much
<geist> or something like that
<heat> mjg, any insight into this or do you deal in memcpy implementations only?
<geist> really i mean what would solaris do?
<geist> it's the topic on everyone's mind
<heat> movabs
<mrvn> heat: turn on optimization or the codegen is pretty meaningless
<geist> oh that's a point didn't notice it was missing opt
<heat> clang -O2 changes the direct imm32 memory reference to a rip rel
<geist> yah they both go rip rel
<heat> which is... confusing
<heat> this makes little sense
<heat> a rip-relative load is always safe in mcmodel=small, there should be no need for -O2 here, it's just a if ()
<mrvn> https://godbolt.org/z/5EcvTcGeq clang seems to know about mcmodel=small, gcc doesn't (for this example)
<bslsk05> ​godbolt.org: Compiler Explorer
<mrvn> heat: -O0 just stacks together stupid buildingblocks and generates horrible code.
<mjg> heat: insight into what
<mrvn> ups, no sorry, same change in gcc/clang.
<mrvn> https://godbolt.org/z/KKqje8nGx stupid intel / no intel syntax flag
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> mjg, rip relative loads/stores vs imm32 loads/stores on x86
<mjg> immediates are cheaper, but how much or whatever other funny effects depends on uarch
<heat> the compiler on mcmodel=small no-pie no-pic still generates rip-relative accesses
<mjg> this is where my "knowledge" ends
<heat> crap
<heat> if the oracle of performance does not know the answer, what will we do?
<heat> (and if by oracle I mean in the classical sense, or in the Solaris sense, is up to interpretation)
<mjg> bruh i'm pretty sure i stated my x86 lolwledge is quite limited
<mrvn> heat: -m32 produces absolute addresses
<mjg> i can rant all day on multicore tho
<mjg> and i think i already did on this very channel
<heat> you? rant about multicore? whaaaaaaaaaaat
<mrvn> heat: how about measure?
<mjg> ikr
<mrvn> mmmmuuuulllltitititiccccororororeeee?
<gog> m m m m multicore
<mjg> you can fight data races
<mjg> or just use openbsd
<mjg> geist: funny you ask 23:45 < geist> really i mean what would solaris do?
<mjg> did you know they have a patch to gcc to store all args on the stack for dtrace to find
<mjg> it massively pessimizes the shit out of everything
<mjg> so much for zero cost probes, hehe
<mrvn> mjg: isn't that what x86 always does?
<mjg> no?
<mjg> perhaps i should also add they cannot tail call either
<mjg> it is pretty disgusting really
<mrvn> mjg: they could if gcc added a second entry after the stack frame is created.
bch has joined #osdev
<heat> mjg, lol, is that on prod?
<mjg> yea
<mjg> > for dtrace to find
<heat> lmao
<mjg> i'm pretty sure this can be achieved with dwarf or whatever the name
<mjg> instead
<mjg> but maybe it was not in good enough shape at the time and the hack was th easiest option
<mrvn> dearf is big and complex
<mjg> but ye, 'lmao' is in the right spirit
<heat> yeah DWARF probably does it
<mjg> now let's ask heat if he think all the pushes are 0 cost
<mrvn> mjg: for a non-leaf function you have to push the registers anyway.
<heat> pushes are not 0 cost
<mjg> what if they are abstracted?
<mjg> abstractions are 0 cost@!
<mrvn> .oO(Why do people always confuse 0 cost abstractions with abstraction cost 0?)
<heat> absolutely 0 cost yes sir abstraction never have a cost nuh-uh
<gog> consider the abstract cat
<mjg> mrvn, plz, where have you seen an abstraction which added any cost
<mjg> it literally never happens
<moon-child> mr mrvn wait
terminalpusher has quit [Remote host closed the connection]
<moon-child> what about the abstraction 0 cost?
<mjg> 0 cost abstractions are shit anyway, what's the point
<mjg> where my negative cost abstractions at
<mrvn> moon-child: cost abstraction zero?
<heat> mjg, yes, because they are *powerful* abstractions
irl25519 has quit [Quit: irl25519]
<heat> *dynamic*
<gog> i had underlying bugs in interrupt code
<gog> i get keybaord interupt now
<gog> clickety clack
<mrvn> codus interptus?
<gog> huehue
<gog> iret
<mrvn> iretq
<moon-child> iretd
<geist> gog: oh no your keyboard has died the click of death!
irl25519 has joined #osdev
<gog> ope
<mjg> cordyceptus!
<mjg> watch the last of us. ok mjg@
gildasio1 has quit [Remote host closed the connection]
<gog> so now i guess i need a ring buffer for input
gildasio1 has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
manawyrm has quit [Quit: Read error: 2.99792458 x 10^8 meters/second (Excessive speed of light)]
<mjg> heat: abstractions enable delivering value!
manawyrm has joined #osdev
<gog> yes because the most important thing you will do as a human being is delivering value
<gog> get used to it now
<gog> it'll hurt less later
elderK has joined #osdev
<mjg> so, some dude claimed compilation with *ht* enabled slows things down
<mjg> with 0 info past that
<gog> dang i love vague reports
<mjg> i just did a funny test with compiling the same file 4 times, -j 1 vs -j 2 with a taskset to the same core
SpikeHeron has quit [Quit: WeeChat 3.8]
<mrvn> mjg: wenn du dein cache halbierst passiert das schonmal
<mjg> -j 1 5.23s user 0.09s system 100% cpu 5.323 total
<mjg> -j 2 8.28s user 0.25s system 199% cpu 4.271 total
<mjg> also -j 2, but separate cores: 6.03s user 0.15s system 198% cpu 3.112 total
<mjg> tl;dr it is in-between, but a win
<CompanionCube> wasn't the aforementioned gcc patch one of the reasons illumos was stuck on gcc 4.x for a long time?
<mjg> CompanionCube: yes
<mrvn> mjg: mit hot caches?
<mjg> mrvn: ja
<mjg> mrvn: tmpfs
<mrvn> why are 2 cores so much slower?
<mjg> ?
<moon-child> mrvn: look at 'total', not 'user'
<mjg> 2 *cores* are the fastest variant for -j 2, as one can imagine
<mrvn> 5.23s vs 6.03s. 0.8s for locks?
<mjg> there is more user time, probably because bmake is stupid
<mjg> i can't be arsed to get a profile from this one
<mjg> the file at hand is not hello world either, but sys/kern/vfs_cache.c
<mjg> so a fair bit of work
<mrvn> overhead of starting and using the job server?
<mjg> that too, but should you strace bmake, you will find it is doing a lot of stupid
<mjg> and with -j 2 you get 2 of them doing the stupid
<mrvn> I use gnu make
<mjg> can't be fucked for this one
<mjg> key point was: ht does provide some win
<mjg> for this workload
<moon-child> is it maybe that stuff slows down with ht enabled, regardless of whether you use it?
<mjg> ?
<mrvn> mjg: the problem is you are using the same cache for both hyperthreads. If your working set gets bigger than half the cache then you loose
<moon-child> youc an turn off hyperthreading in bios or w/e
<moon-child> I know in past uarches, when hyperthreading was enabled, a couple of resources were shared fairly between cores
<moon-child> so this would make a difference
<moon-child> I think nearly all of them are shared competitively on newer uarches though
<moon-child> shared fairly between the hyperthreads of a core, that is
<mjg> wtf people
<mjg> you do realize i tested: -j 1, -j 2 with 2 threads on the same core, -j 2 with threads on separate cores
<geist> moon-child: yeah in general. sometimes there's still some static stuff, but mostly competitive
<moon-child> mjg: yes, I understand
<mjg> and of course 2 threads on the same core is slower than 2 separate threads
<mrvn> mjg: we do. your gcc test doesn't have a large working set so half the cache is still a win
xenos1984 has joined #osdev
<moon-child> but you did not test: -j1 with hyperthreading enabled, -j1 with hyperthreading disabled
<mjg> no, but should it matter?
<moon-child> on some uarches, yes
<mjg> there is literally only one thread in use in that case
<mjg> where
<moon-child> iirc on broadwell
<moon-child> you get 10 line fill buffers per physical core
<mjg> can you elaborate what's going on there?
<mrvn> mjg: on some uarchs when you enable hyperthreading then each thread gets half the cache. Even if you only have one thread running.
<moon-child> but when hyperthreading is enabled
<mjg> oh and it spilts that?
<mjg> huh
<mjg> ok that's fair
<moon-child> every hyperthread gets just 5
<mjg> gonna be honest, can't be fucked to reboot to test without ht
<mjg> :]
<mjg> maybe later
<geist> yah. like moon-child is saying it varies depending on the uarch. i remember reading the optimization manual of zen 1 at least, and i forget off the top of my head but it was like 4 out of 5 things are competitive, but there's one piece that's statically allocated
<mrvn> can linux power off the core in a hperthread?
<geist> like, half the L1 TLB or something
<heat> moon-child, is there a difference in disabling hyperthreading there?
<heat> or does it just change the MADT table to hide the HT cpus
<moon-child> heat: yes, if you disable hyperthreading it gives all 10 line fill buffers to the single thread running on that core
<geist> in the case of Zen on that case, for example, it's a more fundamental turn off, ie a bunch of MSRs that dont even start the second cores
<geist> ie, what the BIOS would do if you disable HT there
<mrvn> heat: disabling HT has a measurable effect provided you have code that stresses the resources.
<geist> what moon and i are saying is even if the second half is completely parked, ie sitting in a hlt, there may tsill be some overhead to having it enabled
<geist> heck, even a little bit of pressure on the register file may generate some disturbance
<geist> and that depends on precisely how the uarch is implemented
<heat> yes, my q is if disabling HT in the FW actually means disabling something in hardware or just hiding the cores
<moon-child> oh yeah good point, it also has to remember at least the architectural gprs of the other ht
<heat> which would totally be a thing
<mjg> as i said that is a fair point, my primary gripe is that when people compare ht vs non-ht, they roll with way higher -j and they really compare contention
<mjg> which is not an inherently ht thing
<moon-child> which, tbf, is not very much (prf is 200-300 now), but could still make a difference
<geist> heat: alls i know is i remember reading the zen BKDG (or equivalent) and it has the MSRs to *really* park the cores
<geist> ie, a way to hard stop cores and make sure they dont start without a system reset
<geist> and it's for the BIOS to use to park things
<moon-child> can it do it on a per-core basis?
<geist> probaby intel has something similiar
<mjg> the oldest yeller i have access to is westmere
<mjg> will try to test on it later
<geist> moon-child: i forget. i think it was more of a global HT stop
<heat> geist, zen bkdg is not public :/
<moon-child> mjg: does westmere even have hyperthreading? Looked at a random thingy and it seems not to https://ark.intel.com/content/www/us/en/ark/products/52584/intel-xeon-processor-e5603-4m-cache-1-60-ghz-4-80-gts-intel-qpi.html
<geist> it kinda implies that you do it when only the first core is running and it will go reload it's microcode or whatnot. ie, t's not fast
<bslsk05> ​ark.intel.com: Intel Xeon Processor E5603 4M Cache 1.60 GHz 4.80 GTs Intel QPI Product Specifications
<geist> heat: that's whyi said or equivalent. i forget the name of the zen BKDG equivalent
<moon-child> oh one of the bigger ones does
<mrvn> Would be cool in a dual socket system to have one with HT and one without for benchmarking purposes.
<geist> uh, PPR? somethingl ike that
<mjg> moon-child: yes
<mjg> moon-child: i have a 4 socket * 10 cores * 2 thread
<mjg> don't have the exact model handy
<geist> i think all of nehalem and it's server equivalent westmere are HT equipped
<geist> it was where intel added HT back, since they had not implemented it in core2 uarch
<heat> geist, could also just be the actual bkdg you got from work, no?
<geist> heat: possibly
<mrvn> mjg: remember when the average number of cores was 1.x?
<geist> heat: but if you read the zen optimization manual it does talk about HT and the effect of, and which parts are statically divvied up between threads
irl25519 has quit [Remote host closed the connection]
<geist> possible the static bits are gone now in zen 4, i haven't re-looked at the manual since
<heat> yeah I'm not doubting your word
<geist> and really since it says that theres a difference between HT being enabled and not being, it does kind aimply there's a switch somewhere, even hidden, to hard disable HT since that's a setting in BIOS
<geist> more so than simply not filling out the table
<geist> yah
<mjg> huh so extra q is if the os itself does not activate the ht APs
<mjg> are the resources eaten anyway?
<geist> the static ones yes
<geist> and thus the difference between static and dynamic competition of the two halves
<mjg> that is quite a bummer
<mjg> the problem with benching htis is that reboots can mess up timings a little
<mjg> and these fuckers take ages to boot too
<mjg> will have to leave it for a rainy day
<geist> ah here we go, snapshot from the zen optimization manual
<mrvn> mjg: buy a second system to run without HT
<heat> mjg, the firmware activates all the APs
<geist> which is what moon-child said before
<heat> the INIT-SIPI-SIPI crap just wakes the APs from being parked in firmware land
bch has quit [Quit: rebooter]
<geist> looks like the zen 4 opt guide is similar, it just has an additiona write combining buffer that is 'watermarked'
<mrvn> watermarked?
<heat> geist, do you have a link to the guide?
<heat> wondering if it says anything about riprel