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
SpikeHeron has quit [Quit: WeeChat 3.5]
netbsduser` has quit [Quit: Leaving]
* jjuran throws moon-child a fishy
kof123 has joined #osdev
isaacwoods has quit [Quit: WeeChat 3.6]
SpikeHeron has joined #osdev
nanovad has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
* moon-child catches fishy and chomps
* moon-child lays a dead rat at jjuran's feet out of gratitude
<jjuran> Awww, you shouldn't have
nanovad has joined #osdev
<kazinsal> huh, this is neat. didn't know this existed. http://minuszerodegrees.net/oa/OA%20-%20IBM%20Cluster%20Adapter.pdf
<moon-child> oh cool
<moon-child> when is that from?
<moon-child> haha 'ballpoint pen' (pg 96)
<kazinsal> that's from the 1984 Options and Adapters manual
<kazinsal> so possibly earlier even
FreeFull has quit []
nyah has quit [Ping timeout: 260 seconds]
nanovad has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
nanovad has joined #osdev
<kazinsal> this site is an absolute treasure trove. gigabytes upon gigabytes of digitized and OCRed technical manuals
eryjus has joined #osdev
eryjus has quit [Client Quit]
gog has quit [Ping timeout: 260 seconds]
matt__ has joined #osdev
jack_rabbit has joined #osdev
knusbaum has quit [Ping timeout: 240 seconds]
matt__ is now known as freakazoid333
knusbaum has joined #osdev
jack_rabbit has quit [Ping timeout: 268 seconds]
gog has joined #osdev
Test_User is now known as \Test_User
lentement has joined #osdev
lentement has quit [Client Quit]
lentement has joined #osdev
kof123 has quit [Ping timeout: 268 seconds]
heat_ has quit [Remote host closed the connection]
heat_ has joined #osdev
night has quit [Read error: Connection reset by peer]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
foudfou_ has joined #osdev
terrorjack has joined #osdev
foudfou has quit [Quit: Bye]
night has joined #osdev
simpl_e has quit [Ping timeout: 268 seconds]
[itchyjunk] has quit [Remote host closed the connection]
sympt has quit [Ping timeout: 260 seconds]
kof123 has joined #osdev
heat_ has quit [Ping timeout: 244 seconds]
opal has quit [*.net *.split]
foudfou_ has quit [*.net *.split]
gxt has quit [*.net *.split]
kof123 has quit [Ping timeout: 268 seconds]
opal has joined #osdev
gxt has joined #osdev
night has quit [Read error: Connection reset by peer]
night has joined #osdev
foudfou has joined #osdev
night has quit [Read error: Connection reset by peer]
night has joined #osdev
Mutabah_ is now known as Mutabah
kof123 has joined #osdev
night has quit [Quit: goodbye]
night has joined #osdev
foudfou has quit [Quit: Bye]
foudfou has joined #osdev
gxt has quit [Ping timeout: 258 seconds]
gxt has joined #osdev
opal has quit [Ping timeout: 258 seconds]
opal has joined #osdev
the_lanetly_052_ has joined #osdev
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
bauen1 has quit [Ping timeout: 260 seconds]
gog` has joined #osdev
nick64 has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 252 seconds]
lg_ is now known as lg
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
vdamewood has joined #osdev
bauen1 has joined #osdev
nyah has joined #osdev
GeDaMo has joined #osdev
<kazinsal> writing code for a system that has constraints but that you also know the exact state of at any given point in time is so relaxing
<kazinsal> boot sector space is at a premium? no worries, don't bother doing segment fixups, there's only one possible state for the system to be in when the XT BIOS hands control over to you!
<mrvn> no worries, someone with more time has already solved that problem and called it a bootloader.
Terlisimo has quit [Quit: Connection reset by beer]
Terlisimo has joined #osdev
<kof123> the devil you know versus the devil you don't :D
lentement has quit [Quit: WeeChat 3.5]
kof123 has quit [Ping timeout: 268 seconds]
kof123 has joined #osdev
nick64 has quit [Quit: Connection closed for inactivity]
freakazoid333 has quit [Ping timeout: 255 seconds]
gxt has quit [Ping timeout: 258 seconds]
gxt has joined #osdev
bauen1 has quit [Ping timeout: 244 seconds]
ghee has joined #osdev
kof123 has quit [Ping timeout: 268 seconds]
[itchyjunk] has joined #osdev
gildasio has joined #osdev
bauen1 has joined #osdev
andydude has joined #osdev
andydude has quit [Client Quit]
gildasio has quit [Remote host closed the connection]
Ali_A has joined #osdev
puck has quit [Excess Flood]
puck has joined #osdev
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
demindiro has joined #osdev
<demindiro> Real hardware is such a fucking pain
<demindiro> First the xHCI MMIO region was all 0xfffff because ?? Firmware being odd when booting with CSM
<demindiro> Then I apparently misunderstood how I was supposed to handle port reset (and am probably still doing it wrong somehow)
<demindiro> Lastly I spend about a day forgetting that scratchpad buffers are a thing
demindiro has quit [Client Quit]
gog has quit [Ping timeout: 268 seconds]
Ali_A has quit [Quit: Connection closed]
gog has joined #osdev
puck has quit [Excess Flood]
puck has joined #osdev
frkzoid has joined #osdev
gildasio has joined #osdev
epony has quit [Remote host closed the connection]
elastic_dog has quit [Ping timeout: 268 seconds]
sikkiladho has joined #osdev
elastic_dog has joined #osdev
carbonfiber has joined #osdev
heat_ has joined #osdev
<heat_> demindiro: sounds like MMIO wasn't configured
heat_ is now known as heat
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
FreeFull has joined #osdev
pretty_dumm_guy has joined #osdev
demindiro has joined #osdev
<demindiro> heat: do you mean that the BAR isn't configured or something else? According to GRUB it's set to 0xc1320000, which looks right to me, though reading from it returns 0xffffffff
<mrvn> It's clearly something mumble mumble mumble
<heat> if it always returns all ones, then yes, something got screwed up when setting up the BAR
<heat> or caching is screwed, that's also possible
<mrvn> 0xffffffff is a marker for not configured or something
<demindiro> hm
<heat> all-ones is what x86 platforms usually return when they can't decode the address
<heat> now, ~3GB is a plausible address for MMIO so...
<demindiro> I guess I'll look into Linux source later, maybe they have some pointers
<heat> wait
<heat> what read is returning all-ones?
<demindiro> From 0xc1320000
<heat> hm
<demindiro> And at some offsets like 0x18
<heat> so you're reading the BAR in your kernel and reading from it, and you get garbo?
<heat> and only in CSM?
demindiro has quit [Ping timeout: 252 seconds]
demindiro has joined #osdev
<demindiro> heat: yes, CSM and CSM+UEFI return garbage, UEFI only works
<demindiro> I haven't checked what the value of the BAR is with UEFI only though, could be interesting
ghee has quit [Quit: EOF]
epony has joined #osdev
carbonfiber has quit [Quit: Connection closed for inactivity]
bauen1 has quit [Ping timeout: 252 seconds]
bauen1 has joined #osdev
<heat> demindiro, CSM runs on top of UEFI
kof123 has joined #osdev
<heat> I'd say something else is super broken
<heat> memory map maybe?
bauen1 has quit [Ping timeout: 268 seconds]
bauen1 has joined #osdev
bauen1 has quit [Ping timeout: 244 seconds]
bauen1 has joined #osdev
frkzoid has quit [Ping timeout: 244 seconds]
matt__ has joined #osdev
matt__ is now known as freakazoid333
freakazoid333 has quit [Ping timeout: 244 seconds]
GeDaMo has quit [Quit: Physics -> Chemistry -> Biology -> Intelligence -> ???]
<geist> yah that sounds like you're not reading the right thing
<geist> IIRC all 0s is officially unconfigured
<geist> you shouldn't even be able to read all 0xffffs from a bar because of the unimplemented lower bits, since that's how you determine the size
<geist> (unless it's an unimplemented bar i guess)
<demindiro> geist: I'm not reading the BAR itself, I'm reading what the BAR points to, and both my OS as GRUB return fffff
<geist> oh
<zid> That's what I'd expect from open bus, sure your page tables or whatever are definitely decoding your pointer to 0xc1320000 or whathaveyou?
<demindiro> Yes, the same issue occurs in GRUB by the way, so I don't think it's an issue with my OS.
<zid> 'occurs in grub'?
<demindiro> I use GRUB cli and read_dword 0xc1320000
<zid> ah I had absolutely no idea that existed, neat
<geist> ah then i guess whateer that bar points to has all fs in it. is it register space?
<zid> yea either that's just expected behavior, or one of your other assumptions are wrong
<demindiro> You mean xHCI registers?
<zid> (wrong bar number, for example)
<demindiro> It works in UEFI
<demindiro> And xHCI only uses BAR0
<zid> what does works in uefi mean
<demindiro> Maybe it has something to do with the EHCI device that's apparently present somewhere
<demindiro> UEFI only, CSM disabled
<zid> sounds like CSM is properly resetting the chip then? :P
<demindiro> You mean the xHCI chip? I can't configure the chip if it only returns ffff
<zid> you need to read from it to assert a reset on it?
<demindiro> IIRC operational registers are defined at a certain offset from the base
<demindiro> Which is variable
<zid> other bizzare things I can think of: You need to give it bus mastering for it to work right, something to do with capabilities, something something spooky ghosts
<geist> xhci has zero to do with uhci or ehci
<geist> so you should not expect the registers to look remotely similar
<geist> oh wait UEFI. never mid
<geist> i read UEFI as UHCI
<demindiro> I know that it's not similar, but maybe it's some weird emulation thing
<demindiro> I enable bus mastering by default, which doesn't seem to cause issues so far
<geist> this is usually where i look for trace points with `-d trace:help`
<demindiro> If only I could do that on a laptop :P
<geist> or start hacking qemu to add printfs to the xhci code. good drivers have a trace macro you can set at the top of the file
<demindiro> My xHCI code works fine in QEMU
<geist> ah
<demindiro> It's my laptop that's acting up
<geist> a thing to try: see if the bios has a 'emulate keyboard' mode tha tyou can turn on/off
<geist> i never fully grokked that whole emulation of keyboard stuff and how it precisely intersects with xhci
<zid> I think it's all done with smm behind you rback
<geist> yes, but what state does it leave xhci ni, etc
frkzoid has joined #osdev
<geist> i get the gist of it, but theres some sort of details as to how you're supposed to do a handoff, etc
<zid> yea idk how to do the handoff either
<clever> i think the osdev wiki mentioned how to trigger the handoff
<clever> and bios having a compat flag to turn that off, was for OS's that lack the ability?
<demindiro> Handoff I do, but for handoff I also need to be able to actually read anythign
<zid> so we're just down to spooky ghosts I think
<demindiro> Anyways, checked BIOS and only found stuff about "legacy USB" and "USB 3.0", nada about keyboard or mouse
<demindiro> It's a HP EliteBook Folio 1040 G2 in case it matters
<demindiro> Anyhow, UEFI only works so I'm just gonna stick with that
<zid> good news, my PC is currently the opposite
<clever> i would assume uefi does it differently, exposing the keyboard as stdin, and terminating it when you ExitBootServices
<clever> while legacy has to emulate it via the ps2 controller api, and there is no clear ExitBootServices call, so they had to add a new thing that some OS's dont do
<geist> demindiro: yeah but did you try flipping aby of those bits?
<geist> if it changes the behavior that isn't necessarily an answer, but would be interesting data nonetheless
<demindiro> I'll try it tomorrow, not sure how I'll be able to observe any changes though
<geist> well if it suddenly stopped having all fs
<geist> not saying it's a solutino,it's just a related knob you can tweak and then see if you get any observed results
demindiro has quit [Ping timeout: 252 seconds]
sikkiladho has quit [Quit: Connection closed for inactivity]
<heat> again, I'm betting your memory map is screwed and your page table is in the middle of nowhere
<heat> CSM is *under* UEFI
<heat> mostly everything that runs for UEFI-only runs for CSM
<heat> clever, chipsets can support PS2, they also may not support PS2
<heat> new ones don't
<heat> I think that laptop is old enough to have it
<geist> because a chipset doesn't support ps2 doesn't mean you can't add a superio chip
<geist> i dont think modern intel and amd chipsets have had native ps2 support for 5-10 years, but superio chips on LPC bus pull that off
<heat> but PS2 isn't done on superio, it's done in SMM
<heat> I think
<geist> well *emulated* ps2 over usb yeah
<geist> true ps2, which some laptops may still do internally, are superio based nowadays
<heat> yeah
<geist> for osdev reasons i tend to buyd ASUS motherboards with COM1 headers which still tend to have PS2/mouse connectors presumably because the same nuvoton chip provides both
<geist> or probalby the other way around: they sell them because some gamers think ps2 is better, and then they get a free COM port while they're at it
<heat> oh yeah totally
<heat> good to know
<zid> My input devices send a thousand interrupts a second because ps/2 was better
<heat> same
demindiro has joined #osdev
<heat> well, they don't send interrupts
<heat> but the polling rate for my mouse is 1000Hz
<zid> I have an actual chip somewhere that sends all 1000 interrupts a second, whether you pressed a dang button or not
<mjg> gamers vs ps2?
<mjg> never heard of that one
<heat> some oldies are very convinced ps2 is better
<demindiro> heat: I'm having the same issue with GRUB, so I doubt it's an issue with the page tables
<heat> same for oldies and crt monitors too
<heat> demindiro, what's the issue with GRUB?
<heat> does linux boot under that configuration?
<demindiro> I use GRUB cli and read_dword 0xc1320000
<demindiro> Which also gives ffffff
<heat> wait
<heat> is it 0xffffffff or 0xffffff
<heat> there's a huge difference
<clever> zid: my dad got some magic air mouse a few days ago, and i was messing with it under linux, and its funky as heck
<demindiro> 8 f
<clever> modifier keys have key-repeat on them, lol
<demindiro> I just mash the keyboard on IRC
<clever> and its imposible to alt+tab thru multiple windows, every time you hit tab, it releases, then pressed alt again
<clever> and shift having key-repeat, makes it messy to use for PTT
<heat> demindiro, does linux boot?
<heat> does it drive xhci successfully?
<zid> lscpi -vvvvvvv
<clever> ah wait, seems key-repeat on shift is normal, never checked other keyboards
<heat> does that pci device have mmio enabled?
<heat> like, you need to enable that
<zid> key repeat on shift is not normal
<moon-child> lspci -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
<zid> it's one of the modifier bits in the first byte of the hid packet
<heat> the v stands for virgin
<clever> zid: it happens when i aim evtest on /dev/input/event5 (a usb keyboard)
outfox has quit [Ping timeout: 268 seconds]
<zid> well, it isn't true
<demindiro> It used to, though I messed up my root partition, so that panics the kernel.
<zid> either you have an outlier keyboard, or evdev does weird things
<clever> zid: it doesnt repeat under xev though (x11 events)
<zid> That's what a hid packet looks like for a usb keyboard
<heat> demindiro, check the (command?) register on the PCI device
<zid> modifiers, a null byte, then 6 keys
<zid> (why they've drawn it backwards idk)
<clever> compose (shows up as keysym 0xff67, Menu) is the only modifier-ish key that repeats
<clever> zid: yep, i have generated HID packets before
<clever> but releasing alt every time you hit tab, just makes it useless for certain tasks
<clever> if you hold alt, it holds alt, if you then hit tab, it considers that one action, sends alt+tab, then sends nothing (not even alt), then returns to just alt
<clever> so you cant cycle thru windows
<zid> yes I understand
<zid> but you claimed shift repeating was normal, so I was replying to that
<clever> yeah, shift seems weird, evtest repeats, xev doesnt repeat
<clever> i didnt think to check the raw HID packets
<demindiro> heat: all zeroes initially
<heat> that's a problem
<bslsk05> ​github.com: Onyx/pci.h at master · heatd/Onyx · GitHub
<heat> particularly, the lower 3 bits are important
<heat> first for io ports, second for mmio, third for busmastering
<demindiro> That's odd, I can confirm the other PCI devices have some of the lower bits set
<demindiro> So I guess firmware is messing things up then
<heat> firmware doesn't enable it because it's not using it is a possibility
<demindiro> Setting the memory bits works, thanks!
<heat> np
<demindiro> So now I wonder: is it safe to just enable it if it isn't?
<heat> yes
<demindiro> Alrighty
<heat> the memory bit enables PCI decoding of its memory ranges
sprock has quit [Quit: brb]
<heat> else you get all-ones, as is tradition in PC
<demindiro> Well, I can read it but the controller doesn't seem to be doing much, but I can figure hat out later
<geist> aah nice. so my guess is firmware explicitly disabled those bits efore handing off to you
<geist> which is smart. that prevents the device from being able to DMA over memory or whatnot
<geist> so probalby a safety thing in their firmware
<geist> as a general rule you should set/unset those bits when the driver has control and when it relinquishes control
<geist> think of those bits as safety bits to keep the device from being able to access anything
<demindiro> That's the bus master bit no? I don't think a device can compromise anything with MMIO
<geist> yah, i think of all of them as the same class of arming bits, but you're right, the int and mmio bits are more of a device -> host than host -> device
<geist> the io/mmio bits are still telling the dvice to start decoding things across the bus (or at least in the classic shared PCI bus model)
<geist> in pcie it's probably all emulated higher up
<geist> s/int and mmio/int and bus master/
epony has quit [Remote host closed the connection]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
SpikeHeron has quit [Quit: WeeChat 3.6]
opal has quit [Remote host closed the connection]
opal has joined #osdev
frkzoid has quit [Ping timeout: 255 seconds]
SpikeHeron has joined #osdev
epony has joined #osdev
sprock has joined #osdev
demindiro has quit [Quit: Client closed]
foudfou has quit [Quit: Bye]
foudfou has joined #osdev
<heat> geist, I think that the laptop's firmware is going straight for CSM, and the keyboard must be using PS2 so they're not even bothering to initialize XHCI
<heat> and that's why MMIO is not enabled in the PCI config
<heat> it makes sense and is entirely defined in UEFI. the firmware isn't required to initialize all the hardware, only the chunks it sees as useful to boot
<heat> (which is why fast boot, etc works)
matt__ has joined #osdev
archenoth has quit [Read error: Connection reset by peer]
matt__ is now known as freakazoid333
<kazinsal> geist: speaking of boards with COM1 headers on them, do you know of any modern-ish board with a floppy disk connector on it? I have a Bad OSDEV Idea (tm) that may require me finding a 5-1/4" floppy drive that can format and write 360K disks...
<klange> Even my most retro-kitted board here has IDE but no floppy...
<kazinsal> yeah, I'm uh, a little bit into the retro rabbit hole to the point where I'm looking for an XT on ebay...
<kazinsal> which may end up turning into me just finding one locally for sale somewhere else in the PNW and driving down because the import and shipping charges for a full vintage minicomputer with CRT and all will probably kill me
<zid> sounds like something you'd need to shove on a pci-e card these days, but you'd get no bios boot from it
<zid> (or more realistically, mount a usb floppy drive internally)
<heat> honey wake up
<heat> lisa su is announcing the new ryzens
<heat> 5nm baby
<zid> That's a very small baby
<heat> AVX 512
<heat> WHAT
<zid> which nanorevision?
<zid> 512-vhfmividibi
<heat> yes
<heat> all of the letters
<geist> yeah they finally picked up avx512
<heat> did you have TOP SECRET CONFIDENTIAL AMD(r)(TM) info about that?
<geist> yeah
<heat> you get info but no commits? :|
<geist> nothing fantastic, just in general have the regular docs before they're public is all
<kazinsal> I guess I'll probably be building a 7600X box or something to replace my 8700K and relegate the 8700K to replace the SB xeon box
<geist> kazinsal: yah that'd be a good jump. i have a 5950x so not worth a jump yet
<zid> 5950x is a good bit of shit
<heat> the general boner for AI is pissing me off
<zid> that's the one I wanted most out of that gen
gildasio has quit [Remote host closed the connection]
<kazinsal> if the raise my boss is promising this fall actually comes through then it'll be 7600X, a working XT, *and* going on vacation next year lol
<geist> zid: yeah totally. i mean it wasn't justified getting that one, i broke my usual rule of only upgrading when it's 2x
gildasio has joined #osdev
<zid> geist: I'll give you £20 for it after you upgrade
<geist> it'll be a few years beofre i do
<heat> zid, kazinsal has a SB xeon he's going to throw away
<heat> I heard you like your xeonx 👀
<geist> i'dneed to up my cooling game anyway. my 5950x definitely pushes my ability to keep it cool. not sure if it's because i didn't get a good thermal connection or what, the liquid cooler should do a fine job with it
<geist> but it still seems to push it a bit
<geist> but haven't bothered to really try to microoptimize it
<zid> what's SB?
<heat> sandybridge
<zid> sky blake
<zid> oh snap then
<zid> I also have an SB xeon setup that's getting rid of itself
<heat> shit
<zid> the smoke is coming out
<heat> oh well, there's a replacement
<heat> it's called "brand new SB xeon"
<zid> probably costs more to ship than it's worth these days
<kazinsal> you also probably don't want this board
<kazinsal> it is... questionable
<zid> Same
<zid> Mine's completely and utterly haunted rn
<zid> cpu's still good though!
<kazinsal> even with multiple CR2032 replacements it still won't hold BIOS settings after a power blip
<zid> It barely posts, bios crashes if you press del
<zid> have to aggressively toggle the power to get it to go "overclocking failed, press f1 to enter settings" if you wanna change anything :D
<zid> getting a new psu, and new spi flash rom if I can find one, which might help
archenoth has joined #osdev
<zid> amazon has 5 on pcbs with breakout connectors for £7 but I can't find the actual chips, heh
<heat> i lost braincells looking at youtube's chat
<heat> anyway, cool
<zid> working as intended
<zid> The idea is to make you turn into a drooling mess that can't figure out how to leave youtube
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
freakazoid333 has quit [Ping timeout: 255 seconds]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
smach has joined #osdev