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
bslsk05 has joined #osdev
<epony> the good of APM
<kaichiuchi> nice.
<kaichiuchi> i reboot into arch linux and half of the desktop is broken
<kaichiuchi> my only crime? pacman -Syu
<heat> how?
<kaichiuchi> well I rebooted again and suddenly everything is working
<kaichiuchi> so no idea
<heat> your system is weird
<kaichiuchi> that's what every linux person says
<epony> because you have services like messagebus / dbus which need to start early with the session
<kaichiuchi> also why do I need to unplug my transceiver for my G502 HERO and plug it back in to move my mouse
<kaichiuchi> don't have to do that with windows, never had to do that with freebsd
<epony> desktoys are like that, have extra services for middleware IPC / RPC which is the source of EVIL and HELL
<epony> that's entirel to immitate signalling and ole and drag-drop and other perversions
<heat> shrug
<epony> which get you stuffed badly
<heat> listen, if I had a system that broken I would also not use linux
<heat> or would just use a distro that worked
<kaichiuchi> I swear in the name of rms, linus torvalds, alan turing, I am doing absolutely nothing crazy
<bslsk05> ​cve.mitre.org: CVE - Search Results
<epony> it's not you, it's FDO
<epony> (Free Drugs Orgy)
<bslsk05> ​en.wikipedia.org: freedesktop.org - Wikipedia
<epony> you really like pango and cairo the most
<epony> and rsvg
<kaichiuchi> i have no idea what you're saying
<epony> something like "you can't breathe" in desktoyspeak
<epony> read up on dbus from the last link
<epony> it'll get your hair up
<epony> it uses XML (wtf) you know from the billion laughs fame https://en.wikipedia.org/wiki/Billion_laughs so it's really fun to work with it from the human reviewer perspective
<bslsk05> ​en.wikipedia.org: Billion laughs attack - Wikipedia
<j`ey> kaichiuchi: most other ppl have /ignored them btw
<epony> and dbus has like monthly expoits
<epony> you can ignore dbus too ;-) but it is not ignoring you
<epony> it gets you stuffed early with systemd
<epony> that's why people hate Redhat
<epony> you have the same on Windows though, that's where these concepts were invented you just "relogin" / restart your desktop or it crashes / freezes / reboots you / nothing until it locks up
<kaichiuchi> template <unsigned int Bit, typename Type>
<kaichiuchi> constexpr void BitSet(Type& value) noexcept {
<kaichiuchi> static_assert(Bit <= gbstl::numeric_limits<Type>::digits());
<kaichiuchi> value |= (1 << Bit);
<kaichiuchi> }
<kaichiuchi> I hate everything about this and it is so stupid
<kaichiuchi> also, just `digits`
<epony> FreeBSD is a bit less stupid than Linux so it does not have systemd but a shim, but the desktoy stupidity is there front and center
<kaichiuchi> is there some magic that I'm missing where I don't have to do BitSet<666>(i) and I can just do BitSet(i, 666);
<heat> you never had to?
<kaichiuchi> not according to the compiler
<heat> constexpr void BitSet(Type& value, uint bit) { value |= (1UL << bit); }
<kaichiuchi> but I can't use `bit` in a static_assert now
<kaichiuchi> unless you mean "the compiler will throw the warning don't even bother"
<heat> why do you care?
<kaichiuchi> why wouldn't I care?
<kaichiuchi> if someone accidentally hits 8 or 9 on their keyboard if they're working with a uint8_t, I want that trapped
<heat> fsanitize=undefined + fsanitize-trap
<heat> in a constant expression, that will just warn
<kaichiuchi> but I could stop it before ever getting to that point
<heat> <source>:4:14: warning: left shift count >= width of type [-Wshift-count-overflow]
<heat> 4 | return 1 << 40;
<kaichiuchi> yes
<heat> this is a non-issue
<kaichiuchi> probably
<heat> this is why C++ sucks
<heat> people try to overengineer the shit out of things
<kaichiuchi> hey
<kaichiuchi> I *did* say that the compiler would indeed have a warning
<kaichiuchi> but this isn't a "warning", this is an "error", but I suppose that's why you use -Werror
<kaichiuchi> i dunno how that isn't an error already
<heat> -Werror=shift-count-overflow
<kaichiuchi> yeah yeah
<j`ey> doesnt work through a function call
<heat> fsanitize=undefined + fsanitize-trap
<kaichiuchi> i hate C++.
<j`ey> you just want template arguments to look like normal ones
<kaichiuchi> yes
<kaichiuchi> that is correct
<j`ey> make it a macro1
<heat> please stop
<kaichiuchi> because BitSet<4>(ndflslkdfl); looks like hell
<kaichiuchi> because "4" isn't a type
<heat> having a BitSet is useless
<kaichiuchi> well it's certainly not going to hurt anything
<heat> your compile time will suffer, the readability will suffer
<kaichiuchi> why would the readability suffer? surely people know what this is doing
<kaichiuchi> it sets a bit `b` in an integral type `t`
<j`ey> so does: t |= (1 << b)
<heat> yes, with an in-out reference parameter?
<heat> ^^
<kaichiuchi> the hope was that it quite literally functions like a regular macro if I use a reference
<kaichiuchi> wtf do you want me to do, say `var = BitSet(var, 4);`?
<heat> that would make more sense
<kaichiuchi> these sorts of functions/macros/etc are nothing new though
<kaichiuchi> i've seen plenty of BIT_TEST, BIT_SET, BIT_CLEAR etc macros in C code
<heat> and it's a bad idiom
<kaichiuchi> what I have as well is an "extract value from bit range" function
<kaichiuchi> so I can say "get the value between bits 5 and 10"
<kaichiuchi> and the compiler will auto-generate the appropriate masks and shifts
<kaichiuchi> are you going to say that's a bad idiom as well?
<heat> it just seems unuseful to me
<heat> if you're doing bit manip without a solid understanding of shifts, masks, whatever, tough luck
<heat> I don't think I've gotten a single bug on one of my manual bit shifting or masking
<heat> and I've written plenty of drivers
<heat> so what do you get exactly? slow compiles?
<heat> less readable things?
<kaichiuchi> i'm really struggling to understand why it's less readable, or how that would lead to a slow compile time
<heat> the compiler needs to run a whole fucking constexpr evaluator for your BitSet
<heat> or instantiate a whole template and then run a whole constexpr evaluator
<kaichiuchi> I guess that's fair
<heat> it's less readable because BitSet(value, bit) is a weird pattern compared to language standard features like |= (1UL << bit);
<kaichiuchi> fine then, but I'm keeping my SetOrClearBitIf template
<heat> hm?
<kaichiuchi> if (cond) { bit_set(value, b); } else { bit_clear(value, b); }
<heat> ok
<heat> if you start getting into weird helpers like BitSet a great number of questions come into mind like "how do you compose this?" and "how do you set multiple bits"
<kaichiuchi> I guess
<kaichiuchi> well, I can see the argument
<kaichiuchi> you can still type the wrong bit in BitSet, so how much are you really helping anyway
<heat> also fwiw bit fields are a thing if you really want "easy" bit manip
<kaichiuchi> yeah but I'd rather not use bit fields
<kaichiuchi> in this case, anyway
<zid> bit fields are shitty unfortunately
<zid> order is unspecified and codegen is often bad
<zid> peko
<bslsk05> ​clang.llvm.org: Clang Language Extensions — Clang 16.0.0git documentation
<kaichiuchi> i am seriously ready to punch myself in the nose
<kaichiuchi> and put on a clown mask
<kaichiuchi> that's it, that's it, I'm done, I can't do this anymore
<kaichiuchi> fuck C++
<heat> ok
<kaichiuchi> my fancy operator overloading is just killing me now.
<kaichiuchi> I'm starting to think you guys are right
<zid> C++'s great, until you try to use two features at once :P
<kaichiuchi> no one makes actual die hard usage of every feature known to man
<kaichiuchi> at some point, it just gets really distressing
<kaichiuchi> especially when you have "no viable operator=" and you look why and it's 400 lines of nonsense
bgs has joined #osdev
<pogchamp> zid
<pogchamp> moth day
<zid> moth day.
sonny has joined #osdev
<epony> Try Rust instead of C++ and discover your inner feminine side..
<epony> real programmers don't write in.. corporate-owned languages
sonny has quit [Quit: Client closed]
Burgundy has quit [Ping timeout: 260 seconds]
<Clockface> rust seems more corprate owned than C++?
<Clockface> it seems more centralized and i think mozilla is behind a lot of it?
<kaichiuchi> also
<Clockface> although mozilla is a nonprofit
<kaichiuchi> can someone tell me why C++ doesn't have native restrict support
<kaichiuchi> that's actually bonkers
<Mutabah> "native restrict"?
<kaichiuchi> it doesn't officially support the restrict keyword
<kaichiuchi> you need __restrict or __restrict__
<Clockface> what does restrict do?
<Mutabah> Likely because it forked from C before then, and nobody has proposed adding it
<Mutabah> Clockface: Flags the pointer as being the only (visible) way of getting access to a value
<Clockface> that sounds useful for projects with lots of random programmers
<Clockface> that does sound like a good feature
dude12312414 has joined #osdev
<kaichiuchi> it's useful for performance and auto-vectorization
<Mutabah> however... can lead to UB if that assumption is violated
<kaichiuchi> i'm going to shamelessly copy the example from wikipedia
<kaichiuchi> Clockface: https://godbolt.org/z/G1z5c9Y3d
<bslsk05> ​godbolt.org: Compiler Explorer
<Mutabah> Note: All rust borrows/references/&-ptrs are tagged `restrict` at the LLVM layer
<Mutabah> (which the compiler can do, because the borrow rules get the frontend to enforce the rules
<kaichiuchi> it just strikes me as madness that one of the features that made C on par with FORTRAN performance is just... nonexistent in C++
<Clockface> C++ is supposed to have every feature
<kaichiuchi> there's an open-std article where someone is openly baffled by this
<kaichiuchi> and says "it makes a difference. please use it."
<Clockface> why would it not have something?
<kaichiuchi> because it's "safe"
<Clockface> C++ is trying to be safe?
<Clockface> i thought it was C with free crap
<Mutabah> Nope. C++ is not a superset of C
<Clockface> thats how i always thought of it
<Mutabah> (They are very close to it... but not quite)
<kaichiuchi> the lack of restrict makes me wonder if C++ is actually forever slower than FORTRAN
<kaichiuchi> unless someone is piling on __restrict__ everywhere they can
<kaichiuchi> well everywhere where it matters
<heat> restrict makes 0 difference
<heat> except where it actually matters, which is rare
<kaichiuchi> "There is no question that the restrict qualifier benefits compiler optimization in many ways, notably allowing improved code motion and elimination of loads and stores. Since the introduction of C99 restrict, it has been provided as a C++ extension in many compilers. But the feature is brittle in C++ without clear rules for C++ syntax and semantics."
<heat> i'm calling bullshit on that one
<kaichiuchi> i'm not
<kaichiuchi> the restrict keyword was added in response to FORTRAN being faster
<heat> i have not seen a non-libc project that actively uses restrict
<kaichiuchi> because it's kinda... hard
<heat> strict aliasing takes good care of you not needing restrict
<kaichiuchi> hard to guarantee in the future that `a` won't alias `b`
<bslsk05> ​godbolt.org: Compiler Explorer
<kaichiuchi> here's an example of it working
<kaichiuchi> pretty sure ulrich drepper has said to use it too
<bslsk05> ​lwn.net: Memory part 5: What programmers can do [LWN.net]
<kaichiuchi> The rest of the complication here results from the fact that gcc is not very smart when it comes to optimizing array indexing. The introduction of the additional variables rres, rmul1, and rmul2 optimizes the code by pulling common expressions out of the inner loops, as far down as possible. The default aliasing rules of the C and C++ languages do not help the compiler making these decisions (unless restrict is used, all pointer accesses are
<kaichiuchi> potential sources of aliasing). This is why Fortran is still a preferred language for numeric programming: it makes writing fast code easier. {In theory the restrict keyword introduced into the C language in the 1999 revision should solve the problem. Compilers have not caught up yet, though. The reason is mainly that too much incorrect code exists which would mislead the compiler and cause it to generate incorrect object code.}
<kaichiuchi> ok, he didn't say to USE it, but he said there's a solution in theory
<heat> 1ca0a833c1e7122c05b4fb7d54f73c565a7877300d2703e0b881b04b9771ba14448758f83f49918860b2dcf4175dce33047a6fb79dd201ca3a165aeb616870a65430f317a269db0fe8765c4be71a03cd08f864f7ac778aedeb2bc9a803de588fba82d36352290baf7767bf2bed0380c4f72376671e165b0d4b5b02be007b8a4db89523013f1b2ad10e00c626175f2c5245cc650f7dd8af002c8a7127ab29eae8c81806c0745aedebd02cb0e2298fe3a001f4e0536cf0f155a99b8f6b79a89d5775f1ddeeda71fdf7c44b7aefc61cc02&scope=&scopeName=All+repos
<bslsk05> ​cs.github.com: GitHub Code Search (Preview)
<heat> omg
<kaichiuchi> i can't log in
<kaichiuchi> .
<kaichiuchi> what does it say
<bslsk05> ​cs.github.com: GitHub Code Search (Preview)
<heat> more manageable
<heat> it's not used in linux, that's the point
<kaichiuchi> that doesn't mean it's useless
xenos1984 has quit [Read error: Connection reset by peer]
<kaichiuchi> I think there's even a switch in ICC where you can guarantee "no pointer anywhere will ever alias another"
<heat> it does not, but if speed itself does not use it, what does that make of it?
<kaichiuchi> it means that linux is a majorly huge complicated project and they have every right to be scared of using restrict
<zid> they don't need it
<zid> they have aliasing optimizations off
<heat> no, they have strict aliasing off
<kaichiuchi> I can only say that when it comes to code generation, it absolutely makes a difference
<heat> I'm fairly sure __restrict is still required
<zid> strict-aliasing is off because they write code that aliases pointers, which disables optimizations based on whether pointers alias or not
<zid> effectively they have everything marked anti-restrict
<heat> except pointers with the same type
<zid> "This shouldn't ever alias but I'm going to do it anyway lol"
<bslsk05> ​godbolt.org: Compiler Explorer
<kaichiuchi> yes
<kaichiuchi> that's mine
<kaichiuchi> oh no it isn't
<heat> with fno-strict-aliasing attached
xenos1984 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
pogchamp has quit [Ping timeout: 268 seconds]
gildasio has quit [Ping timeout: 255 seconds]
gildasio has joined #osdev
sonny has joined #osdev
<sonny> how do I know what architectures openfirmware supports?
<CompanionCube> depends on the implementation, doesn't it?
<heat> why do you care about openfirmware?
<sonny> I'm interested in bootloaders
<sonny> CompanionCube good point
<geist> hmm, wonder if openfirmware is developed anymore
<geist> it's been pretty dead since sun and apple stopped using it, AFAIK
<geist> though i suppose there may still be some sun sparc boxes being made?
sympt9 has joined #osdev
sympt has quit [Ping timeout: 260 seconds]
sympt9 is now known as sympt
<sonny> I thought sparc was dead, but who knows
<kazinsal> oracle stopped doing new sparc stuff but fujitsu still sells sparc boxes
sympt5 has joined #osdev
sympt has quit [Ping timeout: 268 seconds]
sympt5 is now known as sympt
<geist> wikipedia says that ibm power boxes have openfirmware
<geist> well, looks like there is a sun drop though https://github.com/openbios/openboot
<bslsk05> ​openbios/openboot - Sun's OpenBoot implementation of OpenFirmware (6 forks/25 stargazers)
<geist> hmm, looks like it has a bunch of binaries in it, probably solaris binaries
<geist> looks like some other ones in that same part of github
<heat> i can't get riscv interrupts and I don't know why
<heat> the timer works, the interrupts are enabled in sstatus, but the plic doesn't deliver
<heat> i've even patched qemu with trace calls, they seem to be getting the interrupts and forwarding them on
<zid> time to check every branch
<zid> be the american fuzzy lop you always dreamed you could be
<heat> nah, not american
riverdc has quit [Quit: quitting]
riverdc has joined #osdev
<heat> omfg
<heat> i found it
<heat> there's a separate interrupt enable register apart from sstatus
<heat> and there I had only enabled timer interrupts not external ones
<heat> shoot me
<sonny> bang
<geist> yeah there are really like 3 or 4 real interrupts on riscv, and timer is one of the special ones
<geist> all external ones are another vector
<heat> what screwed me over is that I forgot sie was a thing
<geist> yah and there's that whole scheme where the M mode can override it from S mode
<vai> unhandled interrupts and exceptions cause my kernel to crash
<vai> I am doing a 386 compatible kernel / OS
<vai> on real HW like 486 it runs like a charm
<geist> you should at least mask off everything you can't handle
<geist> but you should also install at least a handler per vector that does nothing if nothing else
<vai> geist: yeah got handlers iret
<vai> lol
<vai> probably fscks up because I am using legacy 8086 interrupt vectors
<vai> on pm
<vai> PIT instead of APIT
<vai> real HW today simply has so many interrupts exceptions
<heat> hrm?
<heat> [root@Onyx /] $ uname -a
<heat> Onyx Onyx onyx-rolling SMP Jan 2 2023 06:46:39-UBSAN riscv64
<geist> Woot
<geist> Actual SMP too?
heat has quit [Ping timeout: 248 seconds]
<kazinsal> me, less than 36 hours before my vacation ends: oh shit I forgot I said I was going to do some osdev stuff over the holidays
sonny has quit [Quit: Client closed]
<klys> want to talk about it
<geist> kazinsal: yeah i know exactly what you mean
<geist> it's that stupid head anxiety you get about not fully utilizing your break
<geist> which is a dumb way to ruin a break
<klys> hny
sonny has joined #osdev
sonny has left #osdev [#osdev]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 264 seconds]
divine has quit [Ping timeout: 255 seconds]
divine has joined #osdev
* CompanionCube always forgets that IBM uses openfirmware, and QEMU has OpenBIOS/SLOF for it, in addition to sun's openboot and mitch bradley's own implementation on github
sonny has joined #osdev
sonny has quit [Client Quit]
sonny has joined #osdev
<bslsk05> ​www.beningo.com: www.beningo.com | 520: Web server is returning an unknown error
<vai> GPIO?
<bslsk05> ​xilinx.github.io: Design Example 1: Using GPIOs, Timers, and Interrupts — Embedded Design Tutorials 2021.1 documentation
<kof123> general purpose i.e. that is available for you to use for any purpose?
<kof123> probably more an "embedded" thing
pogchamp has joined #osdev
sonny has left #osdev [#osdev]
<zid> pigchomper
<bslsk05> ​www.intel.com: Time-Aware GPIO (TGPIO) Samples
<kazinsal> gogchamp
<vai> examples are software timers
<vai> hardware accelerated GPIO timers not available on todays Intels
<vai> I think?
<vai> Always Turned On TImers
pogchamp has quit [Ping timeout: 260 seconds]
<vai> AMD has a "development mode" this might exist
<vai> hackety whackety with NMI ? hehe
epony has quit [Remote host closed the connection]
pogchamp has joined #osdev
GeDaMo has joined #osdev
bxh7 has joined #osdev
Burgundy has joined #osdev
elastic_dog has quit [Killed (zinc.libera.chat (Nickname regained by services))]
elastic_dog has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 264 seconds]
pogchamp has quit [Quit: byee]
joe9 has quit [Quit: leaving]
<kaichiuchi> hi
<sham1> Hi
<Ermine> \o/
elastic_dog has quit [Ping timeout: 252 seconds]
elastic_dog has joined #osdev
joe9 has joined #osdev
danilogondolfo has joined #osdev
arminweigl has quit [Remote host closed the connection]
arminweigl has joined #osdev
Clockface has quit [Ping timeout: 268 seconds]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
unimplemented has joined #osdev
elastic_dog is now known as Guest6924
Guest6924 has quit [Killed (zinc.libera.chat (Nickname regained by services))]
elastic_dog has joined #osdev
[itchyjunk] has joined #osdev
catern has quit [Remote host closed the connection]
<ddevault> want: wiki specifically focused on documenting hardware, target audience driver authors
xenos1984 has quit [Read error: Connection reset by peer]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
<ddevault> quality should aim for a spec but would ideally also provide some information in prose regarding common tasks you can do with that hardware or outlining possible incremental routes towards a working driver
<zid> I always like a good 'basic prinmciples of use/operation' paragraph
<zid> There's a lot of stuff that's hard to understand just given a weird hw api
* ddevault gently weeps from the bottom of a pile of intel HD graphics manuals
<ddevault> after 2-3 hours of reading those I still don't know how to make the GPU do literally anything
<Ermine> Seems like you need to be a pioneer in writing such an article
<ddevault> 'course
<ddevault> MSI is unclear to me
<ddevault> which IRQ is it going to actually fire?
epony has joined #osdev
<clever> ddevault: i think MSI is just configuring the device to write X to addr Y, you then need to set Y to the irq controller, and configure the irq controller so that it routes that to a given irq#
xenos1984 has joined #osdev
<clever> and what exactly it can route to, depends on the irq controller
<ddevault> I'm just going to do the classy thing and forget about it until I'm actually ready to do SMP
dude12312414 has joined #osdev
<Ermine> So what are you going to do then?
<ddevault> if I don't enable the I/O APIC then I can just use the PCI interrupt fields
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
danilogondolfo has quit [Remote host closed the connection]
gog has joined #osdev
bxh7 has quit [Read error: Connection reset by peer]
<jimbzy> Hi gog
<gog> hi
<jimbzy> Feeling any better?
<zid> chomped some pigs, feeling fine
<zid> (I didn't chomp a pig, I chomped a cow)
<kaichiuchi> hi
<jimbzy> Hey kaichiuchi!
<jimbzy> How's it going?
<zid> we're deprogramming him
unimplemented has quit [Read error: Connection reset by peer]
<jimbzy> zid, Good luck. The channel has been working on me for like 20 years and I still ain't right. :P
<zid> He had a crisis in confidence recently
<jimbzy> He was probably listening to people, and that's always a bad idea.
<jimbzy> "People like Coldplay and voted for the Nazis, you can't trust people." --Super Hans
<zid> https://aras-p.info/img/blog/2018/cpp_phases.jpg we've gotten him from #3 to #4
<jimbzy> Nice.
heat has joined #osdev
<heat> geist, nah, no SMP yet. I haven't dabbled with that
<zid> so your uname is just outright lies
<zid> Did you fix all the bugs in onyx yet?
<heat> i did take like 30m-1h to actually reach functioning userspace because linux has differing ABIs between architectures on struct stat
<heat> it's nuts
<heat> I don't see a valid reason for this, but it's there
<heat> zid, i have not fixed the bugs
<zid> good boy
<zid> Fixing bugs isn't very rockstar afterall
<zid> you need to add flashy new technologies
<Ermine> aren't abis meant to be different on different architectures?
<heat> why would they?
<mjg> syscall abi is loldifferent
<heat> if they're both 64-bit architecture why would the sizes of certain posix types change
<mjg> with numbers changed because who knows why
<heat> mjg, actually linux has sameish syscall numbers now for new architectures
<bslsk05> ​github.com: riscv64: Fix ABI issues with struct stat · heatd/musl@3223d18 · GitHub
<heat> this makes 0 sense to me
<gog> jimbzy: a little
<gog> i have an inhaler now
<mjg> heat: wow, that's progress
<heat> nlink_t and blksize_t go from longs to ints, and they shuffle some struct members around
<mjg> heat: see the i386 vs amd64 massacre
<Ermine> heat: I see. I guess you made it so members of struct stat on different arches are in the same order?
<heat> Ermine, similarly size and in the same order, yes
<heat> the problem is that my kernel just has a static bits/stat.h from musl x86_64 so it was using that, while riscv was using different types and a different struct stat layout
<heat> all in all, I should get my kernel uapi header affairs straightned out
<jimbzy> Good!
<bslsk05> ​elixir.bootlin.com: syscall.h.in - arch/aarch64/bits/syscall.h.in - Musl source code (v1.2.3) - Bootlin
<bslsk05> ​elixir.bootlin.com: syscall.h.in - arch/riscv64/bits/syscall.h.in - Musl source code (v1.2.3) - Bootlin
<heat> but now it makes little sense as io_setup is the first syscall
<heat> tradition go bye bye :((((((
<gog> jimbzy: i get to go back for an EKG tomorrow just to be sure
<jimbzy> Chest hurting?
<heat> but on a nicer note, non -at syscalls don't exist in those architectures
<heat> (you also don't have SYS_fork, SYS_vfork, as those are all implemented by clone, etc)
<gog> breathing difficulty and irregular heart rate
<gog> rhythm
<gog> doc is pretty convinced it's exercise-induced asthma
<gog> combined with the fact that i may have had RSV
<gog> basically i've had recurrent pulmonary illness and i get to this point every few years
<gog> my lungs have never really worked right
<zid> Have you considered buying new ones
<zid> I can get you a great deal
<zid> slightly worn, used to belong to a ballet dancer, she owed the mob some money for gambling debts
jafarlihi has joined #osdev
<jafarlihi> hey, I made a weaksauce security tool to detect hidden LKM: https://github.com/jafarlihi/modreveal It effectively detects all rootkits hosted on GitHub but I want to go step further and do memory scanning instead of iterating module_kset. Can someone give me some pointers as to how I can go about this? Can I realiably scan kernel memory space and detect LKMs?
<bslsk05> ​jafarlihi/modreveal - Utility to find hidden Linux kernel modules (1 forks/58 stargazers/GPL-3.0)
<jimbzy> That sucks. I had the flu a few weeks back and it took me a good 7-10 days to really start moving around.
<gog> zid: yeah how much
<gog> also what blood type was she
<zid> gog: Red.
<gog> hm
<gog> my blood is brown sorry
<heat> gog green blood
<zid> pooblood mcgee we call her
<gog> lmao
<bslsk05> ​'Futurama - You don't need lungs anymore right?' by Dont You Worry About Quotes (00:00:16)
<heat> i have achieved time travel
<gog> jimbzy: two weeks ago i caught my like 4th viral infection of the season
<gog> none of them have been covid
<gog> i had the flu, at least one or two colds, and possibly RSV but there's no way to know for sure which is which
<gog> not after the fact
<jimbzy> Yeah it's going around here, too.
<gog> half of my co-workers spend their whole day interacting with tourists so whenever i hang out with any of them i almost always catch something
<jimbzy> Flu, RSV and Strep.
<gog> oof
<zid> I have a tiny cold
<zid> just sinus pressure and a subsequent toothache
<jafarlihi> Can someone pls tell me if it's possible to detect LKM by purely scanning memory?
<zid> evreybody seemingly has something rn though
<jafarlihi> zid: I haven't been sick for 5 years now
<jafarlihi> (except psychosis)
<heat> vampires don't get sick very often
<jafarlihi> muhahahaha, tell me how to find lkms by scanning memory
<geist> lkms?
<jafarlihi> LKMs
<geist> what is a lkm?
<jafarlihi> Loadable kernel module, or linux kernel module
<geist> oh. probably not, not
<geist> no
<jafarlihi> With this simple tool you can find 99% of Linux rootkits: https://github.com/jafarlihi/modreveal
<jafarlihi> it works 60 percent of the time all the time
<geist> i mean i guess if you scanned all of phyiscaly memory you could reconstruct the kernel page table and then with that scan through the kernel aspace and try to find things that look like modules
<jafarlihi> can't I have some baseline idea of what kernel allocates normally and look for extra things?
* geist shrugs
<geist> you'd probably want to scan through kernel data structurse first, but you haven't realy specified how you're doing the scanning
<geist> physical memory? virtual? are you running as a root program? is this on a paused VM?
<gog> every kernel is slightly different is the thing, even the data structures are going to be different based on what the config is
<geist> do you know the kernel version?
<geist> yeah
<jafarlihi> Currently just iterate module_kset
<gog> so it's really hard to develop a one-size-fits-all heuristic
<kaichiuchi> heat: i concede something to you, the C++ facilities are mostly bullshit
<kaichiuchi> facilities being most of the STL
<heat> why
<jafarlihi> they are great for userspace
<heat> why do you deal in absolutes kaichiuchi
<heat> only a sith would do that
<kaichiuchi> well
<heat> we've got vampires and siths?!
<kaichiuchi> put it this way
<kaichiuchi> RAII, classes, user-defined suffixes, compile-time execution, etc are all useful bits of the language
<kaichiuchi> but there is a tendency to overengineer if you think in strict C++ terms
<kaichiuchi> jafarlihi: they're great for 99% of things except my 1% use case
<zid> 1% chances happen 9/10
<heat> "but there is a tendency to overengineer if you think in strict C++ terms" cheers, you got it
<heat> BUT it doesn't mean that it's horrificly bad and shit and poop
<kaichiuchi> weren't you shitting on std::accumulate and most of <algorithm>
<heat> (i would say it is bad, but "mostly bullshit" may be a bit too far)
<heat> sure I was
<heat> <algorithm> is not most of the c++ standardlibrary
<gog> implicit conversions!
<gog> i know implicit conversions are hated but i love them
terminalpusher has joined #osdev
<heat> I think that in a way, good chunks of the standard library are *that* close to greatness
<heat> but have a big flawed that just Fucks It Up
<heat> or have something that should've been compiler magic instead
<heat> s/flawed/flaw/
<kaichiuchi> i dunno. i think i'm just bummed that I just can't get my head around the more complicated shit of C++
<heat> *cough cough* arrays
<sham1> Which is funny, because std::array is one of the easier types to do
<kaichiuchi> std::array is fine
<kaichiuchi> i dunno I think I have OCD or something
<kaichiuchi> I just can't process how the fuck anyone writes large scale shit in a language where nobody is invalidated, yet no one is right
<heat> std::array is horrible
<kaichiuchi> i mean "fine" in the sense that it's easy to implement your own
<heat> it's a shitty templated wrapper around plain arrays because they couldn't get their shit together and add new syntax
<heat> it also *doesn't work*
<kaichiuchi> dunno what you mean it doesn't work
<heat> std::array<T> arr = {t1, t2, t3, t4}; does not compile
<kaichiuchi> oh
<j`ey> meaning it doesnt infer the size?
<heat> yep
<kaichiuchi> what?
<kaichiuchi> it absolutely does
<heat> it does not
<kaichiuchi> `static constexpr std::array t = {1, 2, 3, 4};` should turn into `std::array<int, 4>`
<sham1> I thought that works now with C++20
<kaichiuchi> yes
<kaichiuchi> that's what I'm saying
<sham1> Yeah
<heat> but I want the type
<kaichiuchi> oh
<kaichiuchi> then yes you are fucked
<heat> I obviously want the type
<heat> like a normal array
<kaichiuchi> no not obviously in C++ land
<j`ey> what do you mean you want the type?
<heat> std::array<unsigned long>
jafarlihi has quit [Quit: WeeChat 3.5]
<j`ey> array t = {UL(1)..} :p
<heat> this is also highly nuts. why is std::array not a native type? you could pull this off much easier, quicker, etc if a native type
<heat> it's why rust is goated and C++ sucks
<heat> if rust people see something they want, they also change the language instead of building shitty abstraction upon shitty abstraction in template metaprogramming land
<heat> have you seen the implementation of std::tuple? it's a recursive fucking template
<zid> C++ isn't allowed to change the languag
<zid> because it's all done via small ammendments via commitee
<heat> if I didn't know better I would say C++ is a small language fork that still wants to merge back with C
<kaichiuchi> i really don't get you sometimes
<kaichiuchi> and I say that as a friend
<kaichiuchi> you simultaneously seem to really have a penchant hate for C++, yet end up using it, but to the point where it's barely C++ it seems
<kaichiuchi> since you seem to not like almost anything that's come out of it
<kaichiuchi> and that's a pattern I seem to see a lot
<kaichiuchi> as in, a pattern from every project that says "performance in mind" end up not using most of C++ at all
<jimbzy> That's the best part about learning c++. Once you've worked with it for a bit you get to complain about how it's not <insert language here> ;)
<heat> you're not supposed to get me
<kaichiuchi> i can write C++, if I have the STL at my disposal
<kaichiuchi> but I can't do it without it
<kaichiuchi> and this means I don't know as much C++ as I thought I did
<jimbzy> C++ without the STL is "C with classes".
<heat> not quite
<jimbzy> Not 100% exact, but pretty close. ;)
<heat> you just need to build a bunch of abstractions yourself
<kaichiuchi> and then when you do, you see how horrifically complex the language is
<zid> if C++ were an animal it'd be a cryptid
<kaichiuchi> I've bitched about it about a dozen times by now, but I really don't think I should have to watch several hour long videos about making an std::function replacement that doesn't end up using dynamic memory allocation
<heat> type erasure isn't that crazy
<kaichiuchi> it must be if the videos on it are an hour long
<bslsk05> ​github.com: Onyx/culstring.h at master · heatd/Onyx · GitHub
terminalpusher has quit [Remote host closed the connection]
<heat> this is a more or less good ok completeish std::string implementation
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
zid has quit [Ping timeout: 260 seconds]
zid has joined #osdev
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
<sortie> heat, oh cool new MaxsiString.h dropped
<heat> i bet your maxsistring didn't have SSO
<sortie> I'm afraid to even ask what SSO Is
<kaichiuchi> small size optimization
<gog> single sign on
<sortie> gog, bingo, my mind went there
<sortie> heat, touch your security key...
<Ermine> single sign optimization
<sortie> heat, the true C++ file extension is of course .c++
<gog> c++++
<sortie> c++ c++.c++ -o c++
<heat> kaichiuchi, small string*
<kaichiuchi> oh
<Ermine> gog: you just invented c#
<gog> true
<sortie> c#, for music programming
<heat> c# for poor eyesight
<kaichiuchi> it is cold
<sortie> auto new_data = realloc(data_, (new_length + 1) * sizeof(_Ty));
<sortie> heat, OpenBSD rolls in its grave
<sortie> Cute overflow bugs
<sortie> :P
<heat> it's because I killed it
<Ermine> _Ty
<sortie> Ermine, you're welcome
<Ermine> XD
genpaku has quit [Remote host closed the connection]
<heat> Ermine, sometimes I try to be more or less standards-compliant
<heat> I fail because I can't write code that ugly
<Ermine> heat: are you about _Ty?
<heat> hm?
<heat> i dont get it
<Ermine> Well, what are you referring to?
genpaku has joined #osdev
<heat> identifiers used in C/C++ headers by their standard libraries need to be reserved
<heat> i.e #define data "bazinga" #include <string> must still work
<gog> bazinga
<gog> foo bar bazinga
<heat> Ermine, if you look at musl, you'll notice things in headers are all either standard-reserved names (str*, mem*, etc) or __name or _Name
<heat> it's also why in glibc, where they actually have parameter names for the function decls, names also all start with __
<heat> i.e extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
<heat> every identifier there is reserved for the standard OR implementation
<Ermine> heat: I don't think this can be really accomplished: user can break header by #define if they intend to do it. The best effort here is to use some special format for names which other do not normally use. Apparently __ and _ became a convention (which iirc leaked to python)
<heat> not true
<heat> __ and _Uppercase are reserved for the implementation by the standard
<heat> period
<heat> it's not a mere convention
<heat> you can break the header by #define __s "bazinga" but that's plainly your fault
<Ermine> So compiler might refuse your code if it contains such identifiers?
<heat> in theory
<heat> it's UB to use those identifiers
<Ermine> Well, I see.
<heat> this is why C++ standard library headers are horribly unreadable
<heat> _M_data, _M_length, etc
<heat> the exact same rules apply
<j`ey> headers--
<heat> "Note: in C++, identifiers with a double underscore anywhere are reserved everywhere;" TIL
<Ermine> heat: I guess $lang should avoid #include-like stuff if intends to avoid such complication?
<heat> yeah, and use proper namespacing, etc
<heat> as it stands, if you define a strermine() it's UB as that name is reserved
Gooberpatrol66 has quit [Quit: Leaving]
<Ermine> Ping
<heat> pong
bombuzal has quit [Ping timeout: 252 seconds]
DanielNechtan has joined #osdev
<epony> dung
<ddevault> git log | tail
<ddevault> wow my kernel came along quickly
<heat> ddevault, oh yeah did you need help on MSI?
<ddevault> later, will ask here when the time comes
<epony> are you using your kernel now?
<ddevault> define "using"
<epony> define intelligent
<ThinkT510> an irc client on helios would be cool but probably not there yet
<ddevault> do you mean am I sending these IRC messages from a system running my kernel
<ddevault> no, but someone did get a simple ethernet driver working and was sending pings a while ago
<ddevault> I don't put the cart before the horse
<ddevault> little demos on top of a half-assed kernel is not my game
<ddevault> consequently my kernel is almost done even if my userspace and drivers are very basic
<ddevault> of course, I did break my little demos rule by porting doom a while back
<ThinkT510> fun is permitted
<ddevault> taking the work seriously is fun for me :)
<ddevault> the results are more rewarding this way
<ddevault> little demos can be useful, though, for (1) validating the work they rely on and (2) peeking forward at future work to better understand the requirements for present work
<epony> I'd use my system from the first boot.
<ddevault> glhf
<epony> you're unable to design a usable system otherwise
<ddevault> I'm all for dogfooding
<ddevault> once I have a shell, editor, and toolchain, that seems reasoanble
<heat> and have it all stable*
<ddevault> and ideally a PDF reader <_<
joe9 has quit [Quit: leaving]
<epony> now you know why the plan9 funkopops have that table of 'bad" formats that abuse the developer resources and time for "features" and "complexity" of owning the format and applications around it
<epony> their typical reaction would be, what is PDF ;-)
<ddevault> the format all of the specs are written in, unfortunately
<ddevault> good answer though
<epony> it's not that bad as a "usage" and 'end result' but is not that good of a design and standardisation and "actual portability"
<epony> it's an end-station, a last-stop, a breakage-snapshot distillation-render of the document
<epony> like a web-page
<epony> obtaining the tech specifications (and source files) would be a comparable / better method
<epony> for the documents and the system they are documenting
<epony> just 10K pages of a PDF or that split in 10 documents of 1K pages each is.. not really the documentation, it's the preprint books
<epony> but otherwise, yep, you need it, most books are in PDF format
<epony> so.. you need processes, a file system, and portable applications that can be brought in, instead of recreated, or a converter for the application programming
<epony> here is a list of some system calls http://man.openbsd.org/pledge.2#DESCRIPTION
<bslsk05> ​man.openbsd.org: pledge(2) - OpenBSD manual pages
bgs has quit [Remote host closed the connection]
joe9 has joined #osdev
unimplemented has joined #osdev
unimplemented has quit [Read error: Connection reset by peer]
unimplemented has joined #osdev