<zid>
I even made it print the answers, rather than my usual shit of requiring you to scan a list or | sort -n or something
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
chartreuse has joined #osdev
gildasio1 has quit [Write error: Connection reset by peer]
gildasio1 has joined #osdev
joe9 has quit [Ping timeout: 256 seconds]
bgs has quit [Remote host closed the connection]
gorgonical has quit [Remote host closed the connection]
gog has joined #osdev
gog` has joined #osdev
gog` has quit [Read error: Connection reset by peer]
gog` has joined #osdev
gog` has quit [Client Quit]
<klange>
zid: heh, I think that's even cleaner than mine...
GeDaMo has joined #osdev
riverdc has quit [Quit: quitting]
GreaseMonkey has quit [Remote host closed the connection]
Archer has joined #osdev
rein-er has quit [Read error: Connection reset by peer]
riverdc_ has joined #osdev
heat has joined #osdev
<ddevault>
have edk2 debug build now
<ddevault>
[Security] 3rd party image[0] can be loaded after EndOfDxe
<ddevault>
ah, /can/ be loaded, this is probably a red herring
<j`ey>
it is
<Ermine>
ddevault: do you use edk2?
<ddevault>
trying to get UEFI working on aarch64, Ermine, and using edk2 to test it in qemu
<ddevault>
unfortunately the debug build does not offer any particularly useful information as to the real cause
<ddevault>
how'd you narrow it down to that one branch, j`ey?
nero has joined #osdev
<j`ey>
trial and error
<j`ey>
(aka liberal use of ASSERT() lol)
<ddevault>
aight
<ddevault>
haha
<ddevault>
so you modified the edk2 code
<j`ey>
yeah..
<ddevault>
whelp, guess I'll need to improve my setup
<ddevault>
but fair enough, that makes sense
<ddevault>
are you able to get gdb in here
<j`ey>
I already have EDK2 build setup
<ddevault>
maybe I should separate my .text and .data sections
<ddevault>
that's probably not it, though
<ddevault>
this is an intermediate loader, I'm going to load my real kernel with this EFI binary and then tear it down, so it's not too important that the address space is pristine
<j`ey>
I didnt try to debug why the read failed
<heat>
>are you able to get gdb in here
<heat>
it's hard-ish but theoretically possible and you have some helper scripts
<j`ey>
but (Size != ReadSize), and ReadSize = 1 and Size = 0
<ddevault>
I don't really know what this read is trying to accomplish
<ddevault>
make sure the data is in the image region? what?
<j`ey>
so maybe some other field is wrong, like image size (if thats evenn a field..)
<lkurusa>
I've installed and it's cool but I'll stick to doom-emacs, merges the best of vim and emacs IMO
<zid>
but is a terrible version of doom?
elastic_dog has quit [Ping timeout: 255 seconds]
elastic_dog has joined #osdev
<dzwdz>
is the osdev.org registration form busted
<dzwdz>
or, like, the entire account system? i swear i had an account, i had an entry in my password manager, but it says it doesn't exist
<zid>
osdev.org had a feature that at one point worked?
<dzwdz>
i'm pretty sure i managed to login like twice
<dzwdz>
it worked at two points
<zid>
fever dream
k0valski18891 has quit [Quit: Peace out !]
bgs has quit [Remote host closed the connection]
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
wootehfoot has joined #osdev
SGautam has joined #osdev
gog has quit [Read error: Connection reset by peer]
gog has joined #osdev
teroshan9 has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
xenos1984 has joined #osdev
joe9 has joined #osdev
arminweigl has quit [Ping timeout: 248 seconds]
arminweigl has joined #osdev
seer has quit [Quit: quit]
seer has joined #osdev
smach has quit [Ping timeout: 260 seconds]
nyah has quit [Quit: leaving]
aejsmith has quit [Remote host closed the connection]
aejsmith has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
dude12312414 has joined #osdev
smach has joined #osdev
gog has quit [Quit: byee]
SGautam has quit [Quit: Connection closed for inactivity]
<mrvn>
Here is the concept for the perfect editor: The file is a big doom level and each daemon carries a letter. You have to lead them to the right spot and kill them so they drop the letter and that's how you edit the file.
<klange>
/kickban mrvn
<mrvn>
Advanced mode: When you have "#include" or "import" a portal forms jumping to the respective file.
eck has quit [Quit: PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)]
eck has joined #osdev
rwxr-xr-x has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
gorgonical has joined #osdev
<rwxr-xr-x>
guess who's got covid!
<rwxr-xr-x>
living has just become painful
<gorgonical>
hopefully not you
<rwxr-xr-x>
me
<gorgonical>
are you feeling okay? hopefully it is a mild case?
<rwxr-xr-x>
My mom also got it, and I'm actually pretty okay
<rwxr-xr-x>
pretty high fever and aches everywhere, but my body kind of just ignores that and thinks I have a mild cold
<mrvn>
that reminds me, I should get vacinated
<rwxr-xr-x>
yeah that's the only reason why i'm not dying right now
<gorgonical>
I guess it's soup and tea for you huh
<Ermine>
get better soon!
<rwxr-xr-x>
Doctor said I can eat anything I want actually, but soup and tea is wise
<rwxr-xr-x>
thanks!
<gorgonical>
I usually take a lot of baths when achey like that
<rwxr-xr-x>
me to! helps a lot
<rwxr-xr-x>
juicing up on tylenol helps as well
<Ermine>
Lemon tea is also a good thing.
<rwxr-xr-x>
I haven't tried that
<rwxr-xr-x>
sounds good though
<gorgonical>
a lot of people like lemon in hot tea. I moved to a place that is very aggressive with lemon in tea
<gorgonical>
Horrid
<rwxr-xr-x>
haha
<gorgonical>
I grew up drinking iced tea in the south and I don't know many who put a lot of lemon in it, so moving somewhere and the tea being so lemony feels somehow wrong lol
GreaseMonkey has joined #osdev
<heat>
all my family (in my house) got covid but i didn't
<heat>
i'm like, literally immortal
<rwxr-xr-x>
I expect nothing less of you heat
<gorgonical>
I haven't gotten it but every time I get the shot I'm ill for days
<gorgonical>
I have really intense reactions to it. Paying it in a little at a time I guess
<rwxr-xr-x>
I feel a small amount worse than when I got the shot for the first time
<rwxr-xr-x>
My mom was like that to, if you have intense reactions to the shot, you're in for a bad time with the real thing
<heat>
the problem with immortality is that you lose the driving force behind actually doing things (kicking the bucket)
<heat>
so that's why I do jack shit
<gorgonical>
Probably. I rarely get sick and if I do I am usually very, very ill
<gorgonical>
It's either little sniffles or I am in bed for a week unable to eat. Thanks autoimmune diseases lol
<rwxr-xr-x>
Oh that's why heat??
<rwxr-xr-x>
ah shit
<rwxr-xr-x>
i hope you never get it gorgonical
<heat>
yup. i'm in no rush to do things, being a literal ethereal being
<rwxr-xr-x>
chill
<rwxr-xr-x>
how'd you become one?
<heat>
bananas
<rwxr-xr-x>
that's it??
<rwxr-xr-x>
damn
<gorgonical>
25 bananas a day
<rwxr-xr-x>
holy shit
Brnocrist has quit [Ping timeout: 260 seconds]
<gorgonical>
I knew a guy that became a vegan and actually ate only 20 bananas for like a month
<gorgonical>
I tried out of curiosity and couldn't even eat 15 the first day
<rwxr-xr-x>
wild
<heat>
dude was bananas
<heat>
hehehehehehehe
<gorgonical>
he tried to convince me it was a good idea -- "I only spend like $200/month on food"
<gorgonical>
but at what cost to your joy and happiness?
<rwxr-xr-x>
exactly
<heat>
i mean, i like bananas
<heat>
i think that maybe I could go with 10-15 a day, no need for 20
<rwxr-xr-x>
there's a drink that is basically the perfect meal, 3 of those a day, no time spent making meals, but it sucks all the joy of food
<gorgonical>
I did that for a week, too
<rwxr-xr-x>
yeah
<gorgonical>
I had 4 450-calorie shakes a day. The thing that surprised me the most was that my jaw hurt after a few days of not eating anything
<rwxr-xr-x>
really?
<rwxr-xr-x>
not from sucking out of a straw, or did you just drink it from a cup?
<gorgonical>
I drank it out of a blender bottle with those wide openings
<rwxr-xr-x>
yeah
<rwxr-xr-x>
weird
<mrvn>
I'm pretty sure bananas don't have everything you need.
<gorgonical>
he discovered that shortly
<gorgonical>
started eating an avocado a day, too
<mrvn>
I speend a bit more than $200/month on HelloFresh and get a varied diet.
<mrvn>
Have to cook it though, so some electricity on top of that.
Burgundy has quit [Ping timeout: 248 seconds]
<gorgonical>
a relevant question: I'm writing a device driver for an i2c bus. The bus is broadcast based, so all messages begin with the address of the target and only the target should reply. If I have /dev/i2c0, what should open() do, if anything?
<gorgonical>
One option is to just allow writes to send messages directly into the bus, but part of me wants to impose address restrictions
<heat>
what should open() do?
<gorgonical>
In the permissive case open() I would think gives you a file handle you can write() messages into. The driver handles wrapping them in the correct i2c formats, etc. Or maybe you do that
<gorgonical>
But anyway you'd be able to specify address and message yourself
<gorgonical>
The file is like a line onto the bus, without muxing or permissions checking
<heat>
i mean, you control the i2c0, you can restrict things yourself on write()
<gorgonical>
True
<mrvn>
If you have an address then it's not broadcasting. It's just a BUS, unlike the universal serial bus, which is point-to-point.
<heat>
and if you want the UNIX purist approach, make multiple devices and give each different permissions
<gorgonical>
mrvn: I mean yes it is a bus but the bus doesn't send messages based on address
<mrvn>
Why not follow standard unix sockets semantic. You can send_to or you can connect/bind
<gorgonical>
hmm
<mrvn>
gorgonical: that's the nature of a bus. everything goes onb the busd with an address.
<gorgonical>
That's probably a better fit. My first thought was ioctl to ask to open a specific address and you get a file handle bound to that address by the driver
<gorgonical>
The problem with i2c is that there's no address enumeration, so you either enumerate the entire address space with device files or do something else
<clever>
gorgonical: or you just use an ioctl to change the address, and only if you have permission can you change it
<gorgonical>
Technically you *can* try to discover devices but it isn't supported by the standard and i2c loudly warns that this might fuck up devices
<gorgonical>
clever: kind of reminiscent of a lock
<gorgonical>
then you check address -> change address -> open file -> write -> close as the loop
<heat>
i think that the only way to do this is by just having an i2c0 with uid 0 and write()
<heat>
given that you don't know what are valid addresses, and what they're doing
<gorgonical>
but then anyone with access to the bus can access all devices. is the assumption any bus accessors are trusted?
<clever>
gorgonical: the other way i see linux handling this, is that a kernel side driver deals with converting something (ioctl, or char device), into accesses for you, to just an approved addr
<clever>
and the i2c layer is entirely hidden from userland
<heat>
gorgonical, with uid=0 sure
<clever>
for example, on the rpi, the camera subsystem is made up of ~3 parts
<clever>
1: the raw CSI input peripheral
<clever>
2: the i2c master
<mrvn>
3; magic
<clever>
3: the camera sensor driver, that uses i2c to talk to the sensor, and the CSI driver to receive raw bayer frames
<clever>
so you then get a single /dev/video0 node that gives bayer frames, and ioctl's to change sensor params
<clever>
and the i2c is entirely hidden
<gorgonical>
yeah I actually am dealing with a camera. I know v4l2 is comprehensive but I'm trying not to re-import the entire infrastructure
<gorgonical>
clever: The ultimate idea is to have some camera driver that knows about the underlying pieces, too
<clever>
you should look into #libcamera
<clever>
on oftc
<clever>
libcamera is an open camera stack for many boards, including the rpi
<gorgonical>
is libcamera a replacement in the kernel for v4l2?
<clever>
it works ontop of v4l
<clever>
in the case of the rpi, there is a raw sensor v4l node, that gives you bayer frames and handles sensor parameters
<clever>
and there is an ISP v4l node, that does bayer->yuv, computes states, and does software whitebalance and automatic gain stuff
<clever>
libcamera is the glue beteween those, and the control loops to set all params based on stats the ISP gives
<clever>
computes stats*
<gorgonical>
the more I read about modern cameras the more frustrating it is
<gorgonical>
So, so much complexity
<clever>
the ISP would give an overall brightness to the frame, libcamera will then tell the ISP to adjust the brightness on the next frame (lower latency), but also tell the sensor to adjust the analog gain (higher latency)
<clever>
and a few frames later, the sensor reacts and the ISP brightness is adjusted
<clever>
modern usb webcams hide a lot of that from you
<clever>
one of mine, just spits out h264, fully encoded and tuned
<gorgonical>
maybe I am complaining uselessly, but I have been trying to avoid inheriting all these different API frameworks to make a camera work. I usually try to avoid overcomplexifying things when it's just me. Linux obviously has a need for generic mechanisms and frameworks, but I don't necessarily
<clever>
if you want your camera to work as a camera in something like chrome/discord, then your better off using v4l
<gorgonical>
So the problem with usb is that we don't think we can make it secure enough. The i2c/csi stuff is MMIO and so we can use the MMU to secure that stuff at the hardware level.
<gorgonical>
Our goal is something like face recognition on frames to draw bounding boxes
<gorgonical>
are the camera systems on the *bsds mature at all? Or have they mostly adopted the v4l stuff?
<clever>
havent looked into bsd at all
<gorgonical>
I usually use them as design alternatives at least for reference
<gorgonical>
freebsd lifts v4l, openbsd only supports usb video class stuff it seems
<heat>
openbsd
<gorgonical>
aww man, i was really hoping not to just absorb all the v4l stuff lol
<heat>
spongonical
<gorgonical>
I don't happen to have years to engineer a replacement
<klange>
clever: moo
<heat>
I change sysctl.h and it rebuilds the whole kernel or whatever
<heat>
this is normal.
MiningMarsh has quit [Ping timeout: 260 seconds]
mavhq has quit [Ping timeout: 268 seconds]
mavhq has joined #osdev
<gorgonical>
the linux driver for the camera I have has just arrays of bytes to write to the sensor
<gorgonical>
"lifted off the i2c interface" so acquired by sniffing
<gorgonical>
my god
<clever>
gorgonical: camera sensors often lack datasheets, and you have no idea how to configure them
<clever>
sometimes, the datasheet has no actual documentation, just a big array of bytes
<gorgonical>
clever: true, but at least sometimes the manufacturer makes a linux driver and vamps, leaving you with some embedded information. in this case maybe nobody knows
<clever>
yeah
<clever>
the rpi supported sensors have a number of params exposed
<clever>
and some of them have proper datasheets, which ive read over
<heat>
have you seen the realtek freebsd re(4) driver?
<clever>
at least one of them has a test mode, where the sensor is basically disabled, and it just generates test patterns
<mrvn>
klange: true. a format string with pointer and then int args would be UB
<mrvn>
heat: think of it as the compiler inlining the printf till only the 'puts(buf)' remains.
<klange>
Since the arguments are locals, the function call can not legally modify anything, and I think "constant format string with line feed and no actual format specifiers" is the only printf case that either gcc or clang optimize anyway
<mrvn>
klange: wrong. The %* stores the number of characters written so far in a pointed to thing. And you can have a local pointer there. The compiler has to be smart enough to see that you don't have %* or that you don't have any pointer.
<mrvn>
"local" has nothing to do with it
<klange>
Any extern symbol can be modified by a function call.
<klange>
Since the arguments are 1) not pointers, as we agree, and 2) locals, and thus not extern symbols, there is nothing printf can legally do to modify them.
<mrvn>
klange: ok, if you state those TWO then yes.
<klange>
yes I already stated the other one
<klange>
I'm not going to repeat myself when you can scroll up!
<mrvn>
On the other hand printf is a stdlib function and the compiler uses internal knowledge about what printf does internally to do error checking and optimnizing.
<mrvn>
printf("%s", str) -> puts(str) is not a legal optimization, unless you use knowledge about printf.
<klange>
in this case I think it's largely a matter of "they don't bother to optimize it _that_ far"
<mrvn>
And then printf("%d\n", literal) -> puts(string_of_literal) should be just as valid.
<mrvn>
and puts + puts + puts --> puts.
<mrvn>
klange: I wish they would go that far. It's just so satisfying having people benchmark code and discuss which code is faster and you just throw in a stupid simple solution and end up with puts()
<klange>
Is %d fully defined? Some printf specifiers can be locale-dependent.
<mrvn>
hmm, because of 1000nd separator and such?
<klange>
(actual question, I don't know if locale stuff is allowed to fuck with a bare %d)
<mrvn>
123456 vs. 123_456 vs. 123'456 vs. 123.456 vs. 123,456
<gorgonical>
there's not a legal separator in c is there?
<mrvn>
klange: it's the LC_NUMERIC category
<mrvn>
gorgonical: at least c++ has '
<gorgonical>
right
<klange>
If the spec allows for such things to happen with just %d, then whammo.
MiningMarsh has joined #osdev
<gorgonical>
i have often lamented not being able to write 0x1000'0000 or so
<klange>
Bye bye puts() optimization for that case, you have no clue what that numeric format is gonna turn into :)
<mrvn>
klange: I think you are right.
<mrvn>
There is LC_NUMERIC and if that isn't used for %d then where would it be used?
<mrvn>
You could do "printf("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 1,1,1,2,2,4,5,5,5,8);
<mrvn>
(on archs with 11 argument registers)
<heat>
d,i The int argument is converted to signed decimal in the style [−]dddd
<mrvn>
note: 'gcc -Os' creates just slightly more code than "clang -Ofast"
<heat>
I don't speak legalese but this seems to disallow locale shit here
<kaichiuchi>
i'm still pretty impressed that clang sorted it at compile time
<klange>
It's probably not really that it storted it, it just aggressively applied inlining of the static function definition on a constant input.
<kaichiuchi>
sure, yes
<kaichiuchi>
by the way, do you say your username the same way one would say "clang"
<kaichiuchi>
because that would somehow be funny in this case
<kaichiuchi>
heh
nanovad has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
<klange>
My name may be pronounced as one syllable, in which case, yes, it is the same as the compiler (note that I came first by nearly two decades, so really the compiler is pronounced like one of the options for my name), or the 'k' may be read separately as the letter, or either of those options can be combined with the correct German pronunciation of the trailing e.
<klange>
As long as you don't use a soft 'g', it's _probably_ fine.
<mrvn>
so no silent e?
<klange>
Silent e is implied by 'one syllable'. We lost the pronounced e many generations ago.
<heat>
/usr/bin/klange
<klange>
Pronunciation of the 'a' is also flexible.
<klange>
I have the IPA /keɪ.laŋə/ listed in my Discord profile.
<klange>
But the only thing I really care about is that you get the ŋ bit.
<Mutabah>
this is where I say that I've mentally been using a soft g all these years
<Mutabah>
(i.e. not prounounced like the sound/compiler)