<bslsk05>
thepowersgang/rust_os - An OS kernel written in rust. Non POSIX (42 forks/607 stargazers/NOASSERTION)
Matt|home has joined #osdev
<geist>
thanks
<gog>
hi
* kazinsal
pets gog
* gog
prr
<Mutabah>
geist: Enjoy
Brnocrist has quit [Ping timeout: 264 seconds]
Brnocrist has joined #osdev
mykernel has quit [Quit: Quit]
FreeFull has quit []
carbonfiber has quit [Quit: Connection closed for inactivity]
heat has quit [Ping timeout: 256 seconds]
[itchyjunk] has quit [Ping timeout: 252 seconds]
[itchyjunk] has joined #osdev
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
smach has quit [Ping timeout: 260 seconds]
smeso has quit [Quit: smeso]
smeso has joined #osdev
<gorgonical>
mrvn: you are a genius. this has made all of this so much easier
gog has quit [Ping timeout: 268 seconds]
scoobydoo has quit [Ping timeout: 260 seconds]
scoobydoo has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
Avaflow has quit [Quit: why do they call it oven when you of in the cold food of out hot eat the food?]
xenos1984 has joined #osdev
mimmy has quit [Quit: ZNC 1.9.x-git-187-32d4a4d5 - https://znc.in]
mimmy has joined #osdev
mimmy has quit [Quit: ZNC 1.9.x-git-187-32d4a4d5 - https://znc.in]
mimmy has joined #osdev
<geist>
okay starting to get the hang of this
<geist>
been building more and more complicated usages of traits and generics and whatnot to get a handle on what's going on at the bottom layers
dzwdz has quit [Ping timeout: 255 seconds]
<geist>
and especially how to keep rust from just exploding more and more generics, since it's really subtle in the explosion of codegen since basically any routine that deals with a generic struct kinda becomes generic too
<geist>
but dyn references flatten that out by forcing it to use a vtable
<geist>
(where generic in this case is like a template in C++)
<zid>
Okay day 6 pretty easy, spent a few minutes fixing various off by 1s in part 2 version though
<bslsk05>
github.com: edk2/BasePeCoff.c at master · tianocore/edk2 · GitHub
<j`ey>
and your rawdata size and ptr are zero
<heat>
everybody gangsta until j`ey opens BasePeCoffLib and gets EDK2 PTSD again
<j`ey>
@_@
lkurusa has joined #osdev
<j`ey>
actually, not sure if it's the 0 or the one below it, will look again after lunch if you havent fixed it by then
<heat>
zid, I see the ffffi thing in discord now
<heat>
literally broken
rorx has quit [Ping timeout: 256 seconds]
<LittleFox>
<heat> no one forces you to write in STATIC CONST CHAR8 *gTheirStyle;
<LittleFox>
well, they do when you want to fix bugs in edk2
* mrvn
pulls a gun on LittleFox
<heat>
you did that like once didn't you lol
<mrvn>
YOU WILL WRITE CRAP!
<zid>
heat: Uninstalled, deleted, sent back, refunded.
<LittleFox>
heat, well, once I sent something upstream and got it merged (with wrong email addres >_>)
<LittleFox>
but .. I also have some more changes laying around on my laptop
<LittleFox>
like Emulator with networking under linux - which is completely missing so far
<heat>
oooooooooooh
<zid>
weirdly, my osdev project is an emulator with networking
<LittleFox>
have that here since nearly two years and just have to clean it up for upstreaming (:
<zid>
heat: done day5 or day6 yet?
<zid>
You can bash out day6 real fast
<LittleFox>
also have quite some fixes and features for AVR in LLVM ... but just never get around of cleaning and upstreaming them
<heat>
fwiw you'll also need to wait for the maintainers to review
<heat>
which... takes time
<heat>
i remember you nvme change also took like days to get reviewed, and it was trivial wasn't it?
<heat>
something like that
<LittleFox>
my edk2 fix was faster than my smol kubernetes feature
<heat>
your*
<LittleFox>
llvm was quite fast in the past, worst I can actually commit myself :D
<LittleFox>
(kubernetes PR open since march 24)
<heat>
I have an important rdrand fix pending in the mailing list for 2 weeks
<LittleFox>
oof
<LittleFox>
edk2?
<heat>
I have a pending RFC "Move my ext4pkg to edk2.git" without comments, 3 weeks
<heat>
frustrating.jpeg
<heat>
yes
<LittleFox>
ah that was you
<LittleFox>
maybe I can look at the rdrand thing, sounds smol enough for me to understand
<LittleFox>
and no one says I can't add a Reviewed-By
<heat>
insert edk2-platforms is a crippling pile of garbage
<heat>
actually let me ping them again
<LittleFox>
do that, I'll have the email to remind me then
<LittleFox>
this whole "review changes via ML" is quite annoying to me - no easy list of things that are in need of reviews or something
<LittleFox>
just ... dozens of emails per day
<heat>
some testing of that patch would be ofc nice if you could
<LittleFox>
of course
<heat>
in any case god oh god why did I get into tianocore
<heat>
this is so frustrating
<LittleFox>
hm would be nice if I could get edk2 onto my a2san-e board - that is close enough to something open-sourced by intel to be doable
<LittleFox>
and I could have debug logs then ...
<heat>
I should have gsoc'd into netbsd
<LittleFox>
or even Intel USB JTAG thingy
<heat>
i would be much happier by now
rorx has joined #osdev
<LittleFox>
^^'
<heat>
i don't know of a single person that doesn't find frustrating to get changes into edk2
<heat>
intel does it quickly because ofc, it's intel, microsoft does it *quicker* because they got a guy that is ex-intel
<LittleFox>
I've seen quite some AMD lately
<heat>
amd barely contributes
<LittleFox>
huh, weird, saw them quite some times now
<j`ey>
heat: sounds like you have the edk2 ptsd
<heat>
the pt in ptsd means post-traumatic
<zid>
He has the correct level of trauma for working on efi related stuff
<heat>
i'm till currently-traumatic
<heat>
still*
heat has quit [Remote host closed the connection]
heat has joined #osdev
bauen1 has quit [Ping timeout: 255 seconds]
cyao has joined #osdev
<cyao>
Can BIOS int 0x13 store the data to the upper half memory (1Mib)? I've tried to read it there by setting es to 0xFFFF and di to 0x10, but when using the bochs debugger to check there, it says that there is only zeros
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
mahk has quit [Ping timeout: 256 seconds]
mahk has joined #osdev
xenos1984 has joined #osdev
<LittleFox>
cptsd, but current-post-trauma instead of complex ptsd
<zid>
pre-post
cyao has quit [Read error: Connection reset by peer]
* kof123
jots note to name preprocessor ptsdpp
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat>
mjg, how do I donate my blood sweat and tears to freebsd
<heat>
i'm looking for real excitement in my life and contributing to freebsd is the only thing short of getting an ashley maddison account
<zid>
They don't let people commit without having done day6
dude12312414 has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
bauen1 has joined #osdev
scoobydoo_ has joined #osdev
scoobydoo has quit [Ping timeout: 248 seconds]
scoobydoo_ is now known as scoobydoo
xenos1984 has joined #osdev
<heat>
zid, are you trying to taunt me
<heat>
because congrats you did it
<heat>
mofo
<zid>
good
<zid>
You wasted 15 minutes of your day, sucker
<heat>
day5 seems like a fun coding interview question
<heat>
I've heard of a similar one
<zid>
I overengineered the shit out of mine
<heat>
like actually doing stack stuff is great until your n grows ridiculously large
<zid>
It runs best with millions of entries
<zid>
very badly with 20
<heat>
lol
<heat>
what did you do?
<zid>
linked lists
<zid>
char arrays would have been faster/easier
<heat>
yeah well, how badly is very badly?
<zid>
but I need a linked list impl to copy paste for later days ;)
<heat>
yo am I seriously going to need to parse the fucking drawing
<zid>
it's easy it's padded with spaces
<heat>
it's annoying
<heat>
i'm going to need to reverse the whole thing even
<zid>
x*4+1
<zid>
you're welcome
<heat>
hm?
<zid>
yea I had to write a second insert func to append instead of prepend
<zid>
but pulling shit out of the rows is easy at least
<j`ey>
it might not be the issue.. in linux it has .text and .data sections, in ddevault's case it just has .text
bauen1 has quit [Ping timeout: 252 seconds]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
bauen1 has joined #osdev
bauen1 has quit [Ping timeout: 256 seconds]
bauen1 has joined #osdev
<epony>
are you the COBOL developer who's working on an OS kernel?
bauen1 has quit [Ping timeout: 256 seconds]
bauen1 has joined #osdev
bauen1 has quit [Ping timeout: 256 seconds]
heat has quit [Remote host closed the connection]
heat has joined #osdev
bauen1 has joined #osdev
<heat>
i think that the raw data is the whole kernel no?
<heat>
oopsie, wrong window
nvmd has joined #osdev
nanovad has quit [Ping timeout: 256 seconds]
nanovad has joined #osdev
<mjg>
heat: you need to submit a urine sample along with the first patch
<mjg>
heat: is that gonna be a problem
<heat>
sir no sir i'm straight as an arrow in a gay bar
<mjg>
they test for lsd, fentanyl, molly and basically everything else scheduled
<mjg>
if you don't have any, the patch is rejected by QA
<mjg>
basic sanity check
<heat>
what are you on
<mjg>
fentanyl decemeber
<heat>
what's january?
<heat>
heroin?
<mjg>
that's kind of a stepdown, innit
<mjg>
january is hallucinogenic frogs
<mjg>
not everyone can afford, so normally there is a drop in contributions that month
<ddevault>
thanks j`ey, I'll look over all of this next time
<j`ey>
ddevault: let us know if you fix it
<ddevault>
I will
<heat>
zid, dun
<geist>
oh huh. last night my internet provider did some network maintenance and for the first time in like 2 years i got new ipv4 and v6 addresses
<geist>
not that big of a deal *except* a bunch of my internal machines' v6 address is wrong and they're taking a while figuring it out
<geist>
never occurred to me that that'd be a problem without v6 natting
<heat>
are you not under NAT?
<geist>
not v6
<heat>
zid, see, normal people are under NAT
<geist>
i'm picking up a /60 from my isp and using it for a few vlans and direct assignment
<geist>
huh? what do you mean under nat?
<geist>
liie my ISP giving out a 10.x or something?
<heat>
yeah, and the ISP doing NAT
wootehfoot has joined #osdev
<geist>
oh gosh no. i've never had an ISP give out a natted address
<heat>
oh
<heat>
fuck
<heat>
that's like, kinda weird
<geist>
really? never occurred to me an ISP would nat something. that would be terrible, you couldn't control how the ports are mapped
<geist>
i have enough of a time getting upnp and whatnot to work on the router i control
<heat>
I've never personally seen a non-NAT (consumer) address here :)
<geist>
anyway it's usually not a problem with v4 nat getting a new host address, but with v6 non nat, each of my computers has a straight up v6 address on the net
<heat>
well ofc the router is the one doing the NAT
<geist>
but if it changes...
<geist>
wait huh, what do you mean the router is doing the net?
<geist>
nat
<heat>
if the ISP just gives you a /1 it's literally all you have
<geist>
oh you mean a double nat in your case?
<heat>
router gets IP, router puts everyone under NAT with a 192.0.0.0/24
<heat>
no, just a single NAT
<geist>
okay wait. what do you mean if you say your ISP is giving you a natted address
<geist>
i think we're talking about the same thing?
<heat>
i have never said the ISP would give you a natted address
<heat>
well
<geist>
i thought hta't sprecisely whatyou just said. that would be insane (if they were running the nat on their end)
<heat>
yeah we were talking about the same thing with very loose terms
<heat>
with ISP doing NAT I meant the ISP gave the router a single address, which it would obviously need to NAT
<geist>
oh sure. i think it's a question of whether or not you consider a nat to be the isps thing if the natting is done on hardware in your house you cotrol
<geist>
oh sure. that's always how it's been (router gets a single address)
<geist>
though in the case of v6 i have asked for an get a /60
<geist>
so i dont have to nat v6
* heat
nods
<heat>
no one NATs v6
<geist>
right, though you can. and in this case has one advantage, if the upstream v6 changes all of your internal computers dont have to change their ip
<heat>
how?
<geist>
how what?
<heat>
how do you NAT v6?
<geist>
i think you can nat it just like anything else, you use some sort of reserved v6 range for internal stuff
<heat>
traditionally you have a link local address and a global address
<heat>
and you just use em
<geist>
i forget what the range is. site local reserved?
<bslsk05>
en.wikipedia.org: Unique local address - Wikipedia
<heat>
yup
<heat>
do you not have all your machines on the same network?
<geist>
i have a few separate vlans
<geist>
but that's why i have a /60 instead of a /64. that gives me 4 bits of vlan tags
<heat>
do link local addresses not work on that?
<geist>
no they work fine. each machine has its own fe80, etc
<geist>
it's just each machine has it's own global<60>:vlantag<4>:<64bit address>
<geist>
so as the global changes each machine does too
<geist>
none of this is a big deal, it's just literally the first time since i got proper ipv6 addressing when i moved 2 years ago that my ip has actually changed
<geist>
they probably installed some new hardware upstream
<heat>
yeah
<heat>
do you hardcode those?
<geist>
no, but it seems to be taking a while for the clients to switch over. my mac laptop was having trouble until i bounced wifi
gog has quit [Read error: Connection reset by peer]
<geist>
but thats probably because i'm not using dhcpv6
<geist>
using just plain autodiscovery
<geist>
maybe that takes longer
bgs has joined #osdev
<heat>
yup, i don't think they even give you a lifetime
<geist>
yah plus a bunch of machines do the security thing where they roll temporary v6s every so often, so it'll take a while for the old ones to rotate out
<geist>
though presumably they only stick around as old sockets hang on
<geist>
all in all i am happy with v6 though, works generally like a champ. i think based on traffic statistics i get from my router traffic with v4 and v6 are about 50/50
<geist>
though i may be a bit higher with v6 because work is very v6 centric
smach has quit [Read error: Connection reset by peer]
gog has joined #osdev
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
<heat>
it's of course a very overengineered way to shoot down TLBs
<heat>
as as intel tradition
<heat>
as is*
<heat>
at least it adds a way to write to some MSRs I guess? kinda cool?
<heat>
otoh, it's limited to the ones they explicitly support. the whitepaper only mentions HWP_REQUEST
<gog>
hi
<heat>
apparently it's already launching in Sapphire Rapids
<heat>
gog, greetings
<gog>
200 OK
TkTech has joined #osdev
terrorjack has quit [Ping timeout: 256 seconds]
terrorjack has joined #osdev
<ddevault>
j`ey: do you have a debug build of AAVMF handy?
<geist>
heat: oh interesting, lets see
<j`ey>
ddevault: not anymore sorry, at home now
<ddevault>
no worries
<ddevault>
cheers
<geist>
huh interesting, re: the RAR thing
<geist>
I wouldn’t have expected that mechanism, though it kinda makes sense
<geist>
Seems like a hack on top of a hack, but kinda reasonable
<heat>
it looks like ass
<heat>
why couldn't they do an invlpgb + tlbsync kind of thing?
<heat>
why???
<geist>
Well the hack is ‘you still have to do TLB shoot down in this manual way’
<geist>
But then given that constraint, it’s at least kinda reasonable i guess
smach has joined #osdev
<geist>
It’s a turd polish
<heat>
what's the constraint?
<heat>
we're too lazy for a proper solution so here's some budget-ass IPC?
<geist>
The constraint being that it’s still basically a broadcast IPI style mechanism where something fiddles with memory and that’s how you can tell its done
<geist>
Vs some sort of bus message/cache coherency style sync that the AMD/ARM solution is
<heat>
yeah and it will use the bus message stuff under the hood I assume
<geist>
not saying it’s great at all
<geist>
But at least it makes sense, just another hack
<geist>
Yet another ‘allocate a 4K page and point the cpu at a thing you blat stuff into’
<heat>
we live in a society
<geist>
At least they’re finally doing something about the problem
<geist>
Now i just wish they’d increase the size of the PCID but that’s a harder one, because of cr3
<heat>
it uses a fair share of OVMF itself, it's just ARM support tacked onto OVMF in a really hacky way
<heat>
if you want to be really technical, ArmVirt is the correct name ig
<geist>
Isn’t ovmf literally just uefi firmware for virt machine?
<geist>
More specifically tianocore ported to -machine virt?
<heat>
yes
<kazinsal>
yeah, iirc it stands for Open Virtual Machine Firmware
<heat>
erm
<heat>
no
<heat>
not machine virt but rather any sort of machine qemu has emulated over the years
<heat>
(qemu x86)
<heat>
which is why -bios OVMF.fd -machine q35 works, and so does -machine pc, and so does -machine microvm
<geist>
Hmm, okay, so for every arch there’s another port of it but all can just be called ovmf, i guess
<heat>
it's just really poor naming and shitty copy-paste culture
<geist>
But then i guess that’s why the aavmf exists, since maybe that’s a specific name for ovmf for arm64
<heat>
but in this case there's little copy-pasting and just shitty naming and file organization I guess?
<geist>
Or as you say just another project someone spooled up to port ovmf to arm, etc and then called it something else
<heat>
like, ArmVirt shares a lot of code with OVMF
<heat>
it's just that OvmfPkg/ itself has little to no provisions for the architecture itself I guess
<gog>
mew
<geist>
Ah possibly. I guess if the original ovmf stuff was and still is highlyx86 centric another project has to copy/paste it to work with arm or riscv i guess
<heat>
and it's not like support for any other architecture has been actively upstreamed. AFAIK riscv support is still pretty tentative
* geist
pets the cat that wanders in
<heat>
there's also some loongarch somewhere
<heat>
itanium never had a qemu port
<geist>
But i bet it has a RUSSSSSSTTTTTT port
<heat>
it might now with the gcc RRUUUUUUUUUUUUUUUUUUUUUUUUUUUST support getting merged
<geist>
IA64 RUST RSUT IA64 64 64 ^$^$^$
<mjg>
fuck your rustlang
<mjg>
PHP for life
<heat>
freebsd in rust when
<mjg>
probaby after kratom runs out
<heat>
other fun anecdote: UefiCpuPkg, which you may assume supports every UEFI architecture, just supports x86
<heat>
ARM arrived to the scene and added ArmPkg for the exact same thing
<heat>
yay?
<heat>
now riscv and loongarch arrived and they're also forking off to their own separate little packages
<mjg>
:D
<mjg>
i hope they continue the trend of inconsistent naming
<mjg>
how about PkgRiscV and loonagarchCpuPKG
<heat>
don't worry, riscv code is all embedded in Platform/Sifive, because riscv is exclusive to sifive
<mjg>
ok, i don't worry
<heat>
actually, no, it's even worse, it's splattered all over the repo
<heat>
this is fine
<heat>
everyone's fine
<mjg>
ok, i worry a little bit
<mjg>
is that good enough
<heat>
yes
<heat>
fortunately no one needs to use uefi in RISCV (yet)
<heat>
anyway how do i start le contribute to freebsd
<mjg>
1. get some fentanyl
<heat>
i don't have particular pain points and I don't want to refactor your shitty VFS to get less shitty and 4.4BSD
<mjg>
w8 u srs
<heat>
yes
<heat>
i told you, I want some excitement in my life
<heat>
(read: I don't want to refactor your vfs)
<mjg>
you want to do something interesting or just start somewhere(tm)
wootehfoot has quit [Read error: Connection reset by peer]
<heat>
preferrably 1) but 2) will do i guess
<mjg>
there is a pain point i can't be arsed to do and which would be real nice(tm)
<mjg>
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
xenos1984 has quit [Read error: Connection reset by peer]
<mjg>
as you can see there is big stupid going on during binary startup
<mjg>
one idea what to do with it is to create a binary db which can be opened instead
<mjg>
.. of parsing a text file and diving into /usr/local/etc/libmap.d
<mjg>
so deliverables would be 1. a tool to regen the db 2. patching rtld to use said db
<mjg>
with one key feature: if there are no entries in libmap.conf nor libmap.d, the db should not exist to begin with
<mjg>
<mjg>
if you want a kernel project, the sysctl tree lookup is pretty sad right now
<mjg>
doing linear scans
<mjg>
someone(tm) needs to convert it to - for example - a hash table
<mjg>
if you want something else i can look around a little but you gonna need to specify tf you are looking for in general
<mjg>
<mjg>
re binary startup, i also have to note is is about half the speed of linux binaries, so there is something extra retarded going on there
<mjg>
[linux binaries on freebsd!]
<mjg>
profiling and sorting it out would be real nice
<mjg>
<mjg>
there is a bug in the profiler which makes it fail to resolve most userspace symbols
<mjg>
fixing that would be A+
V has joined #osdev
<mjg>
deliverable would be sorting it out to the point where you can generate a flamegraph with all user and kernel symbols resolved [the latter part works fine!]
gorgonical has joined #osdev
<heat>
sorry i'm going nuts over the world cup
<mjg>
but again, i don't know what's going on in that code, so you would be on your own
<heat>
i'll be back in like 2 hours
Burgundy has joined #osdev
xenos1984 has joined #osdev
invalidopcode has quit [Remote host closed the connection]
nvmd has quit [Ping timeout: 246 seconds]
invalidopcode has joined #osdev
vdamewood has quit [Quit: Life beckons]
dude12312414 has joined #osdev
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
dude12312414 has quit [Ping timeout: 255 seconds]
bauen1 has quit [Ping timeout: 260 seconds]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
dude12312414 has joined #osdev
<heat>
mjg, is sysctl meant to be fast?
<mjg>
heat: it is used *A FUCKTON*
<mjg>
heat: so while it does not have to be ultra optimized, the O(n) scans are a no-go
<mjg>
anything worse than O(ln n) or similar is probably bad even if the code is somewhat rarely used
<mjg>
and as you can imagine it is linear because the geezer did not know any better, not because of a good reason
<mjg>
[well maybe he knwe better but could not be fucked to do better, point of no point stands]
<heat>
the file looks hairy af
<mjg>
see kernel_sysctlbyname
<mjg>
first trip ultimately lands in name2oid
<mjg>
this is the bit which needs optimizng the most
<mjg>
it performs linear scans of a tree to find the stringified name
<mjg>
the tree is sorted by id
<mjg>
one idea is to just add a hash for name -> id translation
<mjg>
best case scenario: kernel_sysctlbyname is reworked to find the oid and just call the routine
<mjg>
no 2 trips around kernel_sysctl
<mjg>
but i wont require that refactorin' :>
<moon-child>
sounds like an application for perfect hashing
<mjg>
basically i will be happy with O(ln n) or O(1) name2oid
<mjg>
moon-child: agreed
<mjg>
well kind of
<mjg>
the tree changes *sometimes*
nvmd has joined #osdev
smach has quit []
spikeheron has quit [Quit: WeeChat 3.7.1]
sprock has quit [Remote host closed the connection]
<heat>
mjg, this is where i ask wtf an oid is
<mjg>
an entry in the tree
<mjg>
say you got vfs.nfsd.async
<mjg>
then vfs, nfsd and async each are an oid
<mjg>
and the fucking sysctlbyname syscall performs a linear scan to translate "vfs" into an id, so that it know where to look for "nfsd" in
<mjg>
and so on
<heat>
what does oid stand for?
<heat>
object id?
<heat>
makes little sense
<heat>
what's the manpage pkg for syscalls?
lkurusa has joined #osdev
<heat>
i don't seem to have a sysctlbyname one
sprock has joined #osdev
<mjg>
there is no pkg
<mjg>
man sysctlbyname works just fine for me
<heat>
huh, it's not in 2
<mjg>
oh
<mjg>
i see
<heat>
what does sysctl do? does it not bottom out in name lookups as well?
<mjg>
it used to be a straight libc func doing something extra retarded: calling sysctl twice
<mjg>
then i had someone move it into the kernel
<mjg>
it retained some of the idiocy, but at least it is one syscall now
<mjg>
straight sysctl uses ids instead of strig names and those use a rb tree
<mjg>
wile not great it is tolerable for now
<mjg>
while
<mrvn>
"We can't just leave her stranded, what if a bad guy comes along?" "Dude, we are the bad guys."
<heat>
confusing.gif
<heat>
anyway how do I 1) build freebsd (I assume that's straight forward) 2) make my VM boot it
<mrvn>
mjg: why would you call sysctl post boot (much)?
<heat>
the BSD sysctl is very different from the linux sysctl
<mjg>
heat: make -j $BIGNUM kernel
<heat>
it serves as a proc replacement for instance
<heat>
(/proc)
<mjg>
mrvn: for example it gets queried for "vm.overcommit" on binary startup
<mjg>
heat: make -j $BIGNUM buildkernel just builds, installkernel gets all of it in
<mjg>
heat: previous kernel gets saved into /boot/kernel.old
<mjg>
you may want to add some -sss to save on noise
kristinam has joined #osdev
<heat>
how do I install it remotely though
<heat>
I want to build in linuks
<mrvn>
does it have a tree structure so it searches for "vm" and then "overcommit" below that?
<mjg>
yes
<mjg>
heat: i don't know how to build on linux, i do know it is possible
<heat>
aren't you literally using linux
<mrvn>
So what's the biggest "dir" you have in BSD that a linear search is so bad?
<mjg>
heat: i'm on my laptop
<mjg>
heat: all the actual dev happens with my sshing into freebsd
<mjg>
mrvn: you srs man, you do realize each step is a cache miss
<mjg>
you literally get dozens of nodes to visit
<mjg>
instead of, liek, 2
<heat>
how slowly does the kernel build? maybe I could get away with building in the VM
<mrvn>
mjg: If it's a (rb) tree 2 deep then you have 4 nodes. That doesn't really make a difference.
<heat>
it's not a rb tree
<mjg>
heat: my laptop builds one in 2 minutes
<mjg>
heat: it's really not bad
<mjg>
heat: you can probably add MODULES_OVERRIDE=""
<mrvn>
heat: the hypothetical tree mjg wnats
<mjg>
heat: which will shave it to nothing
<heat>
it's a rb tree for the oids, it's a tree with linked lists for name lookups
<mjg>
it is rb tree at each level
<mjg>
which is linearly scanned for name -> id translations
<mjg>
it being a tree comes into play when you do an id-based lookup
<mrvn>
And if you sort the list and make it an array you can do lookups in O(log log n) on average
<heat>
>Insert the OID into the parent's list sorted by OID number.
<heat>
something tells me they had a linked list manually sorted before
<mrvn>
well, O(log log n * m) where m is the longest string
<mjg>
instead of that rb tree i proposed a quasi-radix tree
<mjg>
but there was only so much patience i had with the geezer
<mjg>
who insisted on a tree
<mrvn>
And for the OID interface why isn't that a flat hashtable?
spikeheron has joined #osdev
<mjg>
part hysterical raisins, part stupid api
<mjg>
there is a corner case where you get an entry which is not technically registered
<mjg>
kern.proc.<pid>
<mjg>
you find kern, you find proc and there you find you have to call it to resolve the terminal entry
<mrvn>
but that's the string interface
<mjg>
existence of this shit buys nothing, but here it is
<mjg>
whether you string it or id it does not matter
<mjg>
the <pid>-related entry is not present anywhere
<mjg>
you have to call a callback hunging off proc entry
<mjg>
to "find" it
<mjg>
so should you go for a hash consisting of "kern.proc.2345" you would not find it, ever
<mrvn>
ahh, so kern.proc.<pid> is purely virtual and generated on resolve
<mjg>
right
<mjg>
it is plausible you could hack it: you perform the full lookup and if it fails, you chop off the terminal component and try again
<heat>
huh?
<mjg>
what
<heat>
that sounds very stupid
<mjg>
i'm not fond of it but it does owrk
<mjg>
for most cases
<heat>
the whole kern.proc.2345 thing not being a thing
<mjg>
oh that
<mrvn>
sounds like you should stop complaining, stop trying to fix it and just start from scratch looking at the use cases and design the right API and data structure for it
<mjg>
the very existence of kern.proc.2345 is fucking retarded
<mjg>
mrvn: but you can't fix the api
<mjg>
mrvn: userspace uses it
bauen1 has joined #osdev
<mjg>
even if you come up with something better, this shit has to be supported
<heat>
are you advocating for /proc/<pid>/? :v
<mrvn>
mjg: that's what I said. Start fresh, make a new API
<mjg>
you do realize you can't *remove* the old api
<mjg>
you make a new api, ow you got 2 ways to get the info you have to maintain
<mrvn>
a) so what? the old will remain slow, the new one will be fast and sources will transition over time. b) you can slowly deprecate and obsolete APIs.
<mjg>
you can't do it
<mjg>
freebsd binary compat goes all the way to freebsd 4
<mjg>
that's about 2 decades
<mrvn>
so there is precedence of obsoleting APIs from <4
<heat>
that's depressing
<mrvn>
I did say "slowly" did I? Yes, I did.
<mjg>
you do realize htis means literally years of mainting 2 apis
<mjg>
in fact decades
<mrvn>
mjg: often you can make the old API look up stuff in the new API. Then you only have a little static code to translate APIs.
<mjg>
but the old stupid api puts a wrench in the sensible design
<mjg>
bare minimum which improves things no matter what is fixing the linear scans from name2oid
<mrvn>
it's the price you pay for backward compatibility. But at least you would make progress. Bitching about the old API that can't change seems pointless.
<mjg>
if someone insists on revamping all this shit and *actually does the work* i'm not going to stand in the way
<mjg>
i did propoes a way to make progress: fixing the linear scans, which is transparent to userspace, fixes majority of the problem
<mrvn>
did you benchmark it?
<mjg>
the linear scans? no
<mrvn>
Then your proposal is flawed. Might even be worse.
<mjg>
? :D
<mjg>
heat: anyway, you in, out, or still considering
<heat>
im in and trying to find a sane dev environment
<mrvn>
How do you look up strings? Do you call strncmp or do you hash the string and then do a final compare when you got a hit?
<heat>
god fucking damn it
<heat>
+egrep: warning: egrep is obsolescent; using grep -E
<mrvn>
mjg: note that for something like 16-32 ints a plain linear search is faster than anything clever. binary search is slower for example.
<mrvn>
mjg: Line 140 would be relevant: if (strcmp(oidp->oid_name, name) == 0) {
<mrvn>
mjg: that might be another place you can optimize. Storing strings as (hash, string) and searching the hash first. Which is basically a stupid hashtable.
<mjg>
it is still a linear scan, you do realize that
<mrvn>
mjg: which is blindingly fast if you have an array of hashes.
<heat>
ok i'll be dead before I get the linux build to work
<mrvn>
Make a 1 byte hash and you can search 64 entries in a single cacheline.
<heat>
maybe if you followed netbsd's lead you could have more devs
<heat>
make it build anywhere due to dark arts and booze
<mrvn>
mjg: you could even do 8 hash compares in parallel or more with SIMMD.
<mjg>
you do realize this is kernel code
<mjg>
and with sensible hashing you will do few compares to begin with
<mjg>
so employing simd would only slow things down
<heat>
avx-512 babeee
<mjg>
because of the extra save/restore of the state
<mjg>
heat: protip is best to use ufs for a vm
<mjg>
heat: lets you skip all the modules
<heat>
i'm on zfs because I live in the future :/
<mjg>
heat: otherwise you need to have MODULES_OVERRIDE="opensolaris zfs" minimumn
<mjg>
and zfs takes the longest to compile
<mrvn>
mjg: then don't. Doing 8 compares in parallel is plenty. And how many nodes do you have with more than 64 entries? You probably end up with 1 cache miss per level and the linear search becomes irrelevant.
<mjg>
oh by default builds do everything from scratch, you can add KERNFAST=1 to do an incremental
<mjg>
mrvn: don't what
<heat>
mjg, bmake don't know how to make buildkernel
<mjg>
where are you
<mjg>
pwd
<mrvn>
mjg: then don't do SIMD. Just a 64bit register is plenty.
<heat>
omg
<mjg>
you need to cd /usr/src
<heat>
forgot i said anything
<heat>
i cloned it btw
* mrvn
recommends ccache
<heat>
is that not the sanctioned FreeBSD method of building it
<mjg>
it is
<mrvn>
All my builds are incremental. :)
<heat>
yeah i git cloned the tree and then forgot to cd
<heat>
"why doesn't bmake work"
<mjg>
happens to onyx dvelopers
<heat>
this is the kind of incisive development that happens on onyx
<heat>
i think i'll actually need to use nano
<heat>
vscode can't remote into freebsd
<mjg>
hm
<mjg>
i have some recollection this can work
<mjg>
but what you can do is just git push into the vm
<mjg>
after you edit on your lap
<mjg>
i don't know if i can accept a patch written in nano
<heat>
i'll do it for the funny
<mjg>
use ee
<heat>
you know those email clients that say "Sent from my iPhone"
<heat>
I want GNU nano to insert "/* Written in GNU Nano */" all over that code
<mjg>
you gonna add "Written in nano"
<mjg>
right
<heat>
emphasis on the GNU part ofc
<mjg>
> Dictated into my iPhone
invalidopcode has quit [Remote host closed the connection]
<heat>
hahahaha
invalidopcode has joined #osdev
<heat>
hashtag include lesser than stdint dot h greater than
<heat>
>#include<sexually transmitted disease.h>
<heat>
alright I didn't set MODULES_OVERRIDE and now it's building every kernel module ever
<heat>
great play by me
<mjg>
here is a weird trick: ^C
<heat>
i don't trust build system ^C
<mjg>
you can still add KERNFAST=1 to not lose the progress
<mjg>
which was intended to happen
rwxr-xr-x has joined #osdev
<rwxr-xr-x>
yo yo yo!
<rwxr-xr-x>
How is everyone?
<heat>
what is up fellow youth
<heat>
are we 'crackin?
wikan has joined #osdev
<rwxr-xr-x>
what is popping fellow bros
<heat>
we bussin?
<rwxr-xr-x>
we bussin
<mjg>
we got a fentanyl crisis on the channel
<rwxr-xr-x>
Not anymore, i took it all
<mjg>
's what i mean
<mjg>
i snorted a line yesterday and i'm empty today
<mjg>
help a bro out
<rwxr-xr-x>
but i want it
<mjg>
no compassion in this world
<rwxr-xr-x>
nope
<mjg>
give it all or i'll call my homies
<rwxr-xr-x>
send em
<rwxr-xr-x>
i can take them
<mjg>
so i watched the wire seasons 2 and 3 (finishing 4 now)
<rwxr-xr-x>
homies > /dev/null
<mjg>
one of their code names for drugs is "spider bags"
<mjg>
also "rockeffelers"
<rwxr-xr-x>
XD
<mjg>
and my fav: "PANDEMIC" :S
<mjg>
"got PANDEMIC"
<mjg>
"got PANDEMIC right here"
<mjg>
for real
<mjg>
did not age well
<rwxr-xr-x>
aged magnificiently, what are you talking about
<kazinsal>
wmd, got dat wmd
<mjg>
kazinsal: have you seen other works by simon?
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<kazinsal>
I've seen Generation Kill, haven't watched any of his other stuff
<mjg>
from a quick grep it seems his show on housing crisis is good
<mjg>
gonna watch that next
<heat>
mjg, what's the hashtable thing I can use?
<heat>
i assume I don't need to reinvent the wheel here
<heat>
inb4 i need to reinvent the wheel
<mjg>
that's a ye-ish
<mjg>
see kern/vfs_hash.c
Matt|home has quit [Quit: Leaving]
genpaku has quit [Remote host closed the connection]
genpaku has joined #osdev
<mrvn>
I know cameras have software to stabilize the video but that seems to be horrible, drifting all over the place. Can't they do face recognition and stabilize so a persons nose or eyes remain stable?
xenos1984 has quit [Read error: Connection reset by peer]
<gorgonical>
I think that has to do with the ISPs on the system, right?