<kaichiuchi>
do you *need* to use heapsort on a heap?
<kaichiuchi>
for example, I have an array which is guaranteed to be <=10 elements (nodes), insertion sort might be more efficient
<kof123>
well, there is also nullsoft beep
<kof123>
if you require additional thinking sounds
<geist>
zid: oh yeah i saw that a while back. it's a little too regular for me, but i like it
<zid>
for 10 elements you can just bubblesort it
<geist>
i assume the clicker is just looking at accesses and clicking
<zid>
you won't notice the performance difference unless you're doing it 20k times a second
<geist>
i guess to be more accurate it'd need to parse the commands and click differently based on where it thinks it is seeking from
<zid>
this is why modern software is slow I decided a while back, people spooling up fancy algs to deal with 10 things, just in case there's 10000 things
<geist>
like a harder click based on how far it had to 'seek'
<zid>
I think it just plays the click when the light goes on
<geist>
right
<zid>
it's replacing the light, not reading the commands
<moon-child>
kaichiuchi: if you're doing insertion sort then it's not a heap, is it?
<moon-child>
(also: a sorting network might be preferable, at such a size. Or do the quadratic compare + a sum scan, though you have to deal with duplicates then
<moon-child>
zid: really. You think that modern software is slow because people spool up fancy algorithms to deal with 10 things just in case there's 10000 things?
<moon-child>
I mean leaving aside the fact that 10000 is not a lot of things...
<zid>
moon-child: it blows up the code size and the constant n factor a lot
immibis_ has quit [Remote host closed the connection]
immibis_ has joined #osdev
<zid>
note I am not talking about "omg why is chrome using 4GB of ram!!" I am talking like, why is a linux kernel 100% bigger than a 2.6 kernel despite not doing anything extra, etc
<zid>
I wouldn't wanna run 5.11 on a 386 no matter how much I pared the .config down
<zid>
it's going to be slow and sucky, just because certain expectations are no longer valid
<zid>
what a reasonable amount of a 'thing' is, typically
<moon-child>
I'm pretty sure a linux kernel is 99% drivers
<zid>
only if you go around [*]ing shit
<moon-child>
and linux gets a lot of dev by intel, google, etc., who care a lot about performance on real workloads
<zid>
exactly, and I pay for that in code size
<moon-child>
why tf you care about code size
<moon-child>
disc space is cheap
<zid>
cache is a thing?
<zid>
tlb faults are a thing?
<zid>
Random example: I don't need a binary tree to find some cpu related data, but someone with 16384 cores might, what I need is a [12] and a linear scan.
<zid>
I pay for that code existing so that the guy with 16384 cores doesn't have to eat a linear scan
<moon-child>
someone with 16384 cores is going to bottom out with a linear search if they don't want to suck, and 12 is probably small enough to fit in a linear bucket
<moon-child>
do you find linux to be slow? I don't
<zid>
no because my hw kept up with the changes
<zid>
security is another one of the big enslowernators, but you can turn some of that off at least :D
<moon-child>
so your conclusions are based on ... nothing
<zid>
wat
<zid>
You've literally never heard anybody use retro versions of software on older hw, because modern versions are unsuitable?
<moon-child>
I'm saying the claim that modern software is slow because the people optimising it don't understand constant factors is stupid
<zid>
>note I am not talking about "omg why is chrome using 4GB of ram!!"
<moon-child>
I will aver that there's not so much interest in optimising for consumer platforms as for, say, servers (you give the example of codesize for a tree
<moon-child>
vs linear search)
<zid>
It should be fairly obvious I don't want my current 6GB bzImage, which contains only an fs driver, on a 386 with 16MB of ram
<zid>
6MB*
<moon-child>
it's a good thing we don't really use 386s with 16mb of ram anymore
<zid>
yes, I am not suggesting one should, wtf
<moon-child>
what's your point then
<zid>
what point?
<\Test_User>
"add compile-time switch for whether it should be massive server needing tree thing or typical desktop user where that would be overkill and slow everything"
<zid>
You're the one interrogating me for one, I wasn't trying to convince you of aything
<zid>
\Test_User: can do yea, and some thing do have that
<zid>
but it isn't always feasible
<\Test_User>
true
<zid>
and honestly you don't want 30000 micro-switches
<zid>
build testing issues, for one
<\Test_User>
yeah, one general one should be "good enough" for most
<zid>
nod, and what "suitable for today" is, shifts
<zid>
like, you don't really need complex interrupt balancing code on a 386, but nobody's gunna *not* want that these days
<zid>
or just an extra pointer here and there so that something can be realloc'd if needed
<geist>
huh that's odd. rust seems to like to load a pointer to a library function in a register and then call it indirectly
<geist>
even for just like hello world. it loads a pointer to std..._print and then calls it multiple times from the same register
<zid>
rather than []'ing the place it loaded to the reg?
<geist>
or just call _print
<zid>
I didn't know list was actually kinda.. dynamic linkable like that
<zid>
I figured it'd all be resolved at runtime using got style stuff
<zid>
I don't khow much about rust, is it possibly because of being able to override functions and them all having to definitely refer to the same _print? Though I guess you'd see locking code or something for that? idk
<\Test_User>
> it'd all be resolved at runtime
<\Test_User>
there's another thing killing performance :P
<zid>
yea, PIC on a 386 is great fun
<zid>
as another
<zid>
no rip-rel
<geist>
yeah i mean for calling a truly remote thing dynamically linked you have to do something to resolve it for PIC or whatnot
<geist>
but this is for even a function just later in the binary
<epony>
and that's precisely where Pascal and C++ win
<epony>
due to their stronger type systems (including checking)
<epony>
but you would not know that, since both precede your time too ;-)
<heat>
that's not very bespoke
<heat>
less spaces, less characters
<zid>
you cheater
<zid>
I told you specifically not to cheat
<heat>
dont worry I'm probably not using a list anyway
<heat>
maybe I'll use a budget ass stack with arrays
<zid>
Is it really christmas if I haven't written for(at = c; *at; at = &((*at)->next));? No, therefore by induction, given that I just did, it must be christmas. QED.
<zid>
Merry Christmas.
* mjg
burps
<zid>
a ring buffer would be better
<mjg>
instead of working on aoc you could ocntribute to openbsd
<epony>
you're 1 month and 2 days early
<epony>
maybe you live in the gloomy light territories
<bslsk05>
twitter: <RealCatholicGod> @ChrisDeityUK "Love footy, hate women. 'Nuff said."
<epony>
the half-heights have spoken
<zid>
There we go, you use that to make fun of that guy
<epony>
2 days early is still today's early
<epony>
whacky Month-day
<epony>
have the Czech the new grain harvest
<epony>
piss on your beer ban
heat has quit [Remote host closed the connection]
<epony>
s/piss/peace/
heat has joined #osdev
<heat>
fm23's performance was acting up, had to reboot
<heat>
the good ol reboot
vin1 has quit [Quit: WeeChat 2.8]
<zid>
heat: the correct response was merry christmas
<heat>
it's not even christmas rn
<heat>
at best, it's hanukkah
<epony>
matata
<zid>
I QED'd
<zid>
were you not paying attention
<heat>
I EOF'd, then EOD'd, then EOL'd
<geist>
ESC
<heat>
in any case i'm AFK
<AmyMalik>
Then I made all my programs proprietary to prevent AI hoovering it up.
<zid>
I wanna be part of the class action lawsuit
<heat>
that's why my aoc solutions are GPLv2
<heat>
I don't want big capital to steal my epic codez
<AmyMalik>
GPL2 is easily stealable by capital
<heat>
we'll see comrade
<AmyMalik>
try CNPL or gating behind a clickwrap page
<AmyMalik>
women's football started during world war 2 because all the men folk were in the trenches. honour women's contribution to gladiatorial entertainment on the home front - advocate for the desegregation of sports.
<zid>
I don't condone physical activity
<moon-child>
gender segregation is stupid, but desegregating in honour of historical events is equally stupid
<zid>
plus the event is that society was segretated
<bslsk05>
en.wikipedia.org: High-level language computer architecture - Wikipedia
gxt has joined #osdev
bauen1 has quit [Ping timeout: 260 seconds]
Burgundy has joined #osdev
gog has quit [Quit: byee]
<AmyMalik>
Wetherspoons?
<kazinsal>
basilisk barfs out another seemingly random wikipedia article title and I realize it's not over yet
<heat>
it's never over
<kazinsal>
it merely ceases for a brief period
<kazinsal>
I feel like I should do something useful with my day off tomorrow like learn lisp or something
<heat>
i thought you said something useful
<kazinsal>
tbh I've never learned anything about functional programming so it seems like I should at some point
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
<LittleFox>
functional programming definitely has some fun things
<LittleFox>
even when you just sprinkle some fp concepts into procedural/object-oriented languages
<epony>
unfortunately you can't use that fun without hardware that makes use of it
<LittleFox>
like perls map/grep or typescripts map/filter/flatMap and co
<LittleFox>
hm? you can translate fp to machine code for normal machines?
<epony>
otherwise you're complicating your tooling singnificanly and discard all benefits
<epony>
yep
bauen1 has joined #osdev
<LittleFox>
and haskell is fp, has quite the benefits, not overly-complicated tooling and still works on normal processors
<LittleFox>
has its own ABI tho, making it harder to integrate with non-haskell things
<epony>
you typically use it for mathematical modelling and formal proof and data processing optimisations (discarding steps before doing the actual data manipulation)
<LittleFox>
(take all I say re haskell with lots of salt - I didn't dive deep into how the code is executed)
<epony>
using it in place of procedural programming is suboptimal (and using it to generate procedural programs that modify themselves is unreliable)
<epony>
data processing (big data) companies need such operator-programmers
<epony>
that's why it's mass marketed and spamming the internet, which pointless "hype" and "need"
<vai>
hi
<epony>
other than that, it's research and prototyping (modelling) instrumentation
<LittleFox>
fp is quite useful in many places
<epony>
and the implementation does not use it
<epony>
the shit it is
<LittleFox>
whatever
heat_ is now known as heat
Burgundy has quit [Ping timeout: 265 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
<AmyMalik>
the main usage of FP is when using it in procedurals
<AmyMalik>
which would seem an oxymoron, but
<heat>
i'm a big fan of functional programming and arm64
SGautam has quit [Quit: Connection closed for inactivity]
<moon-child>
everything works on normal processors (or else not at all); see the church-turing hypothesis
<moon-child>
haskell is weird due to laziness
<AmyMalik>
by main usage I mean the main time it's a good thing
<epony>
heat, yes.. it's visible from a distance, that's why I was bugging you with these details..
<epony>
it's a very small machine, with a very big appetite
gog has joined #osdev
nyah has joined #osdev
smach has joined #osdev
<zid>
Is it 10pm yet
<epony>
at the ±12th time zone offset, you're in the past
<epony>
no civilisation there, just cannibals
gxt has quit [Remote host closed the connection]
<heat>
zid, yes
<heat>
don't you see the 10 on your clock
bauen1 has quit [Ping timeout: 248 seconds]
<zid>
why isn't my book chapter out then
<zid>
huh, youtube recommended me video, it's shot in my city
<zid>
don't see that.. ever
gxt has joined #osdev
<zid>
The last time I saw my city on video it was because of a car chase
chartreuse has quit [Ping timeout: 256 seconds]
gxt has quit [Remote host closed the connection]
GeDaMo has joined #osdev
gxt has joined #osdev
epony has quit [Ping timeout: 268 seconds]
Burgundy has joined #osdev
<AmyMalik>
heat, it's 11am
epony has joined #osdev
Burgundy has quit [Ping timeout: 260 seconds]
bauen1 has joined #osdev
<zid>
heat: can you increase my production of low density structures for me real quick?
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<zid>
so fun it breaks your irc client
<AmyMalik>
:O
<heat>
router
<heat>
irc client decent, router bad and very buggy
<zid>
portugese language option mode
<zid>
wouldn't want them getting any ideas
<heat>
did I ever tell you folks about this bug it has where it resets the ipv6 flow label randomly, so load balancers that use it just route your packets mid connection to another server and you get a connection reset
<zid>
are you too poor to have an ipv4 address
<zid>
my german friend is
<zid>
he only has an ipv6, and every customer is behind a single ipv4 mega-nat
<heat>
it's brilliant
heat has quit [Remote host closed the connection]
heat has joined #osdev
<heat>
holy shit this fucking router
<heat>
no, I have v6 and v4
<heat>
v4 over NAT ofc
<zid>
so no v4 then
<zid>
rip
<heat>
who the fuck even has a non-NAT v4?
<heat>
you have to pay a premium for that shit
<zid>
western democracies that weren't part of the axis
<zid>
"oh"
<heat>
I'll let you know that portugal wasn't part of the axis
<zid>
portugal is part of spain
<zid>
spain was facscist at the time
<heat>
they were just a tiny bit fascist and authoritarian in that time
<zid>
faifsicsicist
<heat>
spain wasn't in the axis either
<zid>
ergo porto was axis
<heat>
listen cuckface you call portugal porto and i'll piss all over your fish and chips
<zid>
portugal is too long and too hard to type, what about platypusland
<heat>
sgtm
<heat>
but srsly wtf a non-NAT v4 address?
<zid>
yea? nobody in the UK is behind nat
<zid>
"United Kingdom of Great Britain and Northern Ireland has a total of 123,897,600 IP address assigned. "
<zid>
one each is ez pz.
<heat>
wtf
<zid>
"Portugal has a total of 6,797,312 IP address assigned."
<heat>
yall have issues
<heat>
everyone in portugal is behind a nat
<heat>
always has been
<zid>
First world nation baby
<zid>
And that we invented half the tech stack for the internet anyway
<heat>
where always = like 11 years ago
<zid>
and the web
<heat>
see, i wish i was english so i could flaunt this BRILLIANT BRIISH EXCELLENCE LADS I VOTE TORY BREXIT
<zid>
no, we're undermensch or whatever the german is
<heat>
unter
<zid>
we invent things to try escape the yoke of the upper classes
qubasa has joined #osdev
<zid>
to set ourselves free from this dreary rock if only in our imagination
qubasa has quit [Remote host closed the connection]
heat has quit [Remote host closed the connection]
heat has joined #osdev
<heat>
i swear to fugging god
<heat>
this fucking shitty piece of shit router
<mjg>
probably running linukkZ
<zid>
install openbsd on it
<zid>
the good bsd
<heat>
if it were running freebsd i could've exploited the setsockopt bug and get root already
<zid>
jtag bro
<heat>
or the ping(8) bug and also get root already
<heat>
then I would install ONYX BABY WOOOOOOOOOOOOOOOOOOOOOOOOOo
<mjg>
and if it were running onyx you would not have interent
<heat>
not true
<mjg>
do you do routing?
<heat>
it Just Works(tm)
<zid>
if you were running boros you could accept pings!
<mjg>
well you need to do nat i presume
<mjg>
you got that dwag
<heat>
it can route packets
<heat>
as in, route src -> dst
<heat>
it doesn't try to route external ones though
<mjg>
but you don't do that
<mjg>
s/that/nat
<heat>
i do not
<mjg>
so you would not have interwebz
<heat>
i assume I would need a solid iptables implementation or something
<mjg>
ONYX SUCKSOR
<mjg>
there was an incredibly bad idea how to implement nat
<mjg>
so of course bsd went with it, see natd
<heat>
ironic coming from a Free "ping(8) stack overflow" BSD developer
<heat>
this sort of thing would not happen in OpenBSD
<mjg>
funny you mention that
<heat>
partly because theo would have deprecated ping(8) anyway
<mjg>
theo added a lolo sycall once which was accessing user memory directly
<heat>
rightfully so
<heat>
EFAULT is for losers, so is SMAP
<zid>
that's what BIG PROCESS LOCKs are for
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
<heat>
also omg please don't use edk2 for bootloader development
<gog>
don't use gnu-efi either
<gog>
don't use EFI at all
<heat>
reject computer, become a doctor or something
<gog>
my boss and i had a rough day and he was talking about quitting work and growing potatoes in his yard
<Ermine>
Why? Doesn't everything else depend on edk?
<gog>
i think he's on to something
<heat>
Ermine, what's "everything else"
<Ermine>
heat: I was considering becoming a surgeon.
<Ermine>
heat: gnu-efi and posix-efi.
<gog>
gnu-efi doesn't depend on edk
<heat>
no
xenos1984 has joined #osdev
<Ermine>
Well...
<gog>
it's forked from an earlier efi lib
<heat>
ok so, some context
<heat>
efi is basically mostly implementeable using your own C headers and looking at the spec
<heat>
the only problem is getting a PE out of it
<Ermine>
gog: re not using efi: I don't want to stick with grub
<gog>
clang
<Ermine>
Or mingw32-gcc.
<heat>
you can have a toolchain which spits out PE, and that's nice, but usually not very available for gcc people
<gog>
which is why gnu-efi
<heat>
objcopy an ELF works until you look at the relocations. gnu-efi deals with the relocations for you (it looks at the ELF ones in its "stub")
<heat>
so then you have EDK2, which deals with every toolchain on earth and can translate anything to PE (in the big hairy horrible looking GenFw tool)
<heat>
in any case if you're okay with requiring a toolchain that can make PE, you're fine
<heat>
from experience clang can do it ez
<heat>
gnu-efi is also fine but you depend on something external
<bslsk05>
twitter: <Foone> but here's the thing: LOADLIN works because DOS doesn't do memory protection (since it's in a true 16-bit mode), and therefore it can completely overwrite DOS with linux.   But Windows 95 doesn't let it do that.
<zid>
when you say lilo for life
<zid>
that means life, not just christmas
SGautam has quit [Quit: Connection closed for inactivity]
AmyMalik is now known as Ellenor
meisaka has quit [Ping timeout: 264 seconds]
meisaka has joined #osdev
FreeFull has joined #osdev
bgs has quit [Remote host closed the connection]
<kaichiuchi>
hi
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
* geist
waves
* GeDaMo
particles
<kaichiuchi>
in my quest for simplicity, I think I ruined a part of my design (unrelated to osdev)
<kaichiuchi>
.
<kaichiuchi>
think I should've just went with a heap...
<kaichiuchi>
ugh
gorgonical has joined #osdev
smach has quit []
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
wootehfoot has joined #osdev
smach has joined #osdev
CloneNumber8790 has quit [Quit: Leaving]
carbonfiber has joined #osdev
bgs has joined #osdev
bgs has quit [Remote host closed the connection]
<mrvn>
Ermine: and yet there is winload or something that does exactly that.
<gorgonical>
I cannot confirm that the espresso has made me more productive
<gorgonical>
unfortunately
<mrvn>
I believe it's a wash. What you gain you loose when it wears off
<mrvn>
and then you have to drink more just to keep at the same level
<gorgonical>
The solution is to make a faustian deal where you drink a shitload while working and become a catatonic mess when you aren't
heat_ has joined #osdev
<gorgonical>
what would be really useful is a device where I can put an sd-card in and it has cables that allow me to simultaneously connect that sd card to both a board and also the sdcard reader on my computer
heat has quit [Ping timeout: 256 seconds]
<gorgonical>
oh man they exist
nvmd has quit [Quit: WeeChat 3.7.1]
<mrvn>
and do what? record the commands and replies?
<gorgonical>
I haven't set up something like pxe boot, so when I want to update my kernel I have to move the sdcard from the board to my computer, copy the new kernel, and move it back again
<gorgonical>
The constant handling of the sdcard makes me worry about the contact longevity
<gorgonical>
I want a sort of kvm switch for the card that will allow me to not move the card itself
<mrvn>
That's why I wrote raspbootin for the RPi1. Loads the kernel over serial.
<gorgonical>
It's something I should think about
<mrvn>
I recommend setting up pxe. It's good experience and only takes a few minutes and you can use it over and over.
<gorgonical>
hmm
<gorgonical>
Does it require a lot of modifying the bootchain? Or can I basically just drop into pxe, dump the kernel, and it'll go?
<gorgonical>
The u-boot already has pxe in it, so I could start into it
<mrvn>
You need a tftp server and have to drop your kernel into the right dir and then tell the board the path to the kernel
<gorgonical>
the path can be put into the u-boot commands I imagine
<mrvn>
(or look what the default path it and put your kernel there)
<mrvn>
s/it/is/
<mrvn>
you might also need a dhcp server and have to configure it for pxe
<mrvn>
with u-boot you can just tell it the ip:path for the kernel for tftp. no pxe needed at all.
<gorgonical>
oh that would be great
<gorgonical>
I think I'm gonna set that up right now actually
<bslsk05>
community.arm.com: TFTP (remote/network kernel) using U-Boot - Wiki - Open Source Software and Platforms - Arm Community
lkurusa has joined #osdev
gorgonical has quit [Remote host closed the connection]
gorgonical has joined #osdev
<gorgonical>
cable came unplugged while moving stuff
heat has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
wootehfoot has quit [Read error: Connection reset by peer]
chartreuse has joined #osdev
mykernel has joined #osdev
<lkurusa>
I asked ChatGPT this prompt: `Write a simple bootloader for real mode x86 that will output "Hello from ChatGPT" to the screen.` and it gave me this code: https://dpaste.com/9JWF2CSBH
<bslsk05>
dpaste.com <no title>
<gorgonical>
mrvn: you were right, that was easy
<lkurusa>
It's quite funny
<lkurusa>
What's scary is that I told it: `You didn't define `message`.`
<lkurusa>
and it said
<lkurusa>
You are correct, I forgot to define the message variable that is used by the print_string subroutine in the bootloader code. To fix this, the message variable should be defined before the print_string subroutine, as shown below:
<lkurusa>
Which is also broken, we still have our jobs.
<sortie>
Still creepy
<lkurusa>
Yes
<sortie>
Although I wonder where it just copied that assembly from
<lkurusa>
I told it "But it crashes!"
<lkurusa>
and then it totally crashed
<lkurusa>
I mean ChatGPT just produced non sense
<sortie>
You know it's undefined behavior when the AI is affected too
<lkurusa>
Haha
<lkurusa>
The last instruction is the produced code is `mov ax, 0x`
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
nyah has quit [Quit: leaving]
<geist>
it also doesn't seem to understand the xor trick
<geist>
but i guess its sort of effectively producing -O0 core
<geist>
code
<geist>
first obvious problem i see is it just puts the string in the middle of the code
elastic_dog is now known as Guest1882
Guest1882 has quit [Killed (lithium.libera.chat (Nickname regained by services))]
elastic_dog has joined #osdev
<lkurusa>
Yeah
<lkurusa>
I had some fun playing with it but it doesnt' seem particularly well-versed in OS concepts
<geist>
yah i seems to understand the overall strategy of getting stuff to the screen via interrupts but it doesn't seem to fully grok the context it's in