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
Turn_Left has joined #osdev
Left_Turn has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
Turn_Left has quit [Ping timeout: 246 seconds]
netbsduser` has quit [Ping timeout: 272 seconds]
spareproject has quit [Remote host closed the connection]
edr has quit [Quit: Leaving]
bencevans has quit [Ping timeout: 272 seconds]
bencevans has joined #osdev
vdamewood has quit [Quit: Life beckons]
vdamewood has joined #osdev
mavhq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
mavhq has joined #osdev
gog has quit [Ping timeout: 252 seconds]
Arthuria has quit [Ping timeout: 245 seconds]
Matt|home has quit [Quit: Client closed]
coolcoder613 has joined #osdev
X-Scale has joined #osdev
<coolcoder613> I'm using what you might call the easy route with my OS (I'm mostly using libraries written by other people, for example for ATA, for my allocator, to run wasm...) my OS is written in Rust, and I'm currently having a lot of trouble FAT working on top of my the ATA driver.
<coolcoder613> The ATA library want something with Read, Write, and Seek implemented, and I've done that, the problem in I don't know how to implement IOBase, which Read, Write and Seek depend on.
<Mutabah> wait, why does the ATA library want a file interface?
<Mutabah> Or does it _expose a file-like interface?
<Ermine> Idk what IOBase means in the context of the library you're using
<Mutabah> what library are you using?
<Ermine> so you should refer to the library docs and code
<Ermine> also, imo it's not "easy route", it's "taking shortcuts which will bring much more trouble long term"
<bslsk05> ​crates.io <no title>
<coolcoder613> It's the FAT library that wants a file interface
<bslsk05> ​github.com: simple-fatfs/src/io.rs at main · Oakchris1955/simple-fatfs · GitHub
<the_oz> Maybe?
<coolcoder613> I want to use the things from core2::io instead of from here...
Arthuria has joined #osdev
<coolcoder613> I was using this before, but I couldn't get it to work (same isssue) https://github.com/rafalh/rust-fatfs
<the_oz> well, here's THEIR implementation:
<bslsk05> ​rafalh/rust-fatfs - A FAT filesystem library implemented in Rust. (53 forks/289 stargazers/MIT)
<bslsk05> ​github.com: core2/src/io/traits.rs at main · technocreatives/core2 · GitHub
<the_oz> so munge them together somehow. I don't do Rust but
eluks has quit [Remote host closed the connection]
eluks has joined #osdev
xenos1984 has quit [Quit: Leaving.]
Arthuria has quit [Ping timeout: 248 seconds]
X-Scale has quit [Quit: Client closed]
GeDaMo has joined #osdev
dinkelhacker_ has joined #osdev
marcopolo2 has joined #osdev
nur has quit [Ping timeout: 248 seconds]
pabs3 has quit [Quit: Don't rest until all the world is paved in moss and greenery.]
pabs3 has joined #osdev
bauen1 has quit [Ping timeout: 260 seconds]
bliminse has quit [Quit: leaving]
bliminse has joined #osdev
netbsduser` has joined #osdev
bauen1 has joined #osdev
marcopolo2 has quit [Quit: Connection closed for inactivity]
antranigv_ has joined #osdev
antranigv has quit [Ping timeout: 248 seconds]
heat has joined #osdev
<heat> kernal
edr has joined #osdev
<dinkelhacker_> kernal?
<heat> kernal.
<dinkelhacker_> like the commodore kernel kernal?
<heat> kernal as in the old popular typo of the word "kernel" that infuriates the shit out of me
<heat> all terrible osdev forums questions from 2006 have a guy that calls it kernal
<dinkelhacker_> Aha so you throw a bait once in a while to see if someone wants to talk about his kernal? :D
<nikolar> KERNAL
<heat> no, i have become kernal, destroyer of kernels
<dinkelhacker_> trigger warning!!!!!
<nikolar> ?
<dinkelhacker_> ..you know because it triggers heat
<heat> it used to, but now it doesn't
<heat> you merely adopted the kernal, i was born in it
<nikolar> heat you adopted it too though
<nikolar> you hated it
foudfou has joined #osdev
<zid`> Turns out you can't tell people using things ironically from people using it authentically
netbsduser` has quit [Ping timeout: 264 seconds]
netbsduser` has joined #osdev
spareproject has joined #osdev
coolcoder613 has quit [Ping timeout: 260 seconds]
wereii has quit [Quit: ZNC - https://znc.in]
wereii has joined #osdev
<kof673> "DIFFERENCES BETWEEN ladon AND GNU Parallel" the sign language survives lol
<nikolar> ladon?
<Ermine> why does kernal infuriate you?
<Ermine> it's funny
<kof673> 100-headed or perhaps 3-month alchemy character, i say bslsk05 equivalent. hence "parallel" many-headed
<Ermine> cute typo done by newbies
<nikolar> KERNAL
<Ermine> KERNAL
<Ermine> it's sad when sound gets garbled on the talk one is interested in
<nikolar> kek yeah
<nikolar> what are you watching
<bslsk05> ​www.youtube.com <no title>
<nikolar> interesting
<Ermine> first half it is mono, and second part is garbled
<nikolar> :(
nur has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
Left_Turn has joined #osdev
<the_oz> "using it ironically" peak stupidity
hwpplayer1 has joined #osdev
dinkelhacker_ has quit [Quit: Client closed]
orccoin has joined #osdev
Dead_Bush_Sanpai has joined #osdev
netbsduser` has quit [Ping timeout: 245 seconds]
ZipCPU has quit [Ping timeout: 248 seconds]
eddof13 has joined #osdev
bauen1 has joined #osdev
ZipCPU has joined #osdev
zhiayang has quit [Ping timeout: 265 seconds]
netbsduser` has joined #osdev
zhiayang has joined #osdev
Left_Turn has quit [Remote host closed the connection]
Left_Turn has joined #osdev
Dead_Bush_Sanpai has quit [Read error: Connection reset by peer]
<Lucretia> is there a way to do x/24x $esp after every si?
<Lucretia> in gdb
Dead_Bush_Sanpai has joined #osdev
hwpplayer1 has quit [Remote host closed the connection]
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
Arthuria has joined #osdev
voidah has joined #osdev
voidah has quit [Remote host closed the connection]
Turn_Left has joined #osdev
raphaelsc has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
Arthuria has quit [Ping timeout: 245 seconds]
spareproject has quit [Remote host closed the connection]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
<dostoyevsky2> https://i.ibb.co/FVwJwfQ/mmap.png <- Andy really hates mmap (for DBMS dev) but I guess he has some good points
<heat> problem 4 is a nonissue, problem 2 is a nonissue
<the_oz> a lot of this is BECAUSE paging to/from memory is possible...
<the_oz> where would you go if you need resident memory? callstack?
<the_oz> highly active ring buffer?
<dostoyevsky2> https://www.youtube.com/watch?v=aoewwZwVmv4&t=1638 <- about 4: he's arguing that the kernel uses "expensive" mutexes and that if you'd were to manage memory directly in the DB there are cheaper mutexes...
<bslsk05> ​www.youtube.com <no title>
<dinkelhacker> Lucretia: in gdb do: "define hook-stop" and follow the instructions
<dinkelhacker> You can define commands that will be executed when the
<dinkelhacker> inferior stops
<heat> dostoyevsky2, LOL
<heat> hilarious
<dostoyevsky2> heat: And then he adds at the end: "Even if Linus disagrees"?
<the_oz> if he gonna go that route why bother with the kernal at all, DBMS bare metal
<the_oz> no paging issues when you're supreme overlord
<dostoyevsky2> heat: I mean #3 is nasty, having a SIGBUS instead of a proper error message, but if a write() fails in the DB all you get is a better error message and then the db crashes, I've never seen a DB recover from that
<dostoyevsky2> the_oz: Andy got you covered: https://www.youtube.com/watch?t=3480&v=hkTK6Auh5vE
<bslsk05> ​www.youtube.com <no title>
<dostoyevsky2> => S2024 #21 - Yellowbrick Data Warehouse System (CMU Advanced Database Systems)
<heat> dostoyevsky2, 3 and 1 are serious issues, yes
<nikolar> dostoyevsky2: i mean if a db can't write, how could it possibly recover
<heat> well, 1 isn't a problem if you're not a complete dumbass
<dostoyevsky2> nikolar: Yeah, even the error message might not be seen anywhere
<heat> you can use mmap as carefully as write, barring the SIGBUS crap
<heat> does he realize write() doesn't write to disk?
<nikolar> what was 1 again
<nikolar> heat: probably not
<Lucretia> dinkelhacker: thanks
<the_oz> isn't transactions failing expected behavior
<dostoyevsky2> nikolar: OS can flush dirty pages at any time, so if you are in a transaction that might be bad
<nikolar> right, but you can force a flush no
<nikolar> you've got basically the same issue with write anyway
<the_oz> flush is better than refusal
<dostoyevsky2> nikolar: So you could argue that the DB knows better what pages might be reused in the future than the OS... but not sure about that
voidah has joined #osdev
<heat> yeah. mmap might make it easier to violate those constraints, but it's fundamentally the same thing
<nikolar> i mean sure, but you get basically the same end situation
<heat> oh, general wisedom among kernel folks is that userspace has _no_ fucking clue what it's doing
<nikolar> just with some less code wiht mmap
<heat> it turns out to be correct
<nikolar> kek
<nikolar> well the only userspace software i'd expect to have some clue are databases
<nikolar> they are basically specialized filesystems
<heat> meanwhile this guy says mmap is slow while mongodb is WEBSCALE and eats other dbs alive using mmap
<nikolar> lel
<nikolar> it's mongo though, didn't it have some major corruption bugs
<heat> afaik mongo gives 0 fucks about data safety
<heat> inb4 SNAPSHOTS
<dostoyevsky2> the_oz: https://i.ibb.co/2cDT3JF/yb.png <- yellow brick does its own memory allocation, thread scheduling, device drivers, and network protocols
<nikolar> heat: what if your snapshots get corrupted
<heat> they would not, zfs wouldn't do that to you
<heat> now, btrfs on raid...
<nikolar> zfs doesn't corrupt stuff
<nikolar> you're thinking of btrfs
<xal_> there's a talk by one of the LMDB developers that makes a good argument for when mmap makes sense in a DBMS (unfortunately the audio is completely messed up, I had to download and play it in mono): https://www.youtube.com/watch?v=tEa5sAh-kVk
<bslsk05> ​www.youtube.com <no title>
<nikolar> literally the first time i've tried btrfs, it got corrupted
<nikolar> (wasn't raid)
<kof673> > they are basically specialized filesystems # i suspect there is some 1960s paper where these new filesystem things are like specialized databases
<nikolar> kof673: i guess you could look at either as if it were the other one
<the_oz> I've seen this before
<the_oz> fibre channel
<nikolar> kek should've guessed that it was postgresql
<the_oz> I have much the same architecture serving up disk blocks
xal_ is now known as xal
<dostoyevsky2> xal: thanks for that link
<Mondenkind> 'does he realize write() doesn't write to disk?' O_DIRECT, spdk
<heat> well then you're comparing two different things
<heat> correctness and performance wise
<nikolar> > Try to minimize cache effects of the I/O to and from this file.
<nikolar> no guarantees
<heat> they're being humble, O_DIRECT is guaranteed to work AFAIK
<heat> mmap is analogous to some fucked up lseek + buffered write, there's no O_DIRECT variant
<heat> which, fun fact: lots of prod databases do buffered writes by default
<heat> postgres does buffered writes, sqlite does buffered writes. not sure what the situation is with mariadb/mysql
<nikolar> probably the same
<the_oz> something something which trans engine something
<heat> there are also these two syscalls named fdatasync and msync which can literally just sync a file range - which is exactly what you want in db terms
<xal> i would really love to see fsync split into two different syscalls: one which acts as a write barrier and another which blocks until all pending writes are durably on disk. iirc OSX has this, but very few applications are aware that ordinary fsync is a no-op
voidah has quit [Remote host closed the connection]
<heat> osx fsync is a fucking noop??
<bslsk05> ​developer.apple.com: Mac OS X Manual Page For fsync(2)
<heat> doesn't seem like it, they offer that special fsync as fcntl
<heat> but fsync seems to work as it should
<xal> what difference does it make if my data is lost in a crash and it's in the disk's buffers rather than the OS buffers?
<heat> right. that's PEBKACAP (problem exists between kernel and chair of apple programmer)
<xal> when I was investigating this I (re)discovered that while sqlite goes out of their way to use F_FULLFSYNC on osx, apple's shipped version in /usr/lib patches that out and turns it into a write barrier only
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 248 seconds]
voidah has joined #osdev
<nikolar> imagine programming for osx
youcai has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<xal> to be fair, they do implement the "separate write barrier and flush" idea. linux should totally steal it
<xal> the block layer is already set up to handle it with REQ_FUA and REQ_FLUSH!
gog has joined #osdev
<heat> barrierfsync sounds like a PITA to implement
<kof673> was trying to see if it was a mach thing that apple picked up along the way "This normally results in all in-core modified copies of buffers for the associated file to be written to a disk." http://www.polarhome.com/service/man/?qf=fsync&af=0&tf=2&of=NeXTSTEP
<bslsk05> ​www.polarhome.com: fsync man page on NeXTSTEP
<kof673> i did find a post where the apples person just says disks (and/or controllers/whatever) lie, so that was the reasoning
<nikolar> they lie somewhat, depending on the model etc
<nikolar> doesn't mean the os should lie too
<kof673> sure. i didn't save the link, they were saying this is why buy apple-approved drives instead of external things, because then they can mandate they do not lie/etc.
<kof673> in theory anyways
<nikolar> lol
<nikolar> sure they will
xal has quit [Quit: bye]
xal has joined #osdev
<the_oz> that seems rather naive
<the_oz> assuming apple hw engineers aren't jaded as fuck
Lucretia has quit [Ping timeout: 252 seconds]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 265 seconds]
orccoin has quit [Ping timeout: 252 seconds]
obrien has joined #osdev
Matt|home has joined #osdev
Lucretia has joined #osdev
craigo has joined #osdev
eddof13 has quit [Quit: eddof13]
eddof13 has joined #osdev
<bslsk05> ​github.com: Add ToaruOS · Issue #900 · repology/repology-updater · GitHub
Lucretia has quit [Ping timeout: 244 seconds]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
eddof13 has quit [Ping timeout: 246 seconds]
Gordinator has joined #osdev
Lucretia has joined #osdev
Matt|home has quit [Quit: Client closed]
Gordinator has quit [Quit: My client has closed - perhaps I did that, perhaps I didn't]
<heat> webscale
<nikolar> what is this monstrosity
<heat> tcp dataflow
<nikolar> that's
<nikolar> a lot
<heat> i like the part where the arrows go all over the fucking place
<heat> it's really nice
<nikolar> lol
<nikolar> so the whole thing?
<heat> yea
<nikolar> is there a tool that generates these graphs
<nikolar> that's kind of cooo
<nikolar> *cool
<heat> nah this has to be manual
<heat> someone had to manually do this
<nikolar> yeah cursed
<geist> that is pretty neat. there have been times i've sat down to trace some sort of data flow in something and ended up building some sort of text version of that
<geist> but usually more of a outline form, tracing through function calls., but it always ends upbeing a mess
<nikolar> just put it through dot then geist :P
<geist> re: apple engineers and not flyshing things. yes they are jaded as fuck
<geist> or at least back in the mid 2000s i was briefly on the FS team for a few months
<geist> and it was a real problem: lots of new usb drive enclosures were hitting the market and a sizable number of them would ignore the flush command
<geist> and thus not really deal with proper journalling
<geist> i think it's mostly an attest to the fact that some of the FS folks (dbg in particular) took it *extremely* seriously that lack of flush meant you really couldn't guarantee that journal works
<heat> i vaguely recall linux really never enabled the write cache
<heat> but this may not be true, i dont remember honestly
obrien has quit [Remote host closed the connection]
<geist> yah, windows also still kinda to this day defaults to 'optimize for quick removal' and keeping the write cache disabled
<nikolar> doesn't linux detect when a thumbstick is plugged in, and disables caching
<nikolar> so you can just yank it out
<heat> oh i think it disabled the write cache for everything
foudfou_ has joined #osdev
<heat> like, hard drives too
<geist> dunno, the real key is the larger enclosures that have a proper HD inside them that does have some write cache on the disk
<nikolar> so, writing directly to the hardware?
<nikolar> no buffering and such
<heat> no
<geist> but if the USB chipset there doesn't pass a USB level flush through to the internal drive...
<heat> it has its own page cache, obviously
<heat> we're talking about the disk's write cache itself
<geist> right
foudfou has quit [Ping timeout: 260 seconds]
<geist> thumb drives i suspect have not a tremendous amount of write cache, though it all gets blurred with really high end ones, SD cards, NVME on usb enclosure, etc
<geist> but at least in the 2000s none of that really existed that much, except enclosures with a spinning disk
<geist> but spinning disks had by then long had at least some amount of write cache
<geist> OTOH i think nowdays most things ar epretty good at honoring flush commands, if nothing else because most stuff is just standardized chips slapped in a box, and if the underlying commodity chip does it, then it's mostly all good
<nikolar> i don't see why it wouldn't honestly
<nikolar> there's plenty of transistor to spare for that i imagine
<geist> nowadays yeah
<geist> though i think more complex things like usb -> nvme is a lot of work. probalby a microcontroller there running something to do that translation
<geist> and you know how most real code in the world is, especially to support selling some chip...
voidah has quit [Ping timeout: 245 seconds]
<nikolar> but passing through a flush signal seems simple enough
<nikolar> probably the simplest operation the code needs to handle
<heat> yea but you need to, uhh, take that into consideration
<nikolar> kek
<heat> and it's not actually trivial if you're just testing the thing for functionality
<heat> if you forget read or write the thing just doesn't boot
<nikolar> yea
<heat> if you forget flush you can corrupt stuff very rarely if the machine goes down and you're unlucky
<zid`> I wish I'd paid more attention in French lessons. I can't remember any French idioms.
<zid`> Oh well, that's life. Whatever will be, will be.
<nikolar> lol
<the_oz> siesta lay vida
vdamewood has quit [Quit: Life beckons]
kilic_ has quit [Quit: Leaving]
n_shp is now known as nshp
hwpplayer1 has joined #osdev
hwpplayer1 has quit [Remote host closed the connection]
cow321 has quit [Ping timeout: 252 seconds]
cow321 has joined #osdev
vdamewood has joined #osdev
eschaton_ is now known as eschaton
beto has quit [Ping timeout: 260 seconds]
Dead_Bush_Sanpai has quit [Ping timeout: 252 seconds]
Dead_Bush_Sanpai has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
beto has joined #osdev
levitating has joined #osdev
<Ermine> yay outdated documentation
<heat> lol what are you looking at
<nikolar> linux kernel
<Ermine> drm gem
<nikolar> kek
heat_ has joined #osdev
<heat_> oh are you volunteering to port drm to onyx? sgtm
<heat_> ok heat@
heat has quit [Read error: Connection reset by peer]
<Ermine> it's quite possible if I grok this thing
levitating has quit [Read error: Connection reset by peer]
heat_ has quit [Read error: Connection reset by peer]
heat_ has joined #osdev
LittleFox has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
LittleFox has joined #osdev
Lucretia has quit [Ping timeout: 265 seconds]
netbsduser` has quit [Ping timeout: 246 seconds]
bliminse has quit [Ping timeout: 264 seconds]
heat has joined #osdev
bliminse has joined #osdev
heat_ has quit [Ping timeout: 246 seconds]