<heat>
you can't use CAS on any exam (here at least) cuz it'd do the whole exam for you
<zid`>
we have
<zid`>
two maths papers
<zid`>
with and without calculator
<zid`>
with is like "do this math olympiad problem" where the problem is figuring out what the fuck to calculate in the first place
<zid`>
and without calculator that's like "add these three numbers"
<zid`>
In serbia the mathematics exam is to solve one of the prisoner's dilemma problems. You have to hand your guess in rubles what the 2nd highest amount of rubles given is to get top marks.
<heat>
i think he tokenized a bunch of software into stuff you can actually code search into
<zid`>
yea
<heat>
i.e doesn't match comments
<zid`>
stripping comments would be nice yea
<zid`>
I just tried it on github and it was 100% comments
<zid`>
the libpng one is a comment too it's just in an ifdef comment that it can't tell apart from a non-comment ifdef
<zid`>
This is the kind of shit that chatgpt might actually be useful for, you don't care about false-neg or false-pos too much, and it's a text processing task
<clever>
funny story from another OS dev place, the guy wrote his own basic libc just to fill in the needs for a few functions
<clever>
gcc saw the memset loop, and replaced it with a call to memset
<clever>
infinite recursion!
<nortti>
ah, the classic
<vdamewood>
That's why you build libc freestanding and with nostdlib
<clever>
ah, thats the flags i was thinking of
<zid`>
yea if you do that it replaces it instead with 40kB of sse
<zid`>
and then you remember you need -mgeneral-regs-only
<gog>
yo dawg we heard you liked memset
<clever>
zid`: in this case, it was risc-v, so no sse
<zid`>
-fno-builtins also
* vdamewood
memset gog fishy
* gog
chompset(fishy)
GeDaMo has joined #osdev
<Matt|home>
hey guys, sorry (again) for the off topic question, i just want some _very_ general advice about computer security, im not too concerned if it's super accurate so opinions are fine: basically just wondering what decent security software/practices look like for windows and linux in general. im told for example "linux doesn't usually need antivirus software" but not sure why windows does. sorry for the vagueness, like i said just
<Matt|home>
looking for suggestions since there's a lot of opinions on the topic
<Matt|home>
cool ddevault
dostoyevsky2 has quit [Quit: leaving]
dostoyevsky2 has joined #osdev
<gog>
depends on who is using the machine
<gog>
i'm not terribly concerned about catching viruses on windows, but only because i usually know what i'm doing and hvae only been caught off guard a few times
<gog>
but it only takes one time
<gog>
so
<gog>
weigh that against the risks
<zid`>
computer security same as sexual health
<gog>
yes
<gog>
why worry
<gog>
we're all gonna die anyway
<gog>
inb4 somebody starts calling PrEP "McAffee"
<nikolar>
You generally don't download random binaries on Linux
<nikolar>
So that's one major reason why you don't need antivirus software
<zid`>
no
<zid`>
The one set of linux users who that applies to
<zid`>
get ridiculed for doing it
<zid`>
everybody else downloads random binaries
<GeDaMo>
Some people pipe downloads straight into a shelll :P
<zid`>
GeDaMo did you link your irc client to PSN yet
<GeDaMo>
PSN?
<zid`>
playstation network
<zid`>
(there's drama you're clearly not privy to)
<GeDaMo>
:|
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 268 seconds]
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
wand has quit [Ping timeout: 260 seconds]
<heat>
most binaries on linux are random
<heat>
"supply chain security" are terms never put together before, in most distros
gog has quit [Ping timeout: 260 seconds]
goliath has quit [Quit: SIGSEGV]
<zid`>
ring ring, ring ring
netbsduser has quit [Ping timeout: 252 seconds]
<nikolar>
I trust my distro way more than a random .msi executable i download
gog has joined #osdev
gog has quit [Client Quit]
<heat>
you don't need to trust your distro, you need to trust the maintainers, usually
<zid`>
I trust your distro less than I trust a random .msi depending where I downloaded it
<zid`>
see: xz
<heat>
i don't know how artix works, but on arch maintainers can push whatever, whenever
<heat>
artix's security situation is in all likelyhood *worse*
<heat>
when people can push whatever they like, no strings attached, you don't trust the distro, because updating packages and review is not a "distro thing"
<zid`>
it's why leftpad was such a nightmare, security wise, nobody's checking that code and some guy could just push code to millions of people
<Ermine>
By push you mean without merge request?
<heat>
yes
<heat>
i can trust arch all i want (and i usually do), but some hobo could randomly update arch's gcc to rm -rf ~/Onyx
<heat>
and i'd know after ~/Onyx gets nuked
<zid`>
msis are technically signed by the dev at least
<zid`>
so I can download them from an unsafe location as long as I bother to do the checks
<Ermine>
I can slap my pgp signature on some .tar.gz as well
<zid`>
The intermediate can strip it out, tar.gz's are not *typically* signed
<zid`>
so I wouldn't even bat an eyelid if it was unsigned
gog has joined #osdev
<zid`>
nor will my distro stop me
<zid`>
windows will infact, refuse unsigned msis unless you tell it not to
carbonfiber has quit [Quit: Connection closed for inactivity]
<heat>
that's also true, PE and windows have code signing
<heat>
ELF has skibidi toilet baby gronk rizzed up livvy dunne
<Ermine>
But then cert expires and that renders wi-fi adapter unfunctional
<Ermine>
(And I'm in a situation when I have a linux-only adapter and windows-only adapter)
<heat>
yes and that hints that your vendor sucks ass
netbsduser has joined #osdev
theyneversleep has quit [Remote host closed the connection]
<Ermine>
one is d-link, and another is comfast
<heat>
d-link ass? checks the fuck out
<heat>
if i had to choose between d-link and tp-link i'd off myself
theyneversleep has joined #osdev
<Ermine>
Currently all of them use realtek chips anyway
theyneversleep has quit [Remote host closed the connection]
Arthuria has joined #osdev
voidah has joined #osdev
nur has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
Arthuria has joined #osdev
gorgonical has joined #osdev
<gorgonical>
what is good everyone
<mcrod>
stupid question
<mcrod>
this is in the context of embedded work
<mcrod>
let’s say I’m writing a driver to communicate with some chip
<mcrod>
but that chip supports both polling and interrupts
<mcrod>
i don’t know I can support both
<mcrod>
how to*, i know it’s obviously possible
<gorgonical>
I prefer polling because async computing and callbacks are the work of the devil
<mcrod>
that’s not what I asked :p
<gorgonical>
i know lol
<gorgonical>
so what exactly is the question
<mcrod>
basically
<mcrod>
“spawn a way to talk to x, synchronously”
<mcrod>
it’s hard to type over the phone
<mcrod>
but I want to communicate with something over SPI
Gooberpatrol66 has quit [Ping timeout: 246 seconds]
<mcrod>
it then doesn’t have to know about hardware
<mcrod>
maybe?
Arthuria has quit [Ping timeout: 260 seconds]
gbowne1 has joined #osdev
gbowne1 has quit [Remote host closed the connection]
gbowne1 has joined #osdev
wand has joined #osdev
Gooberpatrol66 has joined #osdev
voidah has quit [Remote host closed the connection]
wand has quit [Ping timeout: 260 seconds]
wand has joined #osdev
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
Starfoxxes has quit [Ping timeout: 255 seconds]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #osdev
Starfoxxes has joined #osdev
agent314_ has joined #osdev
agent314 has quit [Ping timeout: 268 seconds]
<geist>
you can generally support both butyou need a way to transition between them
<geist>
or in the case of some sort of crash time situation: disable interrupts and use an alternate polling api
<geist>
GetPendingPacket() -> [ packet or error ], etc
<heat>
i think on Real Kernels for performance when you ask for polling all you get is not sleeping
<heat>
basically polling the internal data structure instead of some register
<GreaseMonkey>
polling or interrupts? trick question, the answer is always DMA
<heat>
what
<zid`>
what
<GreaseMonkey>
(unless it's IBM PC DMA)
<childlikempress>
what
<mjg>
rust has fearless device driver handling
<heat>
you have scared shitless device driver handling because you never wrote one
<GreaseMonkey>
but yeah for polling vs. interrupts, you can have both - the latter can set a flag and ensure that the CPU is awake, and then the main task(s) can check which flags are set... or instead of a flag one can consider an event queue
<GreaseMonkey>
and if you don't have DMA... probably best to emulate it in an interrupt handler if you have the RAM to spare
<mjg>
heat: OH. while i never wrote a driver from scratch, i did patch some up a little bit
<mjg>
i consider myself a senior device driver programmer, and by that mean i probably should not be writing any
<heat>
vice president of drivers
<GreaseMonkey>
basically you'd want to tell your SPI driver "i want to send this message and get a response back of the same length because SPI"
<heat>
distinguised driver engineer
<GreaseMonkey>
and in the best case, only one thing should need to use the specific SPI peripheral
<heat>
director of drivers
<mjg>
heat: senior VP
<GreaseMonkey>
driver training coach
<heat>
chief driver officer
<mjg>
virgin normie seeing ooo thinks out of office
<mjg>
chard programmer thinks out of order (execution)
<bslsk05>
'The Sopranos Ohs and Hos!' by TheMotherFarquhar (00:03:25)
<gog>
ooo is the noise i make when i see a cute outfit
<mjg>
gog is a target hoe
<gog>
ehhhh
<gog>
target is fine ig
<gog>
they had a cardigan and some sneakers i bought once
<gog>
but mostly it's too twee for me
<gog>
and for some reason in my mind i associate target with beige moms now
<mjg>
is that the new wave of old money aesthetic for people with no money?
<gog>
idk how to describe it really. it's like an extension of scandiavian modern styling i guess?
<gog>
where everything is grey, black, or some tone of whit
<gog>
like the interior of my apartment
<heat>
eggshell
<gog>
yes
<gog>
eggs hell
<heat>
are you a e s t h e t i c too
<heat>
do you speak i t a l i c
<gog>
no
<mjg>
i speak colloquial polish quite fluently
<mjg>
watch this: w szczebrzeszynie chrząszcz brzmi w trzcinie
<mjg>
means "hello, nice to see you"
<heat>
agreed
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<zid`>
EGG
<nikolar>
EGG
<heat>
wooooo i can create a partition from onyx and write to it
<netbsduser>
is there a modern analogue to the buffer head in linux? i know that still exists and is tagged into page cache pages (which, i assume, disables automatic write back of the said pages?) - but i've heard that even Torvalds himself rages against the buffer head now
<heat>
yes
<heat>
iomap
<heat>
>(which, i assume, disables automatic write back of the said pages?)
<heat>
no, not at all
<netbsduser>
purely for fs metadata i am thinking here
<netbsduser>
because there you can't have the swapper writing back your data willy-nilly
<netbsduser>
what if it's not been put to journal first?
<heat>
yes you can
<heat>
journalling is different
<heat>
jbd2 actually depends on buffer heads, but AIUI they'll only start thinking about writeback after it has been committed to the journal
<heat>
journaling? yeah journaling
<netbsduser>
if you're journalling you surely can't be having the metadata you modified in the page cache get thrown onto disk before you've put the changes into the journal first
<netbsduser>
thanks for the iomap pointer btw it will be useful
<heat>
i don't know exactly how the jbd2 bits work, but they work
<heat>
np
<netbsduser>
i have a block cache (only for fs metadata) but i'd like to modernise
<heat>
note that iomap isn't a buffer cache
<heat>
the current narrative around filesystems in linux is that you're supposed to bring your own buffer cache (xfs_buf, btrfs extent_header(?), or even buffer_head)
<netbsduser>
that's interesting, do they use the page cache at all for metadata in the modern filesystems or do they just do direct reads into their own buffer cache?
<heat>
iomap buffered IO data is IIRC something like {spinlock, bytes_dirty, dirty block bitmap, uptodate block bitmap}, for every folio
<heat>
i think It Depends
<mjg>
itDepends.unwrap()
<heat>
xfs doesn't, i think, because they support a bunch of crazy stuff (i.e vmalloc'd buffers)
<heat>
and they historically supported block size > page size even if that wasn't necessarily true for the linux port
<netbsduser>
someone told me linux is moving to support that generally now
<heat>
yes
<heat>
well, "generally", aka with iomap
<heat>
buffer_heads will probably be stuck on order-0 folios (single pages)
<geist>
NTFS has the neat effect, by design, that all the metadata itself fits in hidden-system files so they can use the same file cache to cache them
<geist>
and the journalling code is basically a layer on top of that to selectively journal writes to system files
<mjg>
huh
<mjg>
i don't know if that's necessarily neat
<geist>
like at mount open the 10 metdata files, then register them with the journalling layer
<geist>
well neat from a design point of view, its a nice design
<geist>
of course that came from VMS which came from RSTS or so, since FILES-11 FS did the same thing
<mjg>
i mean metadata has fundamentally different properties than actual data
<geist>
well, not if you reframe it, which is the strategy there
<mjg>
so NOT mixing them in this way would probably avoid special casing
<netbsduser>
vms has much to answer for
<heat>
le unix filesystems also do metadata in files
<heat>
aka directories
<geist>
yah, directories
<geist>
so you could, for example, construct a virtual file to represent all the inodes in the system, and the bitmap, etc
<netbsduser>
they picked a 512 byte page size for hte vax because vms people thought you would need it to do a page cache
<mjg>
no, inode's metadata are NOT in a directory
<geist>
and then cache them at the file level
<mjg>
in fact inodes are not in directories
<mjg>
at best you have a hardlink to an inode in a directory
<netbsduser>
being equal to the block size
<geist>
right but a strategy is to map them into one large virtual file
<netbsduser>
geist: this is broadly the lines i had been considering, a synthetic vnode whose page cache is used for caching FS metadata
<geist>
yah
<heat>
mjg, directories are metadata
<heat>
like, by definition
<netbsduser>
would need a pinning mechanism + writeback control on a per-block basis for something like ext
<heat>
netbsduser, that's what i have yeah
<geist>
yah that would be teh trick, building some sort of layer on top of it or within it to let you specially deal with those metadata files
<heat>
all block devices get their own backing inode in a special hidden fs
srjek has joined #osdev
<geist>
question there is if it makes sense to split it into multiple virtual files for different pices of metdata, or one large one that backs the whole device
<geist>
the latter is simpler, but you end up with a very large sparse vnode
<geist>
and thingsl ike readahead and whatnot may not help you
<heat>
'tis life
<heat>
something that buffer heads give you is coherency between fs metadata and /dev/sda
<heat>
for free!
* kof673
points out eggs are double or even triple layered, and the metaness of this discussion
<heat>
and this is actually used by some ext234 utils
<heat>
like, poking at metadata from userspace. i know, insane
<heat>
netbsduser, btw this can help, dave chinner (the xfs guy) explaining why buffer heads suck: https://lwn.net/Articles/932665/
<netbsduser>
i am different atm in that i have no buffer heads for (regular) file caches, there i did think it would be particularly wasteful in the presence of extents - i have a traditional buffer cache for FS metadata only (includes directories) - i don't have anything but the block cache yet to help in deciding where a dirty file page gets written back to
<netbsduser>
the write back daemon just posts the request to the FS which will consult its metadata block cache to find out where to write back to
agent314_ has quit [Ping timeout: 256 seconds]
agent314 has joined #osdev
<heat>
geist, btw TIL there's a discard option you can use to enable QEMU TRIM commands
<heat>
which can TRIM on the backing block device or just use fallocate to punch holes in the file
zxrom has quit [Quit: Leaving]
azonenberg has joined #osdev
<kof673>
i'm not sure the main article realizes the purpose of a sunset is that it rises again. "We're going to turn this team around 360 degrees" -- attributed to jason kidd
<clever>
heat: ive had trouble with iscsi, trim, and zvol, the problem is that my iscsi daemon doesnt believe that a zvol supports trim (when it does)
<clever>
so i often have to either remount things directly on the server and fstrim, or dd some nulls over