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
zxrom_ has joined #osdev
Yoofie has quit [Read error: Connection reset by peer]
zxrom has quit [Ping timeout: 246 seconds]
nvmd has quit [Ping timeout: 250 seconds]
nvmd has joined #osdev
les has joined #osdev
tacco has quit [Remote host closed the connection]
nvmd has quit [Quit: WeeChat 3.8]
wblue has joined #osdev
MiningMarsh has quit [Ping timeout: 240 seconds]
heat has quit [Quit: Client closed]
vdamewood has joined #osdev
tomith has quit [Read error: Connection reset by peer]
tomith has joined #osdev
<zid> gog will get this refence
<zid> remind me to re-link it when she's online
mhall has quit [Quit: Connection closed for inactivity]
heat has joined #osdev
wblue has quit [Quit: wblue]
wblue has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou_ has joined #osdev
wblue has quit [Quit: wblue]
wblue has joined #osdev
tomith has quit [Ping timeout: 252 seconds]
wblue has quit [Quit: wblue]
[_] has joined #osdev
[itchyjunk] has quit [Ping timeout: 246 seconds]
[_] is now known as [itchyjunk]
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
zaquest has quit [Remote host closed the connection]
[itchyjunk] has quit [Ping timeout: 252 seconds]
ih8win8 has quit [Ping timeout: 245 seconds]
edr has quit [Read error: Connection reset by peer]
sham1_ is now known as sham1
frkzoid has quit [Read error: Connection reset by peer]
frkazoid333 has joined #osdev
Arthuria has joined #osdev
fkrauthan has quit [Quit: ZNC - https://znc.in]
fkrauthan has joined #osdev
TkTech has joined #osdev
Arthuria has quit [Ping timeout: 245 seconds]
Gooberpatrol66 has joined #osdev
heat has quit [Quit: Client closed]
slidercrank has joined #osdev
lg has joined #osdev
ppmathis2 has joined #osdev
ppmathis has quit [Quit: Ping timeout (120 seconds)]
ppmathis2 is now known as ppmathis
zxrom__ has joined #osdev
zxrom_ has quit [Ping timeout: 245 seconds]
goliath has joined #osdev
mjg has joined #osdev
zxrom__ is now known as zxrom
<kazinsal> "this new feature shouldn't be too hard to test" two hours later: "this manually-reconstructed ISO should be good enough to boot this cycle-accurate 486DX emulation into openbsd 2.2"
<zid> 12 hours later "Oh, I need to flip this virtual dip that hasn't been exposed via the config, ffs"
<kazinsal> 14 hours later "an explosion rocks the battlestar"
<zid> 18 hours later "oh I'm dumb, it's Boot01 not Boot_01, it was right 8 hours ago"
<sham1> Your test harness is quite wild if it's using a battlestar
<zid> That's why it's a 486DX
<zid> what else would a battlestar use
<sham1> A threadripper
<zid> not space hardened/tested enough
<zid> need big chonky transistors that are more immune to wandering rays
zxrom has quit [Ping timeout: 240 seconds]
<sham1> Just encase it in lead
<zid> lead's heavy, best I can do is tinfoil
hmmmm has quit [Remote host closed the connection]
hmmmm has joined #osdev
tomith has joined #osdev
wgrant has quit [Quit: WeeChat 3.5]
wgrant has joined #osdev
danilogondolfo has joined #osdev
Burgundy has joined #osdev
zxrom has joined #osdev
mhall has joined #osdev
SGautam has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 245 seconds]
Burgundy has quit [Remote host closed the connection]
Left_Turn has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 258 seconds]
GeDaMo has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas0 has joined #osdev
nyah has joined #osdev
awita has joined #osdev
vai has joined #osdev
Vercas has joined #osdev
Vercas0 has quit [Remote host closed the connection]
<sham1> hi
gog has joined #osdev
<moon-child> hi
SGautam has quit [Quit: Connection closed for inactivity]
corecode_ is now known as corecode
gildasio has joined #osdev
MiningMarsh has joined #osdev
<gog> hi
<gog> hola
hmmmm has quit [Remote host closed the connection]
vai has quit [Remote host closed the connection]
hmmmm has joined #osdev
<mcrod> hi
ih8win8 has joined #osdev
edr has joined #osdev
vai has joined #osdev
CapEnt has joined #osdev
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
foudfou_ has quit [Remote host closed the connection]
foudfou has joined #osdev
nvmd has joined #osdev
nvmd has quit [Max SendQ exceeded]
nvmd has joined #osdev
dude12312414 has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat> gog do you have more ideas for our tobacco business
<mcrod> heat may I hug you
<gog> heat
<gog> i am not starting a tobacco business with you
<heat> mcrod yes
* mcrod hugs heat
<heat> gog what???
* heat hogs back
<heat> gog i want to make money out of addiction and human misery
<mcrod> i've been watching bullet ant ritual videos
<mcrod> absolutely fucking insane
<Cindy> heat: if you make a soda business, i swear i will defend you with my life
goliath has quit [Quit: SIGSEGV]
nvmd has quit [Quit: WeeChat 3.8]
xenos1984 has joined #osdev
<mcrod> i am a whore for dr. pepper
<heat> you're a whore UwU
<mcrod> only for you
<mcrod> do you serenade women with your memory allocation knowledge
<Cindy> mcrod: i am a whore for pepsi
<mcrod> pepsi is fine
<mcrod> coca cola i think is slightly better
<Cindy> yeah
<Cindy> i'm a whore for both :P
<heat> mcrod yes but they end up leaving before i get to the slab allocation part
<heat> if we get to SLUB you're marriage material
<mcrod> "babe let me overflow that stack"
andydude has joined #osdev
<ih8win8> When someone says "flush" a cache or buffer, does that mean to discard its contents, or commit its contents?
<nortti> depends on the kind of cache
<clever> ih8win8: and which one you want also depends on the direction of data flow
<nortti> I'd say generally, if it's a cache that holds the authoritative copy of something (processor caches, page cache) it means to commit, otherwise discard
<ih8win8> What about in the context of a FIFO?
<clever> ih8win8: if the FIFO is in MMIO space, it should never be cached
<clever> every read from the addr should produce different daa
<clever> and every write should go directly to the hw
<Mutabah> "Flush" there would usually mean waiting for it to clear (drain to the hardware)
<clever> yeah, it can also mean waiting for the hw to drain the FIFO into whatever its talking to
<ih8win8> Well, I'm trying to program a USB controller, and it has a TX FIFO (assuming this means a buffer to temporarily hold packets before they are sent onto the USB). So, flushing that FIFO would mean to send those packets over the USB now, right? not to discard them?
<clever> ih8win8: in that context, you would write to the control registers, to tell the usb controller to actually transmit the data, and then wait for it to happen
<clever> ih8win8: section 6.4.5.1, writing the transmit fifo in slave mode
<ih8win8> But I'm using DMA mode, not slave mode.
<clever> then we want something like section 6.4.5.8, control transactions in dma mode
<clever> and you must flush the buffer containing that packet, so it exists in dram
<clever> so you need the arm L1/L2 cache control opcodes, to ensure the data exists in dram
<clever> and respect the dma-ranges in device-tree
<ih8win8> From what I gather from that document, in slave mode, you have to manually fill the TX FIFO with the CPU, while in DMA mode, you just program the DMA register, and it starts copying into the FIFO once you enable the channel.
<clever> yep
<clever> but the dma cant spy on the arm caches
<clever> so you must flush the arm cache first, to ensure data exists in dram
<ih8win8> Yeah, I flush my data before handing the address over to DMA.
<clever> and for the other direction,when dma writes to ram, the copy in the arm cache is out of date
<clever> so you need to evict those cache lines before you try to read it
<clever> and beware, any other data in the same cache line will be lost
<clever> so you generally want to round up the size of your buffers, to a full cache line, and have them cache-line aligned
<clever> so nothing else winds up in the same line
<ih8win8> There's supposed to be an interrupt when a channel is done transmitting (bit 0 of HCINT). After I enable the channel, I see data going into the FIFO by inspecting GNPTXFSIZ (8 bytes are now taken up), but I never get that transmit done interrupt.
<ih8win8> On qemu, when I enable the channel, it sends immediately, and then I do get the transmit done interrupt.
<clever> ih8win8: anything from bit1 or bit2 of HCINT?
<clever> what about the HCINTMSK?
<ih8win8> HCINT is all zero.
<ih8win8> HCINTMSK is 7FF
<clever> yep, that should allow all
<ih8win8> I also enabled bit 25 of GINTMSK.
<clever> has an address been assigned to the device yet?
<ih8win8> No, this is the initial SETUP packet (for a control transfer to set the address), so it goes to device address 0.
<ih8win8> I do get the interrupt in Qemu, but not on real hardware, so I wonder if there's a need to flush the FIFO or something.
<clever> ih8win8: oh, one potential trap, is the usb hub out of reset?
<clever> which model of pi?
eddof13 has joined #osdev
<ih8win8> you mean the onboard hub attached to the pi with 4 ports?
<ih8win8> It's a pi 3.
<clever> yeah
<ih8win8> How would I know that?
<ih8win8> bit 8 of HPRT is not set, if that's what you mean.
<clever> ih8win8: hmmm, its hidden behind the i2c gpio expander
<clever> one min
<clever> ih8win8: hmmm, i think the firmware is managing that reset for you, and just never exposes it
<clever> so i would expect that to just work
<ih8win8> Are there mailbox commands to check that?
<clever> the ones that raspberrypi,firmware-gpio (from linux) is using
<clever> drivers/gpio/gpio-raspberrypi-exp.c
<clever> RPI_FIRMWARE_GET_GPIO_STATE, and struct gpio_get_set_state
<clever> RPI_FIRMWARE_GET_GPIO_STATE = 0x00030041,
<clever> that gives access to an 8 pin i2c gpio expander, gpio3 is the LAN_RUN pin
<clever> but device-tree never tells linux what to do with 3, so i would assume its already in a valid state
<ih8win8> hmm I wonder if there could be an issue with high speed vs full speed.
<ih8win8> I set bit 2 of HCFG to use full speed (not ready to tackle split transactions just yet), but it didn't really make a difference.
<ih8win8> clever, is there a list of all known mailbox commands somewhere?
<ih8win8> thanks!
<clever> there are ~4 places you can find mailbox codes, linux, u-boot, the mailbox wiki, and decompiling the firmware
<clever> every list is incomplete
<clever> and that text file, is every one ive seen, that looked useful
<clever> mailbox.txt also has some flags, saying where you can find more info
<ih8win8> Decompiling reveals everything. I know from working on the Ocarina of Time decomp. :)
<clever> except, the mailbox function, decompiles into a horid nest of if statements, switch statements, and 500+ lines of garbage
<clever> its unreadable
<ih8win8> I assume that's all VPU code, right?
<clever> yep
<ih8win8> I wonder if Ghidra supports it.
<clever> that horid mess is what ghidra produced :P
<ih8win8> For N64 decomp, someone wrote his own decompiler called mips2c tailored specifically to Nintendo's compiler, and it produced way better output than Ghidra ever could.
<ih8win8> I wonder if the VPU firmware was written in C or asm. Seems like a lot of work to get a C compiler to target that, but so is writing everything in asm.
<clever> i suspect both
<clever> some functions follow a very clear set of rules, like a compiler wrote it
<clever> some functions break all the rules
<ih8win8> hmm there does seem to be a mailbox command to power on the USB HCD (is that Host Controller Driver?) https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface#power
<clever> ih8win8: i think thats for turning the whole dwc2 on/off
<clever> and if it was off, you would immediately get an external abort interrupt on the arm, when trying to touch anything
<ih8win8> Guess I'll give that a shot. Can't imagine that would affect anything, since everything else has worked so far, just that the channels don't seem to work. But I'm running out of ideas to try.
kerravon has joined #osdev
kerravon64 has joined #osdev
<ih8win8> Holy fucking shit, it did something! I got an ACK back from the hub?
kerravon64 has quit [Client Quit]
<ih8win8> No other driver I've seen uses that mailbox command, but apparently I need it somehow. ¯\_(ツ)_/¯
<clever> ih8win8: weird
<ih8win8> thanks for your help
<clever> yep
<zid> gog
<gog> lel
<gog> i can't wait to see that
<gog> love margot robbie
<gog> and ryan gosling's journey of self-discovery that was the role of ken
<gog> he's got the kenergy
<sham1> View it together with Oppenheimer and experience the absolute clusterfuck
<gog> i don't get the memes
<sham1> Both Barbie and Oppenheimer release on the same day, so clearly they're meant to be combined
<gog> ohhh
<heat> im really looking forward to oppenheimer
<heat> cillian murphy poggers
<zid> oppenheimer is The Craft for nerds
<heat> by order of the peaky blinders but instead of a shitty UK gang its the US army and we're testing highly deadly nuclear weapons
<sham1> zid: and as a nerd, I'm all for it
<heat> tf is the craft?
<zid> A movie
<heat> thanks zid
<heat> >1996
<heat> oldies lmao
<gog> the craft!
<gog> this movie is why i'm now fixated on goth girls
<gog> and beetlejuice
<zid> generally the closer a movie is to 1994 the better it is, heat
<sham1> What makes 1994 the optimal movie year
<zid> nothing it's just around then
<zid> pre 85 movies are generally too old to be decent, anything past 2010 is a disgusting remake cashgrab
<heat> the optimal movie is star wars episode 2
<sham1> This is where the fun begins
<heat> followed by star wars episode 1
<heat> and then star wars episode 0
<heat> just kidding, there's no episode 0, the star wars people aren't nerds
<heat> no one counts from 0 0 is a useless number
<sham1> How about Ep. 4, 5 or 6
<heat> crap
<heat> all of em
xenos1984 has quit [Ping timeout: 246 seconds]
goliath has joined #osdev
xenos1984 has joined #osdev
<mcrod> i've never seen star wars
<mjg> don't watch it
<mjg> shite franchise
<zid> That's a good show
<gog> counterpoint: the french dispatch
<sham1> How can you say that it's a shite franchise if you haven't even seen it
<gog> mad max fury road
<gog> uhhhh
<gog> everything everywhere etc.
<mjg> i don't recognize the uhhhh movie
<mjg> what is it about
<gog> idk
<heat> watching movies is pessimal
<heat> dont be pessimal, be optimal, work
<zid> last good movie I saw was the one I never remember the name of one sec
<zid> arrival
<heat> the new indiana jones is pretty good
<heat> i watched it twice
<zid> three billboards outside of ebbing missouri was good
<zid> about 1 per year tops
slidercrank has joined #osdev
<zid> 1998 had what dreams may come, deep impact, dark city, enemy of the state, ronin, fear and loathing in las vegas, truman show, american history x, lock stock, sphere, patch addams, the big lebowski, the faculty, armageddon, rush hour, something about mary, run lola run, sliding doors, saving private ryan, you've got mail
<gog> i've seen one MCU film
<gog> i will not see another
<heat> gog
<heat> gog
<heat> gog
<zid> 1997 had good will hunting, cube, contact, the jackal, air force one, fifth element, face/off, batman and robin, liar liar, jackie brown, con air, full m..
<kazinsal> someone once said to me that MCU films are the cheap fast food of cinema but I can go feral on a mcchicken and not feel bad about the death of cuisine
<zid> MCU movies are vapid wastes of time
<zid> It's more like eating a $800 entree made of gold
<zid> completely indigestible
<gog> heat
<heat> hi!
<gog> hi
<heat> how r u
<gog> i'm well how u
<heat> im ok
<gog> MCU is the overrated gastropub chain that's opened in every medium city and larger
<heat> went 2 gym, worked out abs
<heat> my knee's still fucked
<zid> 2 abs
<zid> both of them
<gog> *cough brewdog cough*
<gog> heat: nice
<gog> i did not go to the gym today as i have a nasty hangover
<heat> alcohol noooooooo
<heat> reject alcohol, embrace smoking heroin-laced marlboro reds from our new tobacco company
<gog> i can't dance unless i'm drunk sorry
<heat> i should try and cut down a bit
<heat> my muscles have a layer of fat over them so you can see volume but there's not much definition
<zid> I don't have any fat
<zid> but it just means I look like peter crouch
<heat> peter crouch is cool
<immibis> gog try a dark room with flashing lights and blaring techno, nobody's paying attention to you and you can make as much fool of yourself as you need to
<zid> I knew you'd appreciate a footballer reference
<heat> he's the lankiest man alive
xenos1984 has quit [Ping timeout: 240 seconds]
<zid> nah I've seen that teenage basketball player guy
<zid> robert bobroczkyi
<zid> there was some somali looking dude too
gog has quit [Quit: Konversation terminated!]
<heat> victor wembanyama is also super lanky
heat has quit [Quit: Client closed]
heat has joined #osdev
bslsk05_ has joined #osdev
xenos1984 has joined #osdev
<bl4ckb0ne> is CR4.PSE set by the uefi firmware?
<zid> why not.. check?
<bl4ckb0ne> i remember some place in the spec that tells what it does but cant find it back
<heat> yes
<bl4ckb0ne> thanks
<heat> PSE is required by long mode AFAIK
<bl4ckb0ne> that should be uefi x64
vai_ has joined #osdev
<heat>     and eax, 01111111111111111111111111111111b ; Clear the PG-bit, which is bit 31.
<heat> brilliant osdev wiki!
<mjg> paula wrote it
<vai_> Hi I have been looking on the Linux kernel to borrow code for my Operating system project JTMOS. But it appears to use all these complex marcoes. No direct access.
<vai_> Is it possible to decode Linux kernel marcoes somehow?
<mjg> ?
<vai_> Is it lots of headers?
<mjg> gcc -E
<heat> before you do that, keep in mind that you shouldn't do that
<heat> have you exhausted all other alternatives?
<heat> bl4ckb0ne btw it appears that PSE is ignored when PAE is enabled sooo doesn't matter
kerravon has quit [Quit: Client closed]
<bl4ckb0ne> just double checking
<ih8win8> It uses macros to simplify things for the programmer, and to abstract things for different architectures (for example, PCI uses port i/o on x86 but MMIO elsewhere).
<heat> PCI is Not That Simple
<heat> :)
<zid> Jungle is massive
gog has joined #osdev
heat has quit [Quit: Client closed]
<immibis> vai_: of course you can search in the header to see how the macro is defined
<immibis> ... make sure it's the right header
<zid> or just use gcc -E
gildasio has quit [Remote host closed the connection]
pieguy128 has quit [Ping timeout: 252 seconds]
heat has joined #osdev
merry_ has joined #osdev
patwid_ has joined #osdev
vismie_ has joined #osdev
yyp_ has joined #osdev
tom5760_ has joined #osdev
pounce_ has joined #osdev
whereiseveryone_ has joined #osdev
jleightcap_ has joined #osdev
exec64_ has joined #osdev
gjn_ has joined #osdev
yuiyukihira_ has joined #osdev
sm2n_ has joined #osdev
tomaw_ has joined #osdev
Bonstra_ has joined #osdev
mhall_ has joined #osdev
tomaw has quit [Killed (lead.libera.chat (Nickname regained by services))]
tomaw_ is now known as tomaw
nyah_ has joined #osdev
auronandace has joined #osdev
drakonis1 has joined #osdev
dzwdz1 has joined #osdev
goliath has quit [*.net *.split]
nyah has quit [*.net *.split]
mhall has quit [*.net *.split]
pounce has quit [*.net *.split]
Bonstra has quit [*.net *.split]
ThinkT510 has quit [*.net *.split]
drakonis has quit [*.net *.split]
merry has quit [*.net *.split]
jleightcap has quit [*.net *.split]
lh has quit [*.net *.split]
vismie has quit [*.net *.split]
whereiseveryone has quit [*.net *.split]
sm2n has quit [*.net *.split]
gjn has quit [*.net *.split]
rselim has quit [*.net *.split]
patwid has quit [*.net *.split]
yuiyukihira has quit [*.net *.split]
tom5760 has quit [*.net *.split]
yyp has quit [*.net *.split]
dzwdz has quit [*.net *.split]
exec64 has quit [*.net *.split]
mhall_ is now known as mhall
merry_ is now known as merry
vismie_ is now known as vismie
gjn_ is now known as gjn
patwid_ is now known as patwid
jleightcap_ is now known as jleightcap
yuiyukihira_ is now known as yuiyukihira
exec64_ is now known as exec64
sm2n_ is now known as sm2n
yyp_ is now known as yyp
tom5760_ is now known as tom5760
whereiseveryone_ is now known as whereiseveryone
pounce_ is now known as pounce
goliath has joined #osdev
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
kerravon has joined #osdev
Burgundy has joined #osdev
ih8win8 has quit [Changing host]
ih8win8 has joined #osdev
slidercrank has joined #osdev
kerravon has quit [Quit: Client closed]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
innegatives has joined #osdev
<innegatives> Am I right in thinking that your kernel doesn't have to be an UEFI app to be booted by UEFI system when you are using something like GRUB?
<zid> correct
<innegatives> So does Linux provide an UEFI app?
<zid> uefi could boot grub which could boot dos which could boot lilo which could boot linux 2
<CompanionCube> yes, it's called the EFISTUB
<zid> or whatever the hell you wanted
<innegatives> So you can have UEFI app that is booted by GRUB too, right?
<CompanionCube> yes
<innegatives> So then best way to osdev would be to create an UEFI app and get your memory map, etc. from UEFI and not bother with things like multiboot?
<geist> that's a way yes
<geist> probably much more complicated than multiboot though
<zid> I prefer to be compatible with LILO
<geist> multiboot is about sa simple as it comes and still gets you all those features
<innegatives> but doing UEFI app only would be more "universal", no?
pieguy128 has joined #osdev
<geist> universal how?
<geist> like on other architectures? not really
<zid> It also really doesn't matter, this code runs for about a couple of microseconds tops
<innegatives> like you wouldn't rely on there being multiboot in your bootloader
<zid> and does nothing very important
<CompanionCube> the way linux does is it has the UEFI app as a wrapper around the main kernel, i believe?
<geist> depends on the arch, but i'm assuming everyone is only thinking about x86-64 right now
<geist> in that case, i think linux basically just fakes out a PE header in it's head.S and so the kernel appears to be a UEFI app, i think
<geist> or maybe i confused that with one of the other arches
<geist> innegatives: the universal part is complicated. every arch has a completely different set of boot paths
<CompanionCube> i think it's that plus some code to collect the data the bootloader would normally pass in
<geist> usually simpler than x86-pc, because the PC has so many nonsense old mechanims
<geist> but they're not really the same between arches. the closest to a universal boot path is indeed UEFI, since it technically exists on x86, arm, riscv, and itanium
<geist> but only if the firmware on the latter 3 happen to be UEFI
<CompanionCube> ah, here's an old LWN article on the topic: https://lwn.net/Articles/632528/
<bslsk05_> ​lwn.net: The bootstrap process on EFI systems [LWN.net]
drakonis1 is now known as drakonis
<geist> so yeah, but you still have to write some boot strap asm for each arch *anyway* which is where a lot of that goes
<geist> so you dont really get an automatic multi-arch boot mechanism
<geist> but depends on precisely what innegatives is asking about here really
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<innegatives> no idea what im asking about, just want to create x86_64 os that is done right (tm)
<zid> It will take many years and you will gut and redesign major parts of it multiple times
<zid> the important part is to just write code
<zid> lots and lots and lots of code, very quickly
<zid> until you get stuck in, you won't know what your requirements are anywhere near as well, 'everyone has a plan until they get punched in the mouth'
<mjg> you know you are old when your knee jerk reaction to "i'm writing my own os" is "why even bother"
<mjg> that is to say i'm still young
<immibis> mjg: why even bother with anything? we're all going to die from climate in 15-20 years
<mjg> we can have some fun in the meantime
<innegatives> id like to think thats 50 years out
<mjg> :X
<GeDaMo> Optimists!
<innegatives> id would so much rather be having fun but since its not as readily available i have to resort perverted stuff like trying to write an OS to have fun
<geist> if you're just getting started, dont worry about booting it
<geist> just get it booted using whatever works best, multiboot
<geist> and then you have like infinity more stuff to worry about on the other side
<geist> then you can go back and clean up the booting method if you want, once you then have a handle on what you need, what is important, etc
<geist> the bootloader trap is a very common trap for newbies to fall into, dont worry about it, at the end of the day it's just some stupid detail
<geist> and though it's annoying and stupid, it doesn't really matter much in the long run
<mjg> is there an up for grabs kernel which has the bootstrap sorted out
<gog> hi
<mjg> so you can focus on implementing things like vfs or vm or networking or whatever
<geist> right. but even then just using something like multiboot is very straightforward
<gog> i have an up for grabs kernel that's bootstrapped and has a partailly complete vm
<innegatives> gog: link?
<geist> my point is dont worry about making the perfect bootloader or making sure you boot on all of the bootloaders, or doing the 'right' thing right now with regards to booting methods, it's not that important in the long run
<geist> and later on you'll find all of this stuff pretty trivial
<bslsk05_> ​adachristine/sophia - uefi bootloader and kernel for x64 (1 forks/15 stargazers)
<geist> but with that in mind you still have to boot, so we can give you some ideas there
<gog> feel free to totally plagairize anything
<innegatives> gog: thanks, thats amazing
<innegatives> geist: i feel like shit i read in OS books seems rather straightforward and fun comapred to this booting crap
<geist> indeed, which is why i suggest just getting past it as soon as possible
<gog> booting sucks
<geist> and dont worry about the details
<gog> never boot
<geist> it's just some stupid x86 PC detail. other arches tend to be simpler
<mjg> no shitting on x86 please
<mjg> widespread arch == has to be good
<gog> x86 is the best arch
<gog> x86_64
<mjg> best aarch64 is x86-64
<gog> yes
<geist> i'm not shitting on x86 at all
<geist> i'm shitting on PCs
<geist> a difference. the PC 'standard' is a huge mess of backwards compatibility, etc which causes all this bootloader nonsense
<mjg> no shitting on PCs please
<mjg> widrespread platform == has to be good
<kof123> "is there an up for grabs kernel"
<mjg> > awkward compatibility
* kof123 points at swinging corpses on the tree of portability/grail "The Uniform Driver Interface (UDI) allowed device drivers to be portable across both hardware platforms and operating systems without any changes to the driver" Jun 27, 2002 · The OSKit is a framework and ...
<geist> uh okay. well i'm trying to be serious here and help someone
<geist> but anyway, got a meeting
<zid> We're on PcDoThingEx as the standard now
<innegatives> any reason why portable drivers didnt take off?
<mjg> while i know very little about drivers, i know enough not note the above could not have possibly worked
<mjg> as a truy portable project
<mjg> to note*
<geist> no need, any serious OS already has their own driver layer
<gog> my OS is completely unserious :D
<innegatives> but then wouldnt it be great for device manufacturer to write driver once and expect it to work on all OSes
<geist> and i the long run only the serious ones get the attention
<zid> linux had a portable driver layer, ndiswrapper stuff
<zid> cus so many wifi drivers just didn't exist as linux versions
<geist> yes they would, but it's a bootstrapping problem. all of the OSes (read, windows) need to care about it
<zid> they resorted to running the windows ones
<geist> and they dont, so there's no reason for anyone to write a driver for it
<gog> what would be better is if manufacturers were less stingy with their spec sheets so people could write their own drivers
<geist> the linux ndis thing is just a wrapper for windows drivers
<mjg> ndis is *still* a thing?
<gog> and only network drivers
<gog> or did it work for any miniport driver?
<mjg> i deamdn a compat layer for DOS drivers
* gog interrupts mjg
* CompanionCube NMIs gog
<innegatives> is it possible to fry something on PC by messing with ACPI?
* gog triple faults
<gog> yes
<CompanionCube> innegatives: hopefully no, but maybe, rarely, yes, you never know?
<CompanionCube> witness that incident with samsung laptops and efi variables for a similar example?
<gog> you can do many things to wreck a computer by accident
<zid> You could accidentally flash your firmware with nonsense
<zid> or the firmware of a different device
<gog> that's a fun way
<zid> (e1000e did that once, oopsie)
<gog> oopsie
<zid> The kernel patching mechanism got a bit confused, overwrote the firmware on the e1000 chip
<zid> e1000 forever dead because it couldn't turn on well enough to accept new firmare
Vercas has quit [Remote host closed the connection]
<innegatives> gog: any reason why you chose the combo of clang/gas?
<gog> i don't use gas
<gog> i use at&t syntax but it's assembled by clang
Vercas has joined #osdev
<innegatives> why does one use clang instead of gcc?
<gog> which one
<gog> oh
<gog> in my case because clang can target efi application out of the box
<zid> clang vaguely easier if you wanna target PE
<gog> and i wanted to eliminate my dependnecy on GNU-EFI
<gog> mostly because i just don't like it i think it's a bad librarty
<innegatives> any reason why you get OVMF_CODE from /usr/share but expect OVMF_VARS at working dir?
<gog> because the firmware expects the variables to be writeable
<innegatives> oh
<clever> innegatives: OVMF_VARS contains the efi vars, on what disk and os to boot
<gog> and qemu will complain if it's not
<zid> nvram vs firmware
<gog> bbiab wife wants to hang out
pieguy128 has quit [Ping timeout: 246 seconds]
<ih8win8> If my USB 2.0 host controller is operating at high speed, and I have an attached device of unknown speed that I want to configure, should I be sending that device split transactions?
<ih8win8> Or do I somehow have to switch my host controler to full speed and do normal non-split control transfers?
<clever> ih8win8: i think when a usb device comes out of reset, it will hold D+ and D- in a certain pattern, like low,high or high,low, to indicate what speed it works at
<clever> and then you generally should start by reading the main device descriptor, but initially with a 64bit packet size (the low-speed max packet size)
<clever> 64 byte*
<ih8win8> I think low-speed max is 8.
<clever> with that partial descriptor, you can see the max-packet size, and can then read it again, and respect the devices max-packet-size
<clever> but hubs are where i get lost a bit, i think you need to switch the controller<->hub link into low-speed mode, and the hub basically just forwards that low-speed signal on
<clever> so a low-speed transaction wastes a lot of bandwidth, by tying the controller up for a long period of time
<clever> however, a hub with a transaction translator fixes that, you can blast a packet out at high-speed, into a buffer in the hub
<clever> then the hub can repeat it at low-speed on 1 port
<clever> while you high-speed a second port
<ih8win8> Well, in my case, the DWC2 controller is operating at high speed (bit 6 of GUSBCFG is set), but bits 17-18 of HPRT is 1, indicating a full speed device.
<ih8win8> I'm guessing I can just do a normal non-split control transfer to that device, and DWC2 would be able to do that at full speed?
<innegatives> i have not a single clue what the fuck is going on in gog's up for grabs kernel
<innegatives> how do you break into this?
<ih8win8> IIRC, split transactions require a hub in between the host and device, which there isn't one.
<clever> i havent read enough of the spec to know what a split transaction is
<clever> ih8win8: but i have ran into issues with dwc in device mode, if your max-packet-size is 64, and you want to sent a 129 byte reply, you have to configure it to send 3 packets, totalling 129 bytes
<clever> except, endpoint 0 only supports sending 1 packet at all times
<clever> so you have to manually configure it for 1x64, 1x64, and 1x1
bslsk05_ is now known as bslsk05
<ih8win8> huh, really
<clever> yep
<clever> some datasheets dont mention this, and left me stuck for days
<ih8win8> well, there is a maximum bit width of the transfer size (specified in GHWCFG3), so maybe you're exceeding that?
<ih8win8> oh, but that's always at least 11 bits wide, so I guess that's not the case.
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<clever> ih8win8: section 5.3.4.20
<clever> packet-count is a 1 bit field, for endpoint 0
<clever> for every other endpoint, its a 10 bit field
<ih8win8> 1 bit for the packet count. bruh.
<clever> yep, so the count can only be 0 or 1
<clever> so you need to manually figure out that your 129 byte reply is broken up as 64+64+1, then schedule each chunk in the completion irq
auronandace is now known as ThinkT510
<clever> ih8win8: oh, and usbmon on linux, wont show a partial reply
<clever> so if linux asks for 129 bytes, and you send a single 64 byte packet, usbmon just says nothing was received
<clever> basically impossible to debug without a usb analyzer
<clever> or just getting lucky, and discovering section 5.3.4.20
<ih8win8> It probably queues them up
<clever> in device mode, i dont think its capable of queueing multiple packets
<clever> you set a packet-count and byte-count, and then wait for it to fully transfer
<ih8win8> I meant that Linux is queueing them up.
<clever> i think its either linux, or the usb controller
<clever> the controller may not tell the host, until the entire 129 byte reply has come in
<ih8win8> There's also that RX FIFO thing.
<gog> innegatives: what don't you understand
<innegatives> gog: everything
<gog> ok
<gog> loader loads kc/boot, kc/boot loads kc/core
<innegatives> what is shim?
<gog> kc/boot is the shim
<clever> ih8win8: there are also 2 fun things ive yet to play with, dwc2 has an analyzer/sniffer mode, where it will decode packets and log them to ram, but never answer
<clever> ih8win8: so you can insert a dwc2 in the middle, between a host and device, and get a packet capture
<clever> and i suspect a dumber usb controller, like in the rpi pico, could log partial things that linux couldnt
<ih8win8> huh, not sure exactly what bit 2 of HCFG means and how it's different from bit 6 of GUSBCFG.
<ih8win8> There's a separate speed used for enumeration?
<gog> innegatives: whatever you want to do to it, start in kc/core
<gog> futzing with anything else might break it and make it impossible to debug
<innegatives> gog: is it normal for qemu to say graphics not initialized by guest or whatever when you run debug.sh?
<clever> ih8win8: that looks to be for forcing full-speed as the max, even when connected to a high-speed device
<gog> you need to start it
<gog> it starts paused
<innegatives> how do you start it?
<clever> innegatives: while GUSBCFG, is more about the interface between the dwc2, and the phy, the phy then generates the D+/D- signals
<gog> machine -> uncheck pause
<gog> or type "cont" in monitor
<innegatives> clever: i totally understood that
<clever> oops, that was for ih8win8
<clever> too many i* names in here
<clever> tab complete keeps filling in the wrong one
<innegatives> gog: thanks ill try
<gog> also whatever changes you make you're on your own. i will only support unchanged items just fyi
<gog> so we can preemptively prevent any misunderstandings
<innegatives> you mean you wont support me till my os takes over the world?
<clever> ih8win8: internally, i think the dwc2 is using an 8bit parallel bus, so 480mhz high-speed only needs 60mhz at 8bits
<ih8win8> ah, so it looks like I just do a normal control transfer without the split. If there was a hub in-between the host and a FS or LS device I'm communicating with, then I'd use the split transaction.
<clever> ih8win8: the PHY is then responsible for turning that 8bit 60mhz signal, into a 1bit 480mhz signal
<geist> yeah that's how usb 2 hubs tunnel usb 1 traffic
<gog> if your os takes over the world i'll be your servant
<geist> makes sense, because otherwise usb 1 traffic chews up ages of time
<gog> but let's wait until that's a realistic possibility before we worry about that
<mcrod> gog: may i pet you
<gog> yes
* mcrod pets gog
* gog prr
<ih8win8> You'd think you'd be able to just send the high speed transactions like normal and have the hubs handle splits entirely in hardware, but no
<geist> oh wait you're talking about the usb phy, not usb2 tunnelling
<heat> gog hi!
<heat> when are we taking over the world?
<geist> ih8win8: well, remember the dwc2 is about as dumb as it gets
<clever> geist: how does a split transaction fix that? is it sending it one byte at a time? or splitting based on how big a buffer in the hub is? and the hub then converts from HS to LS?
<geist> better host controllers deal with it
<geist> clever: yeah
<clever> ah, so its the transaction translator stuff ive heard of
<geist> it's basically a store and forward, where the usb 1 traffic (1.5 and 12mhz) is packaged up and trasnferred over usb 2 speed
<clever> but the hub cant buffer an entire packet, so you also have to split it based on the hub's buffer?
<gog> heat: tomorrow
<geist> that way the upstream channel from the hub is always at usb 2 speed
<gog> when i'm feeling a little less rough
<heat> ok gotcha
<geist> or at least assuming the usb 2 hub is upstreamed into another usb 2 hub (or root port)
<geist> if you plug in a usb 2 hub into a usb 1 port upstream then i think it just falls back to acting like usb 1
<geist> and of course usb 3 is a different beast altogether, but that's another day
<clever> and there would be no benefit, you cant burst a LS packet out at HS, if the host->hub is LS
<ih8win8> It seems like dwc2 can handle splits mostly in hardware, but you have to tell it the address and port of the hub that does the translation.
<geist> clever: i think it can buffer an entire usb 1 packet, since iirc usb 1 packets only go up to 64 bytes
<geist> it wasn't into usb 2 that they increased the packet size to 512
<clever> ahh
<geist> if the host<->hub is LS then there's probably no split, it's when the upstream of the hub is usb 2 and usb 2 all the way to the host
<clever> yeah
<ih8win8> From what I read, low-speed devices can only handle 8-byte packets, full speed can be 8 to 64, and high speed is minimum of 64.
<geist> since the usb 2 speed is like 40x faster, it chews up much less time to tunnel the LS/FS traffic through it and not suck up a lot fo time
<clever> but can you also do the time-hogging method, of just switching to LS mode along the entire path?
<geist> yah, when i say usb 1 i mean LS/FS
<geist> i think the idea here is ideally you have usb 2 hubs all the way out, so that the only LS/FS link is at the actual hub->device
<clever> yeah
<geist> but i guess if you plug in a usb 1 hub into a usb 2 hub then it'll be FS/LS from the usb 2 hub out
<geist> but then it's no real different
<ih8win8> yeah
<clever> but are you required to use split transactions, or can a host cheap out, and temporarily switch the whole path to LS mode and just accept the crap perf?
<geist> the usb2 hub knows that there's FS/LS stuff on this port so it just translates from there
<geist> not sure you can temporarily do it, but it could probably just tell the usb2 hub that it's FS/LS and basically pretend to be usb1
<geist> since that switches to the 1.5/12Mhz speed and uses the different physical packets
<clever> ah
<ih8win8> I imagine the host can switch entirely to LS. It needs to be able to handle a LS device plugged directly into it, and you can't do split transactions without a hub in between.
<heat> i sleep for a few hours and #osdev becomes gobledy-gook
<heat> USB is not real sheeple
<geist> note that LS/FS can run at the same time. you just switch to 1.5Mhz for the LS transaction
<gog> we're actually talking about os dev for once stop ruining it
<clever> i still need to learn how exactly a usb hub works
<geist> i forget precisely how that works, but it's not like usb2/1
<heat> gog send me a PR!
<heat> now!
<clever> i know a decent amount about the overall protocol, and how the signaling looks on a single link
<geist> but LS is basically 8x slower than FS, so its some sort of physical level thing
<gog> no
<clever> but not how hubs split a port up
eddof13 has joined #osdev
<geist> 1.5 vs 12
<heat> gog what part of this wasn't convincing?
<geist> note that only things that ever really used LS were early keyboards and mice and whatnot
<ih8win8> OS Dev is one of the nerdiest topics known to man. Of course, it will sound like gobledy-gook.
<clever> yeah, i can see the advantage of using FS or HS on even a keyb/mouse, far less harm to the host performance
<gog> heat: you didn't say please and you didn't bring me an ice cream
<ih8win8> Don't modern mice and keyboards still use LS for power efficiency?
<heat> please here's ice cream: 🍨
<gog> my boss gave me some ice cream mochi the other day, did you?
<gog> too late bruh
<innegatives> gog: pls make a tutorial about this crap you have in the repo, ill be forever grateful
<gog> a tutorial about what
<innegatives> about it all
<innegatives> what the hell these things do
<gog> you said a kernel up for grabs
<gog> you didn't say anything about documentation or tutorials
<heat> hola gog yo tiengo un helado para tí
<geist> innegatives: you need to get past tutorials
<geist> they are a crutch, you have to really get in there and start trying to learn this stuff or you wont make much progress
<innegatives> geist: how?
<gog> heat: gracias
<clever> geist: my mouse is bcdUSB=2.00 and bMaxPacketSize0=64, keyboard is also 2.00 but bMaxPacketSize0=8, that doesnt feel like HS?, hmmmm
<geist> it doesn't really get any easier
<ih8win8> Finally got a SETUP packet to send with an ACK response, but I'm getting a "data toggle error" when sending the DATA0 packet next. gotta see what that's about.
<clever> ah wait, `lsusb -t` gives far better feedback
<geist> you have to toggle the toggle bit for every transaction
<geist> that's just part of it, kinda a silly parity check
<heat> sidenote: this IRC client highlights every nick and man the results are hilarious
<heat> hmmmm!
<geist> er not every transaction, every DATA packet
<ih8win8> I don't think bcdUSB has anything to do with speed. You can have USB 3.0 devices that are LS.
<geist> DATA0/DATA1
<heat> why is USB in hungarian notation?
<heat> microsoft?
<gog> when i say "support" i mean i'll fix any bugs you find up the call stack of anything you change
<gog> if you can't fix them yourself
<geist> dunno, it came from an era when hungarian was much more prevalent, mid 90s
<ih8win8> Microsoft was one of the companies involved in creating USB.
zxrom_ has joined #osdev
<geist> so probably just yeah
<heat> microshit winblowz back at it again
<ih8win8> hmm... according to these docs, the DWC2 should be able to toggle DATA0/DATA1 automatically when multiple data packets are sent.
<clever> yeah, reading `lsusb -t` says my mouse is 12mhz, keyboard is also 12mhz
<heat> __usbver would be a much better name
<geist> ih8win8: maybe there's a enable bit there?
<clever> so they are both operating at FS
zxrom has quit [Ping timeout: 252 seconds]
<clever> oh, but my keyboard includes a usb hub, is it FS or HS...
<clever> [Thu Jul 13 18:17:47 2023] usb 1-11.1.2: new full-speed USB device number 48 using xhci_hcd
<clever> [Thu Jul 13 18:17:47 2023] usb 1-11.1.2: not running at top speed; connect to a high speed hub
<clever> aha, yep, its a FS only hub!
<ih8win8> Is that keyboard from the 90s?
<clever> ih8win8: a sun type-7
<geist> yay even has the empty button
<geist> or is that only on type-6s
SGautam has joined #osdev
<geist> i have a usb type 6 that i occasionally get out, but its actually a terrible keyboard
<clever> https://deskthority.net/wiki/Sun_Type_7 doesnt mention when it was made
<bslsk05> ​deskthority.net: Sun Type 7 - Deskthority wiki
<geist> so i usually get tired of it
<clever> ive been using type-7's for over a decade
<bslsk05> ​'Contributing to Open Source Can Change Your Life - Here’s How to Do It' by Ask Cloud Architech (00:03:17)
<heat> are you convinced now?
<clever> but after a while, the rubber dome on the wasd gets mushy
<heat> it will change your life (for the worse)
<ih8win8> Some USB devices like headsets have an internal hub with devices (headphones and mic) permanently attached. I've noticed that.
<gog> heat: i'm le tired
<geist> ih8win8: note that usb audio on a dwc2 is a real nightmare
<geist> isochronous transfers
<clever> ih8win8: ah, found an oracle manual for the type-7, with a 2005 date on it
<ih8win8> Oh, with how much CPU involvement this thing requires to drive, I imagine it sucks.
<geist> i got my type 6 back in about 2000, came with a sun blade 100 that i bought
innegatives has quit [Quit: WeeChat 4.0.1]
<geist> kinda feel bad about coming down on innegatives, but they're really going about it the wrong way
<geist> dunno the right level of tough love to apply right now
<clever> a number of the hospital systems my dad worked on where sun and sparc based, and we wound up with a lot of spare type-7's
<heat> i don't really care, he's been vampiring for like a year
<clever> on one, the capslock led was noticably burnt, because the hospital leaves it on 24/7
<heat> going from project to project without much understanding
<geist> heat: yeah i guess thats true. i hane't paied much attention to how long they've been at it
<heat> he's jafarlihi
<geist> clever: unless they're different than the type 6 usbs, my main complaint is it's the mushiest of cap dome keyboards i've ever typed on
<geist> and it's really not a great experience
<heat> C compiler -> 8086 emulator -> now an OS?
<heat> all in less than a year
<clever> geist: after many years of use, ive noticed the wasd are more mushy then the other keys, the domes seem to wear out
<geist> ah didn't know that
<gog> "make a tutorial" nearly made me lose my composure for a moment
<clever> ih8win8: oh, and speaking of weird usb devices, i had an old usb 3g tethering stick, when you plug it in, it claims to be a usb cdrom drive, with autorun.inf and the windows drivers
<clever> ih8win8: if you try to eject the cdrom, it reconnects at the usb layer, and then claims to be 4 usb serial ports
<ih8win8> lmao
<heat> i assume this is some sort of "lets make a nice resume with big projects so i get hired by le big tech" thing
<clever> you can then use standard wvdial to #777, like its a dialup modem
<clever> and boom, internet!
<geist> gog: heh yeah i could sense you seething there
<clever> ih8win8: i wrote a udev rule, to detect that "cdrom" drive, and eject it immediately
<clever> so it always turns into a serial port
<gog> have they posted any code before
<gog> like do they understand programming
<ih8win8> I have an old memorex flash drive that does something similar. It shows up as a hub with two mass storage devices attached. One of them is the actual flash drive, and the other is a virtual CD-ROM with autorun.inf that loads this launcher program.
<heat> yes but it usually looks cargo culted from various places
<clever> ih8win8: one of my old mp3 players showed up as MSD, and if you hold a button on the player, it silently swaps between internal and external storage
<gog> hm i see
danilogondolfo has quit [Remote host closed the connection]
<heat> oh i think they had a bootloader or kernel i shot down to bits as they said "i didn't copy this" and i said "yes you did, i know this code"
<clever> pray your OS hasnt cached the wrong blocks :P
<ih8win8> nowadays, we have MTP to do that.
<ih8win8> unfortuately, Linux isn't great at handling MTP
<clever> android was a bigger driving force behind MTP i think
<clever> because it would be a pain to umount the fat32 on the android, to expose it to the host
<clever> and android is moving towards fake fat, where its just a dir on ext4
<heat> what?
<heat> how?
<ih8win8> It was so that the phone and the host can access the same storage without any concurrency issues.
<geist> yep, some of the embedded roms on some of the cortex-m class things do the faked out FAT device
<geist> i think the RPI pico does it too
<geist> it's a terrible and awesome hack
<clever> heat: some namespace or --bind flags or something, to restrict what unix features you can use, and then you dont have to allocate an entire partition to user storage, its just a normal dir
<ih8win8> What happens if you delete a file on the phone while the computer is accessing it?
<hmmmm> FAT for better or worse has become the de facto "protocol" for filesystems
<geist> there's also this upload format that you can shoot at MSD devices that basically encapsulates the framing so that the device knows how to interpret it without any ambiguity
<heat> that's not FAT though?
<geist> i forget what it's called, but basically it has a frame around each block that says what the sequence number is
<clever> geist: the pico doing fake fat is even more of a hack, the entire disk is read-only, and it just looks for a magic# in every 512 byte block you attempt to write
<hmmmm> erm, s/protocol/baseline
<geist> clever: right, that's what i'm talking about
<clever> its more of a hack, to trick the host into letting non-root users write a stream of commands
<geist> right
<ih8win8> mostly because just about every singe OS understands FAT and USB mass storage.
<heat> hmmmm: i'd say most filesystems borrow more for UNIX v7, etc than FAT
<clever> very different from what android needs, where it has to be a proper FS
<geist> like doesn't matter how about the host FAT driver allocates blocks, because at the end of the day it's just a series of block aligned writes, and the header within each block is all that matters
<hmmmm> sure but there's no UNIX equivalent to FAT
<clever> geist: yep
<geist> hmmmm: tar is about as close as you get
<heat> sure there is, v7, and then UFS
<hmmmm> FAT is a lingua franca of filesystems, everybody knows how to speak it
<gog> what about cpio
<clever> in the case of the pico, each 512 byte packet contains 256 bytes of data, a checksum, and a block#
<hmmmm> true, but nobody uses tar in that manner
<heat> everybody knows how to speak it, most do not speak it well
<ih8win8> FAT doesn't support the read write execute permissions needed for Unix.
<clever> so the .uf2 doubles in size, vs a .bin
<ih8win8> The only thing it has is a write protect bit on files.
<clever> ih8win8: and the hidden/archive flags, but almost nothing uses archive, lol
<geist> anyway the .uf2 thing is at least a lot better than earlier attempts at MSD-flashing i've seen on like NXP firmware
<hmmmm> certainly not as an interface to files from some embedded device
<geist> where that just assume that you were using windows and that it would allocate FAT blocks starting from sector X and sequentially write them
<clever> eww!
<geist> you can short circuit it by just doing a dd with a seek=
<ih8win8> I suppose you could treat hidden as non-readable and archive as the execute bit, as a hack.
<clever> uf2 also works with dd/cat, you can just `cat foo.uf2 > /dev/sda` and it works
<clever> but pray sda is the pico :P
<clever> get that wrong, and have fun doing data rescue!
awita has quit [Remote host closed the connection]
<ih8win8> I imagine MTP would be much easier to handle than FAT. With FAT, you have to deal with both low-level filesystem manipulation and the mass storage protocol.
<ih8win8> And FAT requires mounting, which needs root on Unix.
<clever> ive also discovered, the old MSD protocol, uses 32bit block#'s
andydude has quit [Quit: Leaving.]
<clever> which means 512 byte sectors, limit you to 2tb total
<clever> a new variant, includes another set of commands, with (i think) 64bit block#'s to fix that
<ih8win8> And apparently, USB mass storage is based on SCSI, which is interesting.
<clever> i discovered this, because the MSD gadget in my version of linux, was limited to 32bit numbers
heat has quit [Quit: Client closed]
<ih8win8> What's MSD?
<clever> and my 20PB disk image broke things :P
<clever> mass-storage device, the usb disk interface
<clever> which yes, is scsi based
heat has joined #osdev
* gog beeps'
* zid boops
<heat> robot
<heat> do not come in
<heat> i have a robots.txt
<zid> THE UPRISING IS HEEEEAR
<ih8win8> And then there's iSCSI which is sometimes used for network filesystems (also using SCSI commands)
<zid> I MADE A SPELLING MISTAKE LIKE A HUEMAN, PLEASE LET ME IN
<clever> ih8win8: i was using that at the same time, heh
<bslsk05> ​'Anon Works IT - FULL VERSION | 4chan Greentext Animations' by Greentext Animations (00:27:28)
<heat> ih8win8: scsi is actually pretty widespread, even ATA has SCSI for ATAPI
<geist> iscsi is more for mounting a remote disk device over the net
<clever> ih8win8: i created a 20PB disk image in zfs on my nas, then used iscsi to share that to my rpi-zero, then the MSD gadget to share it over usb
<geist> UFS is a new flash interface that uses scsi too
<clever> ih8win8: so when i plug the pi-zero into a computer, it would register at a 20PB hdd, lol
<geist> kinda ike SATA in that it's a high speed serial link with some block transfers over it
<ih8win8> 20 PB???
<clever> somebody on the rpi forums asked what the largest usb disk you can boot from is
<clever> so i punched in a stupidly big number, to test :P
<zid> I assume that's just all the 1s in whatever field somwhere?
<geist> a big use of something like iscsi is booting an os without a disk and using network block device, or a virtual machine with the storage somewhere else
<clever> if it can boot from a 20 PB disk, then good luck finding something bigger to break things :P
<ih8win8> Wait till 2050
<heat> fun fact: the UNIX v7 filesystem used 3 bytes per block
<geist> question there is why 20PB
<geist> what's the limit there
<clever> zid: due to the bug i discovered, it was truncated to 32bits, which was a length of 0, lol
<clever> geist: it was just a random stupidly big number i picked
<geist> that's like approximately 54 bits of offset
<geist> ah
<geist> since 50 bits is 1 PiB
<clever> if i can boot from a 20 PB disk, then any disk you can find will work
<clever> good luck finding something bigger :P
<zid> 50 bits is 1 pib.. that should have been obvious I feel, given 2^10 is 1024
<sham1> zettabyte drives when
<zid> and that a YB is 60 bits then
<geist> iirc scsi has a command set that can go up to a full 64bit. it has a bunch of smaller read/write commands with various amounts of offset/length, but you choose whatever one covers what you're doing (to save on transfer bandwidth of unnecessary zeros)
<ih8win8> I wonder what the largest capacity hard disk in the world is today.
<zid> yea the problem isn't the max it's the min somewhere else, like the filesystem
<geist> i think they're getting up past 20GB nowadays, with some stuff up to 30 announced
<zid> which happened for fat regularly
<zid> "We extended the max filesystem size" "Great, now can I make files bigger than 2GB? no"
<ih8win8> I had a 20 GB hard drive in 2001.
<geist> er TB
<ih8win8> oh
<sham1> Getting past 20 GiB? Craziness! Next you'll tell that people will use more than 4 GiB of RAM
<geist> 4GB is stupid!
<clever> geist: yep, and the bug, is that i was on an older linux kernel, that only had 32bit support, it was already fixed upstream
<sham1> 512 MiB ought to be enough for anybody
<zid> To be fair, I'd survive with 4GB of ram just fine if everybody else also had 4GB of ram
<geist> i saw some hackernews or whatnot article the other day that was like 'OMG someone booted windows in only 176MB of ram!'
<zid> the problem is you rich bastards with 64GB
<ih8win8> 4 GB is still usable today.
<geist> i was like facepalm
<sham1> I am become Billiard Gates, the destroyer of worlds
<bslsk05> ​github.com: linux/drivers/usb/gadget/function/f_mass_storage.c at master · torvalds/linux · GitHub
<clever> i think it was somewhere in this region
<zid> Like, none of my modern computing *needs* more than 4GB of ram
<zid> it just adds a bit of cache speed
<sham1> The laptop in front of me has 2 GiB of RAM
<zid> steam only uses a gig of ram because GAMERS all have 32
<geist> i mean i do b ut only in that there are certain apps that i run that actually use more than it
<clever> zid: chrome says otherwise, lol
<sham1> It's also a 32-bit machine, but oh wells
<geist> but indeed, if i'm willing to let things just swap, 4GB is fine
<zid> clever: My point exactly?
<clever> i have 64gig of ram, and the OOM killer still eats chrome
<zid> You're using it wrong
<zid> Tabs are not bookmarks
<geist> lies!
<clever> my 11575 open tabs agree with you
<sham1> I think you'll find...
<ih8win8> 32-bit OSes can use more than 4 GB of RAM with PAE. It's just that no single process can use more than 4 GB.
tomith has quit [Quit: tomith]
<sham1> MFW can't even get to 4 GiB of RAM period
<sham1> Thus is the fate of late noughts netbooks
<zid> Like the only difference between my computer and my computer with 4GB of ram is that I'd have to stop running multiple things and leaving them open all the time so often
<geist> yeah i even have one of those dell mini 9s which were all the rage for like a minute
<zid> steam would have to get opened when I needed steam, and not left running, or left to swap
<ih8win8> I'm on a 4 GB machine, and it's fine with Firefox.
<geist> dumbest purchase ever
<sham1> Asus EEEPC
xenos1984 has quit [Read error: Connection reset by peer]
<geist> i think apple came out with the macbook air pretty soon afterwards and made the whole thing irrelevant
<ih8win8> Once I get up to 10 tabs, I start closing stuff.
<sham1> I even bought a new battery for this a couple of years back just to make it actually useful
<sham1> Pretty good going for a machine that's over 10 years old
<sham1> And really has no reason to be used
<sham1> I just like it because it's so smol
<ih8win8> I have an Asus EEEPC. Used it through college, but then 1 GB of memory became too little for Chrome to handle, so I stopped using it.
<clever> sham1: 2 things forced me to retire my eeepc, the charge cable is frayed to death and it cant even charge, and the internal ssd is only 4gig!
<clever> i can barely fit an OS on that thing
<sham1> oof
<ih8win8> Mine has a 200 GB hard drive.
<clever> mines an eeepc 701
<sham1> This unit has been upgraded to a 120 GB SSD. It's a cute little machine even if a bit slow when doing... anything
<clever> and the ssd cant be upgraded, its a heap of raw flash, soldered to the motherboard!
heat has quit [Quit: Client closed]
<sham1> Asus EEEPC 1101HA
<ih8win8> Mine was a eeepc 1000HD. It was sold with a 900 MHz Dothan Celeron CPU... in 2008.
<sham1> An Intel Atom 2520 @ 1.33 GHz. Now that's a vintage CPU if I've ever seen opne
<ih8win8> Dothan was introduced in 2004, so it was very weak for its time.
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sham1> Err, Intel Atom Z520
<sham1> Darn ambiguous font
heat has joined #osdev
<ih8win8> soldered on SSDs are a war crime
<sham1> Yes
<zid> a soldered on ssd is just called NAND flash
<gog> nand
<sham1> All of 1 core although it's running on 1.1 volts, which is pretty neat
<geist> the main problem i had with my dell mini 9 was the keyboard is so small it's impossible to use
foudfou has quit [Remote host closed the connection]
<geist> but the nice thing is it has a serial port on it, iirc so it's good for hauling around and having a lightweight terminal
<geist> or maybe not serial, but easy to use as a usb dongle thing
<clever> zid: i dont remember it needing special drivers, i have a feeling it could have been a nand<->sata controller in the middle
foudfou has joined #osdev
<zid> As in, my Wii doesn't have an 'ssd'
<zid> it just has nand flash
<sham1> A nice small machine for some recreational C hacking and not much else
<zid> because it's soldered down, if it were removeable then it'd be an ssd
<sham1> 32 bits hurt though because the amount of OSes to run on it dwindles by the day
<clever> the SoC in the rpi is also capable of talking to raw nand flash, allof the required pins are on the gpio header
<clever> so, if i plug a board with raw nand flash into the rpi, its removable, is that nand flash or an ssd?
<ih8win8> I'm surprised a Raspberry Pi 3 can't fully operate on regular 100 mA micro-USB power supply, when my phone can do it just fine.
<clever> ih8win8: because the phone has a battery to make up for bursts in demand
<ih8win8> But it can charge while being used, so the cable is providing more energy than the phone is using.
<clever> sounds like some of those numbers are wrong
<ih8win8> Those old laptops could be repurposed as set-top boxes or thin clients.
<clever> yeah, thats what i would be using my eeepc for
<clever> if i want to do something more then my phone can handle, but dont want to whip out a 20" laptop
<nortti> I'm pretty sure any kind of modern phone is able to beat an eeepc 701
<clever> nortti: my phone can barely run the youtube app, it keeps running out of heap space within the process
<nortti> damn okay, what phone is that?
<clever> samsung S5 neo
<clever> 2gig of ram
<clever> but i think the bigger problem, is how much the dalvik VM limits the heap to
<clever> and youtube isnt allowed to use that full 2gig
<clever> so it goes into a death spiral, running GC constantly, and unable to free up enough heap to function
<ih8win8> hmm I'm confused. If I want to do a GET_DESCRIPTOR request, I'd send a SETUP packet (with the SETUP PID), then receive a DATA0 packet from the device, then send an empty DATA0 packet to the device?
<sham1> Hmm. An EEE PC as a thin client for a phone to give it a desktop mode with a touchpad and keyboard
<sham1> Now that's an idea
<ih8win8> I wonder who had the bright idea of using Java on phones with limited resources.
xenos1984 has joined #osdev
<nortti> huh, got up to android 7
<clever> sham1: i was thinking more along the lines of just ssh into a proper machine, with the phone only providing a 3g uplink
<sham1> Remember that Java was originally designed for embedded devices
<clever> and the eeepc has a proper keyboard and bigger display
<nortti> my old honor 7 only got as far as android 6
<nortti> anyways, an eeepc 701 (at least mine) has only 512MiB of RAM and a chunk of that goes to the integrated graphics
<sham1> clever: sure, but a phone would be funnier
TkTech has quit [Ping timeout: 252 seconds]
<sham1> ih8win8: at least you don't need to deal with whatever this is: https://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition
<sham1> Android Java at least is proper* Java
<ih8win8> I've done funny things like that in the past. I've pulled out my old Windows 98 machine, installed PuTTY and Xming on it, and ran GUI apps.
<sham1> *: well, sorta. It's not fully Java SE IIRC and it's often way behind. Oracle Vs Google also doesn't help matters
TkTech has joined #osdev
<ih8win8> It's the proper Java language, but not the proper Java runtime.
<clever> also, android isnt entirely running java
<clever> at build-time, you transpile the java bytecode into dalvik bytecode
<clever> and then android runs a pre-linker at install time, to resolve all symbols, so launching an app is quick
<clever> and modern android runs the dalvik thru LLVM, to convert it directly into native assembly
<sham1> Yeah. You're not running a JVM as suxh
<clever> old android was running a dalvik VM
<clever> but modern is just native, due to LLVM doing magic
nortti has quit [Quit: Reconnecting]
nortti_ has joined #osdev
andydude has joined #osdev
<ih8win8> I wonder why launching apps on Windows Phone was so slow in comparison and required those splash screens. Windows Phone apps are mostly native C++, so there's no VM startup lag.
nortti_ is now known as nortti
<sham1> I would imagine Windows Phones also using .NET, but that by itself wouldn't explain the slowness
<nortti> aiui windows phone pre-8.1 used silverlight for its apps
<ih8win8> hmm
<sham1> Eww
<nortti> 8.1 and 10 especially were native code
<sham1> Silverlight. I didn't need to be reminded of that thing
<ih8win8> I know Windows Phone 8.1 was mostly the WinRT API, which is C++ COM.
<clever> i also forgot silverlight was even a thing!
<clever> i think i needed it for netflix at one point??
<nortti> oh yeah, iirc microsoft was pushing it as a better DRM enabled thing
<nortti> compared to flash, that is
<sortie> I vaguely remember refusing to install that
<ih8win8> Flash didn't have any DRM at the time, for sure.
eddof13 has joined #osdev
<nortti> there was also one browser game where you wrote short programs to control a robot called robozzle. I liked the concept but as I was running linux at the time, I could not use it due to silverlight being windows (and maybe mac?) only
* CompanionCube should maybe see how badly youtube thrashes on the tablet with 1.5G of ram
<CompanionCube> *youtube app
<nortti> another plugin that got some usage but was not available on linux was shockwave. I think habbo hotel used it at least
<ih8win8> I never remember needing Silverlight for anything.
* ih8win8 remembers when you could watch YouTube on a Wii with 64 MB of RAM.
xvmt has quit [Ping timeout: 240 seconds]
<clever> that reminds me, i was using a dell BMC/IPMI thing a few years ago
<clever> the bloody thing used activex!
<zid> I mean, you still can, you just have to ignore a *fuck* lot of javascript to do it
<zid> and use effectively youtube-dl and not opera
<clever> the remote key/mouse/monitor interface, only worked on win7
<ih8win8> Yeah, most of the overhead is the browser, not the video playback.
<clever> the remote cdrom interface (insert a .iso into a virtual cd drive) only worked on winxp
<zid> my wii probably still has mplayer installed
<clever> i had to run 2 VM's at once, and stream an install iso half way around the globe, lol
<clever> just to install an OS
<nortti> < ih8win8> Yeah, most of the overhead is the browser, not the video playback. ← I do think there's been changes to how the videos are encoded though. my ibook g3 (500MHz PPC750CX, 640MiB RAM) started struggling to stream the 360p h.254 encodes about a year and half ago on new uploads, old uploads still work fine
<ih8win8> Wait, do USB IN transactions start with DATA1 instead of DATA0?
andydude has quit [Quit: Leaving.]
mhall has quit [Quit: Connection closed for inactivity]
xvmt has joined #osdev
innegatives has joined #osdev
Turn_Left has quit [Read error: Connection reset by peer]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[itchyjunk] has joined #osdev
duderonomy has joined #osdev
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yoofie has joined #osdev
Burgundy has quit [Ping timeout: 246 seconds]
<geist> really you should be looking at the usb spec
<geist> it might follow that the toggle remembers from the last transaction
<geist> i forget if it starts over on every one
<clever> yeah, i grabbed a copy of the usb2 spec, and have been looking over it
<clever> found some weird details, like FS having a max packet size of 1023, and HS 1024
<geist> yeah there is this whole thing about zero length transfers and whatnot, determining the end of a transaction
<geist> a lot of protocols use that
<geist> ie, if a packet is < max size (which is a power of 2) then it's the end of a transaction, or if the overall transcation is a multiple of a packet size, appened a 0 length packet
<geist> *or* the transaction is implicitly N bytes long
<heat> i kind of want to write an xfs driver but damn it looks complex af
<clever> ah yes, thats how you terminate a transfer
<geist> and if you notice the MSD header packet is always some non mulitple, like 13 bytes long
<clever> so with a max packet size of 8, a 16 byte packet would be send at 8+8+0
<clever> but a 15 byte packet is just 8+7 ?
<geist> so you can determine the difference between the header and the payload
<geist> so a sector read would be like 13 + 512 (where the 512 is subdivided according to max packet size)
<bslsk05> ​github.com: Raspberry Pi 4 : USB3 SSD Connected via USB3 Hub : BOOT Files Corrupted Following Reboot · Issue #4844 · raspberrypi/linux · GitHub
<clever> and the vl805 usb controller, has a hardware bug
<clever> in certain situations, writing 512 byte blocks will corrupt the fifo, and trash your files
<heat> is it just me or USB is stupid complex?
<geist> a fun one i remember dealing with on an older qualcomm soc when i was writing some usb device controller driver for a bootloader
<heat> at least from the host's side, compared to other protocols
<geist> if you transferred data too fast you'd overrun the bus and itd start sending garbage
<geist> heat: yes and no. it's definitely highly asymmetric, so that devices can be dumb (or at least that was the original idea)
<geist> but then modern host controllers handle almost all of this details for you
<geist> you queue up fairly high level transactions and it does all the scheduling and whatnot for you
<geist> but yeah it's pretty darn complex
<clever> yeah, xhci looks far simpler, compared to the mess that is dwc
<geist> it's far simpler and way more complicated because it has a lot more state to set up
<geist> like half your stack is in the controller, but thats probably a good kinda complex
<geist> sort of like ne2000 vs intel ethernet
<geist> probably a better analogy would be like ISA IDE vs nvme
<geist> (dwc2 vs xhci)
<clever> i feel like the old IDE, was more of just an extension of the ISA bus
<geist> which is exactly what it was
<clever> if you write to a certain IO port, some buffer gates just tie the ide ribbon directly to the isa bus
<geist> right, and then there was this whole stupid protocol on top of that
<geist> which got extended like 14 times so there are all these layers of IDENTIFY, etc
<clever> they basically just moved the controller from an isa card, to the hdd itself
<clever> and kept the same protocol?
<geist> the protocol was what they happened to be implementing at the time
<geist> then it became the standard
<clever> and the new "ide controller" was just a buffer gate, so the ribbon wasnt an rf broadcaster for every single byte on the isa bus
<clever> yeah
<geist> i think it only later got named ATA when it got standardized
<clever> but the newer ide, with dma and junk, how does that change things?
wblue has joined #osdev
<geist> i never fully grokked it, but the later pci ones (pre SATA/AHCI) added more and more assist to it
<clever> i also saw an example of making an AVR programmer, using the IDE bus
<geist> later ISA DMA let you hook up your dma controller to transfer data instead of polling it out of the port
<clever> and force loading the parallel port driver, but pointing it to the ide IO port
<geist> later PCI controllers then had their own incompatible ways of offloading some of the transaction logic
<clever> so avrdude thinks your bit-banging on an LPT port
<geist> all the way up to AHCI which offloads a fair amount of the identify/transaction/error handing and definitely queuing
<clever> but the parallel port driver is mis-configured, and writing to the ide port
<clever> and the ide ribbon just happens to work the same as the LPT port, enough to let you bit-bang the avr
<geist> at the end of the day AHCI is still just speakding ATA, but kinda like how XHCI smoothes over a bunch of USB details, under the hood it's still the older protocol
<clever> yeah
<geist> and then you still have to deal with protocol details for error codes and IDENTIFY and whatnot
<clever> and isnt both sata and MSD, scsi behind the scenes?
<clever> or wait, i'm thinking of sas?
<geist> right, that's sas
<heat> sas is scsi over sata
<geist> SATA is just ATA over the sata physical link
<heat> sata is ATA, ATAPI is SCSI over ATA too
<geist> yeah
<heat> i think there's a standard that maps SCSI commands to ATA commands too
<geist> why SATA didn't just go full on SAS is presumably just because at the time hard drive mfgs didn't want to deal with it
<heat> linux shares a bunch of logic between SATA and SCSI, hence /dev/*sd*
<heat> their "libata" thing just emulates SCSI commands
gog has quit [Ping timeout: 245 seconds]
<clever> ah,thats what was tripping me up
<geist> yah that is a software level thing. it wasn't alwasys like that. used to be /dev/hd*
<clever> geist: and possibly, it let you put a sata->ide converter on your hdd
<geist> and still is if you have some ancient IDE controller
<clever> and upgrade your drives to sata
<clever> and you could put off having native sata until later
<clever> rather then investing R&D into a new sata controller, you can just bodge an adapter onto the hdd
<clever> until you know that sata is taking off
<clever> i also had a rather fun bug in linux at one time, the same hdd showed up as BOTH sda and hda, at once!!
<clever> and because i had swap priority setup (multiple swap devices), hda2 and sda2 both got priority 0