<bslsk05>
www.cs.utexas.edu: E.W. Dijkstra Archive: Why numbering should start at zero (EWD 831)
<sakasama>
moon-child: That article is complete garbage.
<zid`>
sakasama: Then you're in better shape than if you tried to specify it by size
<zid`>
cus then the size would be 0
<moon-child>
sakasama: oh?
<sakasama>
moon-child: He chooses his conclusion in advance and then selects and discards possibilities in order to suit it, rather than objectively analysing them.
<heat>
dijkstra? more like stupijdkstra
<heat>
am i right fellas
<zid`>
My favourite part of djikstra is like, people trying to apply things he said about 70s programs to modern stuff
<zid`>
I've seen *lots* of people say "gotos are evil", because they have no concept of "interprocedural goto" because.. languages don't even allow them anymore
<heat>
oh yeah totally
<heat>
the gotos are evil shit is stupid
<zid`>
Don't tell them that cpus exclusively use goto :(
<moon-child>
goto <3
<sakasama>
zid` The point is that only an inclusive interval can represent the entire range without kludges for the final value. They have slightly simpler logic in hardware.
<zid`>
sakasama: hence size overflowing
<zid`>
and you're in a better position by using a limit instead
<zid`>
because.. a size would overflow
<moon-child>
sakasama: if you want to store the final address, then you need kludges; but not if you store the length
<moon-child>
sakasama: unless you want to have a single array which spans the _entire_ address space, which is clearly unreasonable
gog has quit [Ping timeout: 248 seconds]
<heat>
something i find stupid: gotos as loops
<zid`>
size is just limit+1 and gives you no extra info except shifting everything along by 1 and causing max-1 to be unrepresentable instead of 0
<sakasama>
moon-child: Yes, but an inclusive interval handles that fine too.
<heat>
like, erm, maybe you should've created another function entirely, if you need a goto as a loop
<zid`>
heat: goto as a loop is fairly mandatory in printf sadly
<heat>
there are so many examples of this in LE UNIKS
<zid`>
unless you want a shit load of 'bypass' flags
<heat>
yeah
<zid`>
to make the outer while(1) short-circuit
<zid`>
tristates are annoying, basically
<zid`>
where you have yes, no, and continue
<zid`>
goto loops stops you needing to bother with them sometimes
<sakasama>
moon-child: Perhaps more importantly, it doesn't require an adder: you can get away with just the subtraction for the comparison op.
FreeFull has quit []
<moon-child>
eh
<moon-child>
subtract is not more efficient than add (and indeed, x - y may be implemented as x + -y, though I don't know if modern chips do this)
<moon-child>
you can implement a compare circuit more efficiently than an add or subtract
<moon-child>
(because it is simply a reduce, not a scan)
<moon-child>
but I don't see why one of < and <= would be more efficient than the other then
<sakasama>
moon-child: If you store size, then testing against the end is X < start + size, or some transmutation involving the extra addition in some form, whereas with an interval you can just do X <= limit.
<moon-child>
heat's question was why we store size-1 rather than size
<zid`>
cus it's a limit not a size, was the answer :P
<zid`>
and limits have some obscure very minor technical advantanges, so why not
<zid`>
when limitof operator for C
<heat>
thank you
<heat>
also
<heat>
nerdz lmao
* sakasama
snorts a mysterious powder.
<zid`>
(it's ground mummies)
goliath has quit [Quit: SIGSEGV]
linear_cannon has quit [Remote host closed the connection]
linear_cannon has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
bnchs has joined #osdev
<mrvn>
moon-child: all modern CPUs use two's-complement integers and those you have x - y = x + ~y + 1, which they do by setting the carry-in signal on the addition.
<mrvn>
zid`: with a limit how do you represent a size of 0?
<moon-child>
yes, that is what I was talking about
<mrvn>
sakasama: the size of an object is basically limited to half the representable value because ptrdiff_t needs 1 bit for signedness.
<mrvn>
and the address space on 64bit cpus is way smaller still. So you really aren't going to overflow a size.
<mrvn>
moon-child: Even one's-complement / sign+magnitude math would just have an adder with an inverter on the input. There really is no call to have an adder and a subtractor. The one extra gate isn't going to slow down additions.
<bslsk05>
www.kernel.org: 1. The Linux/x86 Boot Protocol — The Linux Kernel documentation
Arthuria has joined #osdev
bnchs has quit [Remote host closed the connection]
<inegatives>
Is there such thing as UEFI bootloader? Or is OS just an UEFI application that the firmware loads?
<nortti>
you can have a bootloader be an UEFI application. that's what I would think is being referred to when someone says "UEFI bootloader" at least
<nortti>
but it is also possible to have UEFI load the kernel directly
<inegatives>
nortti: What's the point of having UEFI bootloader if firmware can directly set you up with long mode and identity paging?
<nortti>
you might want to support both UEFI and legacy boot, you might want to present user with a bootloader menu, you might need something else loaded alongside your program
<nortti>
*kernel
<inegatives>
So I guess the best way for an hobbyist desiring modern kernel is to make it an UEFI application and have firmware load it to long mode? What's the point of using Limine for example, just so that it can set GDT and higher half?
<gog>
i have a UEFI loader because i need some things to be set up in a specific way before entering my kernel
<inegatives>
gog: Like what? Also could that be done in the kernel instead?
<gog>
memory mapping
<gog>
specifically
inegatives has quit [Read error: Connection reset by peer]
<gog>
it could be done in the kernel but it's dependent on the boot environment so i'm trying to keep that loosely-coupled
<gog>
oh
linear_cannon has quit [Remote host closed the connection]
<Ermine>
gog: may I pet you
Arthuria has quit [Remote host closed the connection]
<gog>
yes
* Ermine
pets gog
* gog
prrr
<heat>
just had a great nap
<heat>
this is gog's fault
<gog>
yw
Arthuria has joined #osdev
<heat>
thank you vincent van gog
<heat>
you're like my good sleep fairy
<heat>
keep on at it
sinvet has joined #osdev
linear_cannon has joined #osdev
elastic_dog is now known as Guest9292
elastic_dog has joined #osdev
dude12312414 has joined #osdev
inegatives has joined #osdev
<inegatives>
Is it possible to connect to WiFi network in UEFI app, are drivers provided?
<gog>
that's gonna be vendor-specific
<gog>
if the vendor provides a driver for the wifi device, then you can use Simple Network Protocol to implement aribitrary protocols
<gog>
if the vendor doesn't provide a driver you'll have to be able to install one somehow which is possible
<gog>
neither are something i've played with
inegatives has quit [Read error: Connection reset by peer]
<gog>
EFI_SUPPLICA--
<gog>
ok
<geist>
crippled? my guess is somone on discord or whatnot is getting on their case abou tit
<gog>
idk how that could matter, long mode is fine
<Ermine>
Wifi.. in uefi...
<gog>
Ermine: it does work
<gog>
there's a supplicant protocol
* Ermine
pukes
<gog>
you can do WPA2 PSK and Enterprise from an EFI application
<gog>
(provided the chipset drivers are present)
<gog>
ofc any vendor can choose not to include that
<gog>
and trying to open that protocol on a handle will just return EFI_UNSUPPORTED
<gog>
so YMMV
<gog>
also early platform yuck can stay in the bootloader
<gog>
kernel should know as little as possible about how it got booted
<gog>
not relevant once you're up and running in the mode you want
<gog>
my osdev hot take is that operating system development is unnecessary so you should do whatever you want
<gog>
there's no limit, cmon!
gildasio has quit [Ping timeout: 255 seconds]
<zid`>
my osdev hot take is that osdev is dead
<zid`>
run dedicated ring0 programs all in a different hypervisor
<zid`>
one per core
<gog>
yes
<gog>
that's a good idea actually
gildasio has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<heat>
gog, yes that's true
<heat>
although I suspect that in practice it's not true and almost no one does wifi
<gog>
most likely
<gog>
i wouldn't
<heat>
or that some do and the stack is incredibly broken
<gog>
wifi network in a mode where everything is accessible?
<gog>
no thanks
<gog>
seems like a recipe for haxx
<heat>
wait until you figure out your firmware has openssl
<bslsk05>
github.com: edk2/NetworkPkg/WifiConnectionManagerDxe at master · tianocore/edk2 · GitHub
<gog>
how old of an openssl
<heat>
depends on your firmware
<heat>
right now they're stuck in 1.1 and are trying to update to 3
<gog>
i recently updated my firmware in contravention of my "never update" rule because there were some severe CVEs associated with the one i had
<gog>
and i figure since i use my computer for work i should be responsible-ish
<heat>
although they did upgrade 1.1 LTS releases BUT who the fuck knows what your firmware vendor does
<heat>
probably nothing
<gog>
most likely nothing
<heat>
also I had to chastise Intel into trying to upgrade to openssl 3 since 1.1 is going EOL and the original plan is "MAKE BOTH OPTIONS AVAILABLE BECAUSE FLASH SPACE IS LIMITED OR WHATEVER"
<heat>
being agressive most definitely worked, I said something like "yeah good job intel, maybe in a few months you get One More UEFI CVE or secure boot bypass"