<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>
<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
<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>
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
<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
<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
<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
<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.
<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
<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