Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
<heat>
geist, sweet
<heat>
try_lock is weird
<geist>
try lock of a ticket lock? doesn't seem too weird, just have to see if the current ticket == current acquired
<heat>
it is a little weird
<heat>
i remember being a bit weirded out a few weeks back when i prototyped that a bit
<heat>
basically you need to cmpxchg the whole struct
<heat>
also, union gens slightly better code than __atomic_compare_exchange on a struct
<heat>
and then you have other questions such as "should you loop or do you tolerate spurious failure on the try_lock"
<geist>
i'd just do what linux does and store the two counts as 16 bit vals in a 32bit word
<heat>
yeah but you need a union for that
<heat>
wait, maybe you don't
<heat>
yeah. that is weird but you can add either 1 or 1 << 16
<geist>
yah just do some work with << 16
<geist>
right, atomic_add(lock, 1<<16)
<heat>
iirc some random architectures out there don't work out too well when you do atomic ops of different sizes on the same data
<heat>
so i guess thats why
<geist>
right, that's why you always do a 32bit that way, yeah
<Ermine>
I guess you need to add 1 + (1 << 16)
<geist>
and if you put the next ticket in the top of the word then when i wraps it'll nicely wrap to 0
<heat>
no, not + (1 << 16)
<heat>
1 + (1 << 16) would be a simultaneous lock + unlock
<geist>
right, you want to grab the ticket, then go to a CAS loop to try to acquire it
<geist>
(if yo udidn't grab it)
srjek has quit [Ping timeout: 272 seconds]
<geist>
i think re: trylock you always have to be able to deal with spurious failures anyway, since by definition it's a TOCTOU thing
<geist>
liek if it happened to be locked the nanosecond you tried then you fail
<heat>
have you tried mcs locks?
<geist>
i have not. i wrote up a prototype in pseudocode years ago but decided its too expensive for my sort of tasks
<geist>
like, itseems like it should only really kick in on fairly large machines
<heat>
the naive implementation shuffles a lot of pointers back and forth and requires you to keep a struct on the stack (e.g NT queued spinlocks do this)
<geist>
yah i'd put the struct in a per cpu structure on its own cache line, but yeah
<heat>
the linux implementation compacts it all into like two uint16s with some bits ued for other tasks
<heat>
those uint16s are then basically a linked list of cpus
<geist>
yah
<geist>
and with the structs in the per cpu structure, the pointers make sense
<geist>
only downside there is you can only grab so many spinlosk at a time, and you have to be able to disambituate it
<heat>
and because spinlocks require no preempt or no irq or no softirq or whatever, you have a limited number of contexts so yeah, pretty much pcpu storage on that
<heat>
nope, no limit
<geist>
hmmm, have to grok that
<geist>
oooh because when you hold the spinlock you dont need the struct?
<heat>
basically imagine you're locking on the irqsafe context. you disable irqs, now no one else can grab an irqsafe lock
<heat>
yes that too
<geist>
right, okay so yeah one per cpu, since you can only be spinning on one at a time
<nikolar>
At the current rate, you'll be done in a month :)
<ddevault>
I think there's good odds on getting everything on this list in under 30 days
<ddevault>
today is day 23
<nikolar>
Sounds ambitious but good luck
<nikolar>
Not sure how much you're missing for most stuff so it's probably not as bad as it looks
<ddevault>
sbase, lok, and make all build and work correctly, just a matter of integrating them into the system proper
gog has quit [Client Quit]
<ddevault>
binutils, tcc, qbe, hare: same
<ddevault>
libarchive works too
<ddevault>
hardest thing here is probably fleshing out the vt
<ddevault>
and implementing /dev/fb for doom
<nikolar>
/dev/fb is probably the easier of the two
<ddevault>
yeah, I reckon so
<nikolar>
The core of it is just mmap the framebuffer
<ddevault>
but I do have to implement some kind of elegant hand-off from the kernel vt to a userspace consumer of /dev/fb (same with /dev/kbd)
<nikolar>
Yeah it's the stuff around the mmap that requires consideration
<ddevault>
which I intend to implement as "so long as someone has /dev/fb open, the kernel vt is disabled, and when they close it, the kernel vt is restored"
<nikolar>
Simple enough
<ddevault>
oh, and clock_gettime is going to be really fucking annoying
<ddevault>
I hate time
<nikolar>
Yeah it sucks
<ddevault>
gotta bang my head against the cmos and tsc until I can get unix ts + nanos
<nikolar>
Just do CLOCK_MONOTONIC :)
<ddevault>
need a real implementation for make to work, at least
<kazinsal>
BSD3 Plus No You Can't Just Make Bajillions Off It For Free
deriamis has joined #osdev
<ddevault>
kanzure: EUPL
<GreaseMonkey>
looking up how stuff works for the NEC PC-98 for a bootloader and, uhh, let's just say that the BIOS straight up has a flag which allows you to make it auto-retry reads
<GreaseMonkey>
also there's a "multitrack" flag which might make multi-sector reads easier?
<GreaseMonkey>
a notable quirk of the PC-98 BIOS is i think you have to explicitly denote whether a disk is MFM or FM
leg7 has joined #osdev
qubasa has quit [Ping timeout: 240 seconds]
qubasa has joined #osdev
teroshan8 has joined #osdev
teroshan has quit [Read error: Connection reset by peer]
teroshan8 is now known as teroshan
ghostbuster has quit [Ping timeout: 256 seconds]
ghostbuster has joined #osdev
<leg7>
Hey can someone help me find out why my exceptions with error code don't work?
<leg7>
Whenever I get an interrupt that is supposed to push an error code instead of returning to the main code it loops into exceptions 13
<bslsk05>
github.com: LigmaOS/src/kernel/architecture/x86/32/isr.nasm32.asm at 8042 · leg7/LigmaOS · GitHub
<kazinsal>
I did a git clone of your source tree and even after patching the CC= line in your makefile it won't run, because it's trying to reference <stdio.h>
bauen1 has quit [Ping timeout: 256 seconds]
<leg7>
I don't have any issues can you share the log?
<leg7>
Maybe that one doesn't have issues for you?
<leg7>
I remember I talked about that compiler bug with someone here
<leg7>
if you add `-I $(SRC_DIR)/libc/libk/stdio` to CFLAGS it should work
<leg7>
for some reason my cross compiler doesn't care about `-nostdlib` and `-ffresstanding` and uses system headers to check if they are available or not
<kazinsal>
but it makes it hard to get help from others as a result
<leg7>
are those guards better?
<nikolapdp>
kazinsal: HOW TO GET GOOD RELIABLIE ENV: ./doit
<kazinsal>
if I could build your whole OS in one quick enter smash we could be doing some debugging now but instead we're doing compiler debugging
<kazinsal>
nikolapdp: yeah, that's why I just do that lol
<nikolapdp>
lol works greak
<nikolapdp>
great
<kazinsal>
BACK IN MAH DAY we used to have to set up a bunch of arcane defines to make a reproducible build of the whole toolchain
<nikolapdp>
yeah i don't have the patience for that :)
<kazinsal>
getting my old sparc32 machine to compile for x86
<nikolapdp>
so thanks geist for doit
<kazinsal>
now I set up a ./doit and go get a coffee and build four arches in the time it takes the percolator to do its job and me to take a squat
<nikolapdp>
also i recently got a beefy cpu and building a toolchain takes like 5 minuts
<nikolapdp>
with gdb
<kazinsal>
in the beginning of my osdev journey I cross-compiled from sparc32 to i386, and that was PAINFUL
<kof673>
gcc -dM -E - < /dev/null | grep -i i386 #define __i386 1 #define __i386__ 1 #define i386 1 i thought gcc will do that for i386+
<kof673>
__i386__ in particular
<kazinsal>
one of these days I'll get back onto working on my "main" OS
<kazinsal>
the fantastic networking one
<nikolapdp>
which one is that again
<kazinsal>
the fun thing in the meantime is a 1980s grade unix reimplementation
<leg7>
I pushed another change to make the debugger easier to change with a ?= var
<kazinsal>
my main OS is a full line rate capable router
<kazinsal>
forwarding, route-mapping, firewalling, dynamic route stuff, the whole lot of it
<kazinsal>
on account of my professional background originally being eg. BGP, OSPF, IS-IS, EIGRP
<kazinsal>
nowadays professionally I just make sure a university doesn't fall apart
xenos1984 has joined #osdev
<nikolapdp>
oh fancy
<nikolapdp>
as in you're professional sysadmin?
<kazinsal>
yep
<nikolapdp>
is it a chill kind of sysadmin or nervwrecking kind
<nikolapdp>
also code? > 1980s grade unix reimplementation
<kazinsal>
last 8 years I was in the nervewracking business
bauen1 has joined #osdev
<kazinsal>
everything from simple small datacenter rebuilds to "hey we need to you scope out 12 floors of magic network bullshit and replace it"
<leg7>
12 floors
<leg7>
sounds fun
<kazinsal>
so I've rebuilt everything from a 15-person office to a 5000-student private university held together with spit and duct tape
<leg7>
kazinsal: did you manage to build the os?
jack has joined #osdev
<kazinsal>
but then I quit that garbage and now I work for a 20,000-student public university where all the IT staff are unionized
<kazinsal>
and everyone loves it here and my colleagues are all 25
<nikolapdp>
heh nice
<nikolapdp>
are you the oldest
<kazinsal>
25+ years older thane me
<kazinsal>
they're all retirement age lol
<nikolapdp>
ah right
<kazinsal>
and I'm the youngest at 29
<nikolapdp>
that's why you're there
<nikolapdp>
to pick up the slack :)
<kazinsal>
but in 30 years I can retire with full pay as a pension, so, y'know
<nikolapdp>
not bad, retiring at 59 or so
stolen has quit [Quit: Connection closed for inactivity]
<kazinsal>
and our collective agreement rules, so many bits added into it
<kazinsal>
coverage past what our medical extended benefits do
<kazinsal>
our extended does full dental and optical etc but doesn't do eg. gender affirmation
<nikolapdp>
makes sense
<kazinsal>
but our union collective agreement has full coverage for gender affirming care
<kazinsal>
so any gender-affirming medical expenses just get billed to the union and get reimbursed immediately
<nikolapdp>
> 1980s grade unix reimplementation
<nikolapdp>
code or didn't happen
<kazinsal>
workin' on it
<kazinsal>
I'm gonna do a full at least version 4 implementation for the PC/XT as a starter
<GeDaMo>
Does it work without MMU? :P
<GeDaMo>
In < 640K
<nikolapdp>
i kind of wanna write an os for the pdp
<kazinsal>
PC-DOS 2.1 could do resident code fuckery in 128 KB
<kazinsal>
I can do a unix in as much
<GeDaMo>
I think the first 8086s I used had 256K but that was with DOS
<kazinsal>
give me a time machine back to 1982 and Linux won't exist, I'll make sure that we can have a full open source non-AT&T derived unix on the 8088
jack has quit [Quit: Leaving]
<kazinsal>
USL v. everyone ain't got shit on me
<nikolapdp>
kek
<nikolapdp>
many things would go down differently if there were time machines around but alas
* kof673
points at conway's law
<kazinsal>
andy tanenbaum fucked up because he wanted to be a cutting edge man teaching a non realistic plan
<kazinsal>
minix-86 was great for mid 80s OS courses
<kazinsal>
in practice? the 8086/88 was not fast enough to do microkernel stuff while also not being smart enough to be a good process-isolating unix system.
srjek has joined #osdev
<nikolapdp>
heh
* kof673
points at amoeba
<kof673>
it claims to be "Microkernel" anyways
<kazinsal>
ameoba's last stable release year started with a 1
<kof673>
(did not mean to imply 8088, just noone ever mentions)
<kazinsal>
might as well call NT/Alpha current at that point
<kof673>
i'm still in 89 :D
<kazinsal>
a lot of the problem of trying to write systems in 2024 for the 8088 is meh tooling -- gcc doesn't want to touch that shit, for many often good reasons
<kazinsal>
so the best you have is OpenWatcom, which has a lot of caveats
<nikolapdp>
what options even are there
<nikolapdp>
ancient compilers/toolchains?
<kazinsal>
I'm going to write a proper article on how to get a good openwatcom build chain for 8088
<kazinsal>
because it's a mess
<nikolapdp>
that sounds interesting
<kazinsal>
openwatcom has four different compiler frontends, all of which emulate different compilers
<kazinsal>
one for gcc (fails at that in many ways)
<kazinsal>
one for intel cc (fails massively)
<kazinsal>
one for microsoft cl (good for 386+)
<nikolapdp>
kek
<kazinsal>
and one for classic watcom (good for 8086+ but not for kernel level stuff)
<kazinsal>
basically you need to mix and match compiler and linker frontends if you want to be able to put together a binary that runs with a simple memory model
<kof673>
there is a stack overflow with list of 16-bit compilers, but do not have it handy
<kof673>
the dos source...contained msc i believe...and the github says "mit licensed" (but no source of course) so possibly that too ...
<kof673>
*recently-released dos source...dos 4 IIRC
<kof673>
there is also a q of some compilers e.g. needs 32-bit -- can output 16-bit, but not run there
<bslsk05>
www.emsps.com: Microsoft C and QuickC Version Information
<kof673>
> Microsoft's licensing spokesperson "Rich H." told me, on 2-8-00, that anyone with a valid license to use any recent version of Visual C++ is also licensed to use any older version of Microsoft C/C++ products. I haven't heard this before, so you should confirm this for yourself. Previously, Microsoft representatives had stated that you could downgrade only two version levels.
<kazinsal>
at the end of the day there was a bunch of More Magic needed to make all this output a bunch of binaries that would boot on a 5150
<kof673>
i mean that seems totally credible
srjek has quit [Ping timeout: 268 seconds]
<leg7>
So when I treat exceptions that push an error code as if they didn't push anything it works
<bslsk05>
forum.osdev.org: OSDev.org • View topic - Exception handler: #GP when the exception has an error code
<leg7>
I guess I was right and the error code is not being pushed
m257 has joined #osdev
<leg7>
Maybe that should be mentioned in the wiki
<heat>
what?
xFCFFDFFFFEFFFAF has quit [Read error: Connection reset by peer]
<heat>
yeah no shit, int isn't magical
<heat>
it does not know what a #GP is
<leg7>
I still get the same bug even with real interrupts though
<leg7>
ogm
<leg7>
this is so bad
<heat>
what bug?
m257 has quit [Quit: Client closed]
<leg7>
When an exception that is supposed to push an error code gets triggered instead of handling it and returning to code execution it loops into #GP forever
MrCryo has quit [Remote host closed the connection]
<ddevault>
the 24-bit true color rainbow banner is kind of fucking dope, though, maybe I should finish this
edr has joined #osdev
foudfou has quit [Remote host closed the connection]
gsekulski has quit [Ping timeout: 256 seconds]
Arthuria has joined #osdev
<GeDaMo>
«In testing the algorithm, Thompson realized, "I was three weeks from an operating system." He broke down his work into three units—an editor, an assembler, and a kernel—and wrote one per week. And about that time, Bonnie took their son to visit Ken's parents in California, so Thompson had those three weeks to work undisturbed.»
<bslsk05>
opensource.com: Origin stories about Unix | Opensource.com
<heat>
ddevault, huh cool
<mjg>
time estimate for a softwar project which worked out?
foudfou has joined #osdev
<heat>
btw your /dev/tty* thing is wrong, you need to skip /dev/tty
<mjg>
i take "bullshit stories for $100"
<dostoyevsky2>
GeDaMo: Ken Thompson wrote an OpenSource Unix?
<mjg>
ken thompson stole the idea for unix from vms
<kazinsal>
basically don't believe finnish college students in 1991
<heat>
ken thompson wrote linux yeah
<mjg>
only the vfs layer
<GeDaMo>
dostoyevsky2: that's the original :P
<heat>
he was like "oh man this bsd shit is so crap, i'll write a better one myself"
<kazinsal>
if I had a time machine I'd write a unix-like in 1982 to save us all from this bullshit
<heat>
and changed his name to some made up crap like linux, wrote one in 91
<heat>
linus*
<mjg>
i blame ken thompson for solaris namecache though
<ddevault>
heat: thanks, I don't have /dev/tty though so no problem for now
<dostoyevsky2>
kazinsal: I think they tried to do this with BSD at the time but then got sued
<heat>
bsd isn't a unix-like, it's a unix
<heat>
or was
<dostoyevsky2>
And it took until the 90s to get it cleared by the courts
<heat>
mjg, solaris namecache <- svr4 namecache <- bsd namecache
<heat>
it's always bsd's fault
<dostoyevsky2>
heat: I think it was AT&T's fault for suing
<heat>
maybe the bsd people were just really asking for it
<mjg>
if only the at&t lawyers were also high
bl4ckb0ne has quit [Read error: Connection reset by peer]
bl4ckb0ne has joined #osdev
Arthuria has quit [Ping timeout: 260 seconds]
<netbsduser>
what's the deal with solaris' namecache
<netbsduser>
i like dragonfly's and i ended up copying it (it has pleasing characteristics for things like nullfs)
* mjg
checks if the g-man is lurking
<mjg>
it's the usual old unix shitery
<mjg>
instead of being a first-class citizen it got bolted onto vfs
<mjg>
and indeed, things like nullfs need to be a fs because of it
voidah has quit [Ping timeout: 255 seconds]
<mjg>
which is turbo slow
<netbsduser>
does solaris have a nullfs?
<netbsduser>
the old BSD one (which is still used everywhere but DragonFly i think) i dislike
<mjg>
ye, but i don't remmber how they call it
<netbsduser>
a tedious pile of moving parts
<mjg>
this is what you get for layering vnodes
<heat>
i remember you were all shitting on inodes and praising vnodes a long while ago
<heat>
oooh inode super_block so silly
<mjg>
?
<netbsduser>
they are stupid names in full fairness
<mjg>
there is plenty to shit on linux for
<mjg>
but not making the namecache a first class citizen
<netbsduser>
the namecache (or linux dentry) distinction from vnodes and addition as a layer that superimposes on vnode access is a definite good thing from linux land
<heat>
encapsulating shit in 50 layers of "generic" is the classic 80s/90s UNIX vibes
<mjg>
even from user pov it's a win
<mjg>
because it is guaranteed *reliable*
<heat>
vnodes are too encapsulated, vm_objects are too incapsulated
<heat>
incap encap idk
<heat>
you get it
<netbsduser>
when i copied dragonfly (which probably copied linux, either that or matt dillon is very clever) i was blown away by how trivial and efficient nullfs could be
<mjg>
that is part of the selling point
<mjg>
and ye, it is very linux-esque
PublicWiFi has quit [Read error: Connection reset by peer]
<netbsduser>
the funny part is i don't believe linux had it originally
<netbsduser>
i'm sure i read somewhere it came in - perhaps linux 2.2?
<mjg>
i don't know
<netbsduser>
so it is not even old but i think it's clearly a step forward in unix filesystem design
<kof673>
> time estimate well some of them had worked on multics at least :D
<heat>
most linux things are steps forward which is why it's the leader in everything and all the other unices are ded
<mjg>
that's not how it works mon
<mjg>
it's non-tech people which made things happen on this front
<heat>
it is not an exact science but it is reality
vdamewood has joined #osdev
<netbsduser>
well there's things about how linux does filesystems i am less keen on
<mjg>
the reality is the quality of tech has nothing to do with its adoption
<heat>
i think there's some truth to that statement but it's not entirely true
<dostoyevsky2>
netbsduser: Shouldn't a nullfs always be trivial to implement? Just ignoring everything
<netbsduser>
the file ops vector in BSD was a stain on the more elegant sun VFS, the product of a failure to integrate, and i dislike that linux seems to embrace it
<heat>
if it's wank, it's wank. e.g no one uses windows for big metal servers
<mjg>
bro
<mjg>
php was so fucking wank
<netbsduser>
by god, if i have a vnode, i should be able to read or write it and not generate some other object to represent its openness
<mjg>
and it was synonymous with webpages
<heat>
oh, that bit makes SOOOOOOOOOOOOOOO much more sense
gsekulski has joined #osdev
<netbsduser>
dostoyevsky2: no, i cannot think of a way to do it in with the BSD VFS without pain
<heat>
when i read that bit on the svr4 book about how they needed a special filesystem for device files
<heat>
i had an aneurism
<netbsduser>
the one that's used in all BSDs other than XNU (has none) and DragonFly (has a proper namecache) had to be written by rocket scientists and is part of some big general vnode layering framework
<mjg>
it did not work
<dostoyevsky2>
netbsduser: I wanted to check how they implemented nullfs on OpenBSD, turns out the deleted it... like TMPFS
<mjg>
openbsd gave up on trying to make it work
<mjg>
netbsd has lul patches and it probably deadlocks
<mjg>
freebsd beaten it to good enough shape that it mostly works
<heat>
linux acknowledges files and "reading them" has nothing to do with an inode
<mjg>
and by that i mean the system does nto fall over
<heat>
and neither do most ops
MrCryo has joined #osdev
<netbsduser>
heat: what, pray, has it got to do with if not an inode? (or vnode)
<bslsk05>
SanseroGames/LetsGo-OS - An operating system written in Go (8 forks/89 stargazers/MIT)
<heat>
netbsduser, when you write to a block device what are you writing to?
<heat>
how about a character device? and a fifo? and a unix socket?
MrCryo_ has joined #osdev
<netbsduser>
heat: to a block device, to a character device, to a fifo, or to a socket, through the vnode representing the same, and existing in the specfs, specfs, fifofs, or sockfs pseudo-filesystems respectively
<heat>
>specfs
<heat>
see, unix brain damage
<mjg>
VNODE ALIASING MOTHERFUCKER
<netbsduser>
i ended up updating from this approach to a devfs
<netbsduser>
and now arbitary device files created elsewhere are meaningless
MrCryo has quit [Ping timeout: 256 seconds]
<netbsduser>
(but i've since trimmed out almost unix from my kernel to redo in a different way now that i have had the chance to make more mistakes, so that can change)
<nikolapdp>
dostoyevsky2 huh first time i've heard of someone actually trying
<heat>
there's a whole MIT research kernel where they wrote a whole UNIX in go
<heat>
it worked fine although with dubious memory reclaim
<bslsk05>
github.com: LetsGo-OS/syscall.go at master · SanseroGames/LetsGo-OS · GitHub
<heat>
for any special file on an e.g ext2 fs: stat hits ext2, chmod hits ext2, the inode is an ext2 inode, but then read/write/mmap/ioctl/fcntl/etc all hit the special file
<heat>
how can one look at this and think "how we need to duplicate vnodes on a special filesystem and somehow implement all of these semantics there, over and over again"
<heat>
s/how we/oh we/
<nikolapdp>
heh
MrCryo_ has quit [Ping timeout: 256 seconds]
<netbsduser>
they're not duplicated, the vnode ops vector is different when a vnode is instantiated representing a VBLK/VCHR/VFIFO/VSOCK
<heat>
so you craft a new vnode ops dynamically and use that?
MrCryo has joined #osdev
MrCryo has quit [Remote host closed the connection]
<netbsduser>
there are static ones e.g. ext2_vnops ext2_spec_vnops ext2_fifo_vnops
MrCryo has joined #osdev
<heat>
ew
<heat>
that's a huge layering violation
<heat>
now your ext2 driver knows about device files and fifos and sockets
<dostoyevsky2>
netbsduser: That biscuit OS is also in Go. Interesting, but it's a bit large with 60M codesize, hard to read
<mjg>
netbsduser: found it, nullfs is lofs in solaris
srjek has joined #osdev
<heat>
what's nullfs, bind mounts?
<mjg>
ye, but worse
<heat>
lovely
bauen1 has quit [Ping timeout: 272 seconds]
<netbsduser>
dostoyevsky2: it's a nice idea and when i was younger i was all for dissing all the actually-existing kernels in favour of modern garbage collected things
<dostoyevsky2>
also in Biscuit OS it seems they've implemented their own standard library, I guess that's what one have to do to make work... but in LetsGoOS they didn't
<netbsduser>
but with experience you are disabused of these childish notions that you can go and build something better trivially
<heat>
discord switched a bunch of microservices from go to rust and basically eliminated long tail latency
<bslsk05>
google/codesearch - Fast, indexed regexp search over large file trees (372 forks/3496 stargazers/BSD-3-Clause)
<heat>
what?
<Ermine>
Discord rust client when
<Mutabah>
serenity?
<Mutabah>
altough that's not official
<netbsduser>
discord has a strict ban on custom clients
<heat>
Ermine, yeah no gc no latency
<netbsduser>
even though they appropriate the culture and hallmarks of IRC they are very much a deeply proprietary platform
<dostoyevsky2>
Seems in LetsGoOS they also wrote their own allocators, so they are not using the GC.. seems reasonable, just not sure how they can still use strings (which might be GCed sometimes)
<heat>
99% of discord users don't know what irc is
<Mutabah>
netbsduser: strict is a strong word
<dostoyevsky2>
Any OSes written in Rust you guys can recommend to look at?
<netbsduser>
Mutabah: it's not strong enough
<Mutabah>
technically yes... but they don't seem to be too ban happy on well-behaved custom clients
<Ermine>
Time for a joke: most keyboards in f-droid are libre
<netbsduser>
they are explicitly forbidden by their terms of service - you have no recourse
<Mutabah>
dostoyevsky2: redox is the famous one, but I've written one :)
<bslsk05>
thepowersgang/rust_os - An OS kernel written in rust. Non POSIX (45 forks/703 stargazers/NOASSERTION)
<heat>
Ermine, okay so given your keyboard doesn't work, how do you type?
<netbsduser>
now i should couch my words here somewhat
<netbsduser>
i actually like discord
<netbsduser>
it is the better of IRC in a lot of respects and if IRC had the userbase that discord had, it would be a full-time job for a large team to moderate channels
<netbsduser>
i was once invited to a matrix server to discuss something and it was unusable - full of porno bots and scam bots. discord to its credit has none of this
<Ermine>
heat: typing works, but it either sucks because of poor layout, or there are crippling bugs, or lack of features like clipboard management
<netbsduser>
on the other hand i detest the client's inflexibility, and especially the new android one is dreck - but there's no recourse, custom clients are strictly forbidden by ToS so you are inviting a permanent ban by using one
m257 has quit [Ping timeout: 250 seconds]
<dostoyevsky2>
Mutabah: rust_os is a great project. I like the smaller OS projects as it's usually easier to figure out what's going on in the code
<kof673>
eh...i have no idea of things, but that would seemingly allow selective enforcement...even if that is not the intention
<Ermine>
I reckon that nice gui framework for rust is yet to be done
<bslsk05>
froggey/Mezzano - An operating system written in Common Lisp (185 forks/3493 stargazers/MIT)
<netbsduser>
guis are inherently object oriented and the languages that prioritise that end up doing a much better job at them
<netbsduser>
in my opinion there is no reason to write a GUI in rust
<netbsduser>
(less yet in C)
<froggey>
dostoyevsky2: there's no syscall handler because there aren't any syscalls
<dostoyevsky2>
froggey: an OS without syscalls?
<froggey>
correct
<netbsduser>
why torture yourself with a language designed to provide for fearless concurrency and memory safety without tracing GC when these are absolutely irrelevant to an interface? business logic maybe, but the user interface doesn't need it
<Ermine>
Though I'd write core of a gui framework in C
<Ermine>
For interop purposes
* kof673
makes hand gestures "EM-VEE-CEE"
<dostoyevsky2>
Ermine: I guess when they eventually fulfill Rust's original intention to be used as a language for writing Firefox code we might also get some UI lib
<kof673>
or, that would imply each of those are loosely-coupled enough to allow them to differ
<dostoyevsky2>
froggey: I also had this idea of writing a minimal OS like: Just a normal program that loads an ELF binary and then runs it ... But the syscalls I'd need to convert into something that calls my code... I guess somethig like that has been done in gVisor and firecracker
<Ermine>
Actuallty, MFC MFC MFC
pebble has joined #osdev
<kof673>
well, just meant it is/was a thing to deliberately allow such separation of concerns
<kof673>
vaguely like x "mechanism, not policy" somewhat
eddof13 has joined #osdev
<ddevault>
okay, I've had my fun with libvterm
<ddevault>
this code is a mess
<ddevault>
need to separate the framebuffer code, and the early and late framebuffer consoles, then maybe I can try againb
<ddevault>
but on to bigger and better things
<dostoyevsky2>
ddevault: vterm does ecma-48 processing?
<ddevault>
yeah
<dostoyevsky2>
I also just got a gnu screen clone running, using some term lib
<ddevault>
it does not help that libvterm has no docs at all
<nikolar>
nice
<ddevault>
perhaps I should try again with libtsm
foudfou has quit [Remote host closed the connection]
<ghostbuster>
anyone got tips for reverse engineering a 32-bit arm kernel image in qemu? trying to figure out whether gdb can load a zimage or if i need to extract it first etc
foudfou has joined #osdev
<dostoyevsky2>
ghostbuster: Unpack the zimage and try loading it into Ghidra? Chances are that there will also be some ghidra python libs for 32bit arm for your usecase
Left_Turn has joined #osdev
foudfou has quit [Remote host closed the connection]
<clever>
ghostbuster: a zImage is a self-extracting binary
<bslsk05>
github.com: linux/arch/arm/boot/compressed/head.S at rpi-6.6.y · raspberrypi/linux · GitHub
<clever>
ghostbuster: this file forms the bulk of the naked assembly in a zImage, it will do some safety checks to ensure it doesnt overwrite itself, apply relocation patching to decompress.c, and then call decompress_kernel to unpack the real kernel
<clever>
if you just load the zImage directly into ghidra, and cross-reference to this file, you should be able to figure out the offset+length of the compressed blob, extract it, and uncompress it
<clever>
there may exist tooling to do that already
m257 has joined #osdev
<clever>
and __enter_kernel will jump to whatever physical address it unpacked itself to
<zid>
binwalk, clever
<clever>
28404 0x6EF4 gzip compressed data, maximum compression, from Unix, last modified: 1970-01-01 00:00:00 (null date)
m257 has quit [Client Quit]
<clever>
zid: oh, yeah, that did find something
eddof13 has quit [Quit: eddof13]
<clever>
not a purpose designed tool for unpacking a zImage, but good enough
<zid>
wouldn't it be easier to just.. give it to grub though?
<clever>
zid: i wasnt aware that grub could unpack this
<zid>
unpack?
<zid>
It can run it!
<clever>
yeah, but when do you get something you can shove into ghidra?
<zid>
why do you need to ghidra it, he said he wanted gdb to load it for some reason, just run it in grub + qemu then attach
<zid>
or extract, then gdb it
<clever>
ah, mixed up the follow up question from dostoyevsky2
<clever>
in that case its simple, just tell qemu to boot the kernel, and stop on the first clock cycle, to await gdb
foudfou has joined #osdev
<zid>
can qemu do the linux boot proto?
<clever>
yes
<zid>
I know grub can, which is why I suggested interposing grub, didn't know qemu could, til
<clever>
if you pass qemu a flat binary, it will just run it from some arbitrary address
<clever>
if you pass qemu an elf file, it will respect the LOAD headers, and entry point, and run it from the "proper" address
<clever>
and i believe it can auto-detect a linux kernel, load it to some arbitrary address, and setup the args/dtb as needed
<clever>
it probably does the dtb stuff in every case
<clever>
the linux-arm boot proto is pretty simple, just set a certain register to point to the atags/dtb, and jump to byte 0 of the kernel
<netbsduser>
they do a dead simple thing for -kernel on qemu-system-m68k -M virt
<bslsk05>
marin-m/vmlinux-to-elf - A tool to recover a fully analyzable .ELF from a raw kernel, through extracting the kernel symbol table (kallsyms) (122 forks/1224 stargazers/GPL-3.0)
<ghostbuster>
it's like binwalk 2.0
<ghostbuster>
bslsk05: that sounds perfect, thanks
<ghostbuster>
can i ask a more general question - does anyone use macOS as their host for qemu? or is it just easier to always use linux
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
<zid>
I used linux in a vm from windows :P
<zid>
windows -> vmware -> qemu -> my os -> my gameboy emulator
<clever>
zid: you monster! :D
<zid>
good software stack
<ghostbuster>
vm-ception
<clever>
i was recently messing with an rv32 emulator (running linux and doom), it gets about 30fps under linux
<clever>
i then cross-compiled it to windows, and ran it under wine, on the same linux, now it gets 3fps!
<clever>
need to dig into why
<dostoyevsky2>
ghostbuster: Linux is usually better supported by qemu... I am not even sure if qemu can run on m2 macs these days... and if you are using gdb on a mac it could be Xcode's lldb so then it might not be able to attach to qemu's gdbserver... better also try it on linux
<ghostbuster>
i ask because i'm much more comfortable as a developer on linux but i've been interested in emulating some apple stuff recently, which can only run on mac host, so it got me wondering how limiting it would be to use a mac host for everything
<clever>
ghostbuster: at my work, we have mac-mini's running linux, with darwin under qemu
eddof13 has quit [Quit: eddof13]
<clever>
the disk image for darwin gets rolled back on every reboot of the guest
<ghostbuster>
interesting
<clever>
so we can do darwin things with a linux host
<ghostbuster>
is that a licensing requirement though? or can you actually pass through to hardware more efficiently with darwin on apple hardware, even with linux in between
<clever>
the licensing requirement just says that darwin must be running on apple hardware
<clever>
hence why we are using mac-mini's
<ghostbuster>
gotcha
<clever>
but i tested everything on a random laptop i have at home
<ghostbuster>
how much of the macOS userspace does darwin include? it's more than just xnu i guess?
<bslsk05>
foxlet/macOS-Simple-KVM - Tools to set up a quick macOS VM in QEMU, accelerated by KVM. (1138 forks/13501 stargazers)
<clever>
dostoyevsky2: exactly
illis has joined #osdev
<clever>
dostoyevsky2: the biggest problem we ran into, is the nvme is on the apple security chip, for transparent encryption, and they didnt implement nvme properly
<clever>
so linux was unable to see the nvme drive
<ghostbuster>
this is x86 I take it?
<clever>
yep
<dostoyevsky2>
clever: I tried doing this on old macbook pro 2012s ... alas, Linux didn't really support the cpu fans well enough, so some macbooks overheated and died
xFCFFDFFFFEFFFAF has joined #osdev
<illis>
Hello, this is my first time on IRC, glad to see an active community here.
<ghostbuster>
i dumped the boot rom off an old iphone, wanted to see if i could boot it
<bslsk05>
github.com: nixpkgs/pkgs/os-specific/linux/kernel/mac-nvme-t2.patch at 13d5fc4232b00dd9f86007e52d400102915ef3e1 · NixOS/nixpkgs · GitHub
<clever>
this patch was required to access nvme on the mac-mini
<clever>
its missing in nixpkgs master, might be upstream'd now
illis has quit [Client Quit]
<ghostbuster>
i hope he had a good first IRC experience
<nikolapdp>
kek
<zid>
nikolapdp when is terry
<nikolapdp>
when do you want terry
<zid>
now?
MrCryo has quit [Quit: MrCryo]
MrCryo has joined #osdev
<nikolapdp>
no
eddof13 has joined #osdev
<zid>
not entirely sure why you asked me then :p
<dostoyevsky2>
ghostbuster: best thing about macos running inside qemu is it has 9p support... so you can easily mount the linux host's folders... it's not that easy these days to get macos use custom drivers
<ghostbuster>
neat
m257 has quit [Ping timeout: 250 seconds]
joe9 has joined #osdev
Turn_Left has joined #osdev
gsekulski has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
<dostoyevsky2>
I was looking at http://localhost:4017/eatonphil/go-amd64-emulator and thought it might not be that difficult to get sectorlisp or sectorc running in there, but then I realized that those still use x86 asm, not amd64...
<bslsk05>
eatonphil/go-amd64-emulator - Userland linux/amd64emulator in Go (5 forks/19 stargazers)
pebble|2 has joined #osdev
pebble|2 has quit [Remote host closed the connection]
pebble|2 has joined #osdev
pebble has quit [Ping timeout: 272 seconds]
pebble|2 has quit [Read error: Connection reset by peer]
osdev199 has joined #osdev
<heat>
linking localhost is a megabrain move
<heat>
quick everyone try out my website file://etc/shadow
<zid>
firefox seems to strip it? weird
<heat>
strip it?
<heat>
how?
<zid>
removes etc/
<heat>
my chrome says invalid_url because of the EACCES
<heat>
yeah firefox strips etc, weird
<heat>
oh, file:///etc/shadow
<osdev199>
Hello, the `wrmsr` instruction is hanging in my lapic timer driver code while setting the initial count for one-shot or periodic mode. I have no exception handlers set up atm. Earlier it was working when I didn't introduce the code for the same when the mode is tsc-deadline. Any idea? Thanks.
<zid>
wrmsr can hang?
<zid>
bug lockup?
<zid>
bus*
<heat>
i mean, probably
<heat>
lots of things can hang on x86 in byzantine ways
<heat>
osdev199, ok so: is this real hardware, under a hypervisor, emulator? how does the code look?
<bslsk05>
github.com: Raam/timer.c at 15606c82e1564c131be82add7c85a64bd2c3e4fd · robstat7/Raam · GitHub
<zid>
they clobber a bunch of regs and don't tell the compiler
<heat>
ooh {d} is a fun new way of doing printk
<zid>
so you could be doing mov rcx, count; mov ecx, 0x838; mov rax, ecx; wrmsr
<zid>
for example
<zid>
rax, rcx*
<heat>
yeah basically what zid said, you can't be touching random registers without telling the compiler. the compiler can't read your mind nor your inline asm
<dostoyevsky2>
heat: I am actually wondering what bslsk05 has to say about cloud init urls
<osdev199>
heat: I don't know the actual chip. From the init code, I know I have lapic enabled in x2APIC mode.
vikn has quit [Excess Flood]
<heat>
also you're doing too much in asm that you should be doing in C (e.g shifts and masks and checking if stuff is avail).
<heat>
like, basically use inline asm (or normal asm) for the bare minimum, everything else should be C
<heat>
"cpuid" isn't issuable in ISO standard C, so you need inline asm for that, but gathering the results and if'ing on that, that should all be C
<zid>
(and make your inline assembly actually correct, and then actually objdump it to verify it produced what you wanted)
<zid>
gcc has cpuid
<zid>
it's very robust and has a nice api, it's pretty cool
<bslsk05>
github.com: gcc/gcc/config/i386/cpuid.h at master · gcc-mirror/gcc · GitHub
<heat>
that is true, but i recently saw a weird failure that i'm not sure is gcc-cpuid-related
<heat>
it seems to be doing the wrong thing in ermine's CPU, where it sees AVX and XSAVE in the normal cpuid leaves, but then when it comes to getting xsave-specific leaves it tells me there isn't any
<zid>
errata woo
<heat>
yeah but... cpuid(1) does the right thing so?
<zid>
a bug *in* cpuid is hard to search errata for
<zid>
given cpuid appears 894389 times
vikn has joined #osdev
<heat>
i couldnt even find errata for his cpu
<heat>
it was an ivy bridge
xFCFFDFFFFEFFFAF has quit [Read error: Connection reset by peer]
<osdev199>
heat: Yea. Doing it in C is simpler. But if I want to make this inline assembly work, should I tell gcc about the clobbered regs? I'm new to inline asm.
<heat>
of course
<zid>
CPUID Extended Topology Enumeration Leaf May Indicate an Incorrect Number of Logical Processors
<zid>
closest I've found so far
<zid>
osdev199: yes, and I gave you an example of why
xenos1984 has joined #osdev
<osdev199>
Thanks.
<osdev199>
let me try that first!
<heat>
you'll also quickly realize most of what you wrote should be helper functions instead
<heat>
wrmsr? nah, write it once and put it in a static inline void wrmsr(u64 msr, u64 val)
<heat>
er, u32 msr I think?
<zid>
yea
<zid>
they're all either very low or 0x80000000 | low for some reason though
<zid>
I wonder if that's an internal status bit
<zid>
and it just shifts it down by 20 or whatever before it indexes it into some table
<heat>
there are also a bunch of 0xC0000000
<zid>
oh right yea C is what I meant anyway
<heat>
if i were to guess, 0xC.... is what AMD took for itself
<heat>
out of all the MSRs on my msr.h, the 0xC ones are all AMD
<heat>
EFER, GS base, syscall/sysret instruction
<heat>
then later stuff like the TSC_DEADLINE msr are back in the low numbers (intel feature)
<zid>
I assume the iastar and shit is the 0x800 ones right? cus they're intel only? amd64 spec was the shitty sysenter thing?
<gog>
larger number better
<gog>
no AMD always had syscall/sysret
<zid>
oh intel was the shitty sysenter?
<gog>
intel's fast sytem call was sysenter/sysexit
<heat>
yeah
<zid>
forgor
<gog>
i never used sysenter so idk how it compares to syscall
<zid>
afaik it's shitty, I looked at both
<zid>
but chose syscall
<heat>
bad move
<gog>
syscall is p easy
<zid>
syscall is also shitty
<zid>
WHEN FRED
<heat>
wait, is boros 32-bit?
<zid>
no
osdev199 has quit [Remote host closed the connection]
<zid>
I'm losing my mind though
<zid>
which one is fucking which
<heat>
ohhh apparently intel still implements sysenter for some reason
<heat>
intel is sysenter/exit, amd is syscall/ret
<zid>
which one is the iastar nonsense
<gog>
syscall
<zid>
yea I do syscall
<heat>
the STAR stuff is syscall yeah
<gog>
STAR, LSTAR and CSTAR
<heat>
both intel and amd implement syscall in 64-bit mode, intel implements sysenter in 32-bit and 64, amd implements syscall in 32-bit and 64
<mjg>
and now the language closes the fd for me, which is nice 'n all, but the file itself remained while on error should have been unlinked
<nikolar>
zid I'm pretty sure that would require some runtime type stuff
<heat>
i feel like you're trying to blame problems you're making up on the language itself
<mjg>
and rust own docs have this very bug
<mjg>
which part of 20:27 < mjg> the ? operator facilitates fucking up like that and the language does nothing to stop it, while it could
<mjg>
you don't understand
<heat>
i don't think it facilitates
<heat>
resource leaking in C is also very easy and it's way more verbosey
<zid>
good job that C does runtime type stuff all the time then
<Ermine>
hare hare hare hare hare
<heat>
and if you screw up a goto, you're mega screwed
<dostoyevsky2>
https://github.com/tathougies/hos <- seems like every programming language has it's OS these days... but I am not going to look for one written in PHP
<bslsk05>
tathougies/hos - The functional Haskell kernel (9 forks/125 stargazers)
<mjg>
of course erorr handling in c is shite
<mjg>
and error handling in rust when you have external state to clean up is even worse
<heat>
you could of course have handling for this with some sort of "created_file" type
<Ermine>
hare hare hare hare hare
<Ermine>
to change the discourse
<heat>
or temp_file or whatever
<dostoyevsky2>
I kind of like the error handling in shell scripts... print out an error message and just try to continue doing what you were doing
<heat>
you're basically arguing language-level RAII can't guess what you're doing so we should do error handling manually
<heat>
like, no, that's not what it means, just create better RAII types
<mjg>
i am arguing the language should fail to compile
<mjg>
if the programmer did not specify what to do
<dostoyevsky2>
mjg: One should write an OS in lean4
<heat>
i don't see what you mean
<mjg>
whatever, i have to split().unwrap()
<heat>
if you could exemplify your desired thingy, it'd be great
<heat>
basically my PoV is that if i'm writing a type with a dtor (telling the language how it should be released), and i'm wrong, it's my fault, not the language's
<nikolapdp>
Ermine have you tried hare
<Ermine>
nikolapdp: I've started the tutorial but I still didn't finish it. But I find hare very interesting
<dostoyevsky2>
Hare looks like Lua with pattern matching
srjek has quit [Ping timeout: 252 seconds]
<nikolapdp>
Hare is supposed to be the c++ that never was
<nikolapdp>
just slight improvements all over tha place
<nikolapdp>
instead of a complete change of paradigm
<Ermine>
wrong
<heat>
i've just disabled Wstring-plus-int temporarily for a macro
<heat>
where do i turn myself in
<nikolapdp>
Ermine what is
<nikolapdp>
heat what kind of macro are you writing
<Ermine>
At least I don't think c++ was created to fix C
<nikolapdp>
Ermine the name itself implies improvement no?
<nikolapdp>
i didn't say it was meant to fix c
<nikolapdp>
heat why the +10, is it so bad to have the PAGE_FLAG prefix
<heat>
it's too verbose
<heat>
PAGE_FLAG_ is implied in this context
<Ermine>
nikolapdp: C++ was invented as a high level language with access to low level stuff for efficiency
<heat>
i could try and do it at runtime, but that's also annoying. so + 10 seems like the more elegant solution, even if i need the silly pragma there
<nikolapdp>
Ermine that counts as an (attempted) improvement in my book
<nikolapdp>
heat: silly
<Ermine>
I've saw that kind of macro somewhere
<Ermine>
nikolapdp: fix your book then
<nikolapdp>
why use c as the base if not to improve it?
<nikolapdp>
either way, hare is c+bunch of language design improvements in the recent times
<Ermine>
Because Stroustrup had a phd thesis on that topic
<Ermine>
And I guess he had limited time
<dostoyevsky2>
nikolapdp: isn't pattern matching an enormous difference between Hare and C++?
<nikolapdp>
what do you mean
<dostoyevsky2>
nikolapdp: pattern matching is often an ingredient for enabling monads in a language, so it really changes everything substantially, so I cannot see it as C++ that isn't trying to be that different from it
<nikolapdp>
oh i am not saying you should look at it as c++ at all
<dostoyevsky2>
I guess if you have monads like in Haskell you don't need templates or the like, you can just wrap it all in monads
<nikolapdp>
eh what exactly do you consider monads
<dostoyevsky2>
nikolapdp: like you can have an iteration monad that works similar to how iteration with templates would work in C++
<dostoyevsky2>
But I guess the C++ version would all the specialized to the instantiations of the templates, and not sure if monads would ever get to that level, I guess it'd depend on the compiler
<nikolapdp>
eh i meant, can you describe what you need to implement for something to be called a monad
<dostoyevsky2>
> iterateM f mx n = sequence . take n . iterate (>>= f) $ mx
<dostoyevsky2>
that's similar to how you'd specify an iteration in C++ for a template, no?
<nikolapdp>
guess so
voidah has joined #osdev
<nikolapdp>
hare doesn't have generics/templates though
<bslsk05>
blog.regehr.org: Alive2 Part 1: Introduction – Embedded in Academia
<dostoyevsky2>
Also, transforming code into an SMT solver (like cprover does) isn't that hard, e.g. `a / 2 * 2 = a, a > 0' looks like that in z3: https://termbin.com/nhgg
<bslsk05>
'Making Simple Windows Driver in C' by Nir Lichtman (00:07:25)
<heat>
eclipse is great
<mjg>
is that i3-esque wm on windows?
<heat>
where's the eclipse stan guy we have around
<heat>
yep that's windows
<kof673>
>why use c as the base if not to improve it? you will have to look it up but c++ surely was meant to be interoperable and ease 'porting C' IIRC
<bslsk05>
retrocomputing.stackexchange.com: ms dos - Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit) - Retrocomputing Stack Exchange
<kof673>
that implies dos i guess but...
<nikolapdp>
ha no, borland c++ 3.1 bitch
<nikolapdp>
that's all you get
<kof673>
no i mean convo yesterday about such things
<Ermine>
Oh wow, some companies provide risc-v vpsen
<kof673>
some of those borland 4 or 5 or so are "freeware"
<nikolapdp>
yeah i got it
<nikolapdp>
i am jokin about my uni
<kof673>
my community college first programming class was qbasic
<bslsk05>
labs.scaleway.com: Elastic Metal RV1 | Scaleway Labs
<Ermine>
It's not free though
<nikolapdp>
that sounds handy for testing software on rv
<nikolapdp>
if you care about that sort of thing that is
<heat>
reminds me i should try the oracle thing
<Ermine>
yeah, that's what i'm talking about
zxrom has quit [Remote host closed the connection]
zxrom has joined #osdev
<xenos1984>
geist: I managed compiling / installing a freestanding libstdc++ with --disable-hosted-libstdcxx now and it works like a charm, without a C library or OS, but only a bare metal target. It gives me the freestanding headers required by C++23. Looks like C++26 headers are not yet supported (GCC 14.1.0). In case you would like to add this to your toolchains - this is my build script: https://github.com/xenos1984/cross-t
<xenos1984>
urce-compile/toolchain.sh#L51-L55
gsekulski has joined #osdev
<Ermine>
2026 will only start in 1.5 years
<nikolapdp>
why are you doing that Ermine
<Ermine>
what
<nikolapdp>
making everyone here feel old
gsekulski has quit [Ping timeout: 255 seconds]
<Ermine>
I also see everyone is piling NPUs in their SoCs, no matter how shite is CPU
<heat>
a large portion of riscv boards are just AI hype crap
<geist>
xenos1984: oh very cool!
<heat>
yo geist can i get a very cool too
<heat>
mjg is a meanie
<geist>
now i'm torn, if i start using it in LK then it puts a hard requirement on it, which is probably untenable to lots of folks downstream
<nikolapdp>
Ermine, you don't get it
<nikolapdp>
everyone needs to do ai
spareproject has joined #osdev
* dostoyevsky
runs nikolapdp throught the Not Hotdog app
<nikolapdp>
i don't even know what that means
<Ermine>
And are these npus any good against like cuda
<nikolapdp>
honestly, doubt it
<nikolapdp>
they are probably very specialized for specific kind of matrix multiplication and that's it
<bslsk05>
'Jian Yang: hotdog identifying app' by viet anh le (00:03:08)
<childlikempress>
gonna make an app called hot dog identifying app or not hot dog identifying app?
* kof673
inserts koan about recursion
<FireFly>
childlikempress: "hot dog or not dog"
<FireFly>
(the app that lets you classify pictures into "sausage" and "not a canis")
<childlikempress>
!! untapped market opportunity
childlikempress is now known as Mondenkind
<gorgonical>
I am getting really trolled by doubly-linked lists today and I have had it
<Mondenkind>
just use rust
<Mondenkind>
and you won't be able to write any doubly-linked lists
<zid>
disregard linked lists, acquire zidlists
<gorgonical>
I have no fucking idea how these list entries are getting out of order and causing this loop but I have instead decided to use an indexed array
<zid>
ah yes, you have learned the zidlist's pwoer
<heat>
you're missing a lock
<zid>
a zidlist is where you make a linked list, but you allocate it out of an indexed array, so you can qsort the array to sort the list
<heat>
or double inserting
<gorgonical>
There's only one core heat
<zid>
then just relink 1 to 0, 2 to 1, etc
<heat>
you're double inserting
<gorgonical>
The behavior I observe is that somehow after enough list_add_tail()s instead of pointing to the head list_struct the last one points to the first element, list->next
<gorgonical>
And then list_del() of course begins doing the wrong thing
<zid>
make sure you handle the empty list case correctly is all I can guess
<zid>
I'm constantly fucking that up when I allow tail insertion
<gorgonical>
I think it's probably something like that
<gorgonical>
But after realizing I don't actually *need* a linked list I decided not to use one
<zid>
I always forget I need to reinitialize it if I pop the final element of a list
<zid>
it doesn't seem like you'd *need* to do it, but you do, idk why
<gorgonical>
if you have just one element, then shouldn't prev,next point to itself after deleting the last element?
<zid>
The list pointer should be null
<heat>
no
<heat>
if you have one element, it'll point to the list head
<heat>
if you have 0 elements, the list head points to itself
<gorgonical>
right
<gorgonical>
so then last element deletion has no special-case right
<zid>
the first thing you add should be prev == next == this
<zid>
rather than nulls
<gorgonical>
yes
<zid>
which is the weird case for the double
<gorgonical>
How? head.next = n1. head.prev also = n1. n1.prev,next = head
<heat>
how what?
<zid>
that's correct
<gorgonical>
how's that a weird case then?
<heat>
what?
<kof673>
my terminology: array list (for zidlist) singly, doubly circular singly, circular doubly
<zid>
n1.prev,next = n1 would be, rather
<zid>
wtf is head
<Mondenkind>
zid: wtf is the point of a zidlist
<nikolapdp>
random indexing i imagine
<kof673>
^^^ it doesn't need malloc for one but lol
<kof673>
contiguous
<kof673>
maybe "wins" on locality
<gorgonical>
Oh I did leave out that these are circular
<bslsk05>
'[001] IBM i (AS/400): Databases all the way down...' by Mainframes & More with Matthew (00:08:02)
<kof673>
not the same perhaps, but i believe "the database is the app/userland" was common in the 1960s
<nikolapdp>
heh that's very interesting
gog has joined #osdev
<dostoyevsky2>
I guess one could write a simple io -> memory driver for sqlite and then embed it in the kernel and then you could design all your kernels data structures in SQL... Might have some problems with multi-threading though ;)
<heat>
that will land you in jail once i become president of the world
<nikolapdp>
sqlite actually handles many accesses at once just fine
<nikolapdp>
might be slow though but it will be correct :P
<dostoyevsky2>
You could mount a file system and if someone wants to unmount you could just rollback the transaction
<heat>
i would use mongodb because it's web scale
<Ermine>
for scale you use cassandra
<dostoyevsky2>
nikolapdp: one could popup a modal blinking dialog while the database is vacuuming
<nikolapdp>
you could use cockroachdb for distributed computing :P
<heat>
>Programming language: Java
<heat>
no i'll stick with mongodb
<dostoyevsky2>
cockroachdb is written in Go, no?
<Ermine>
surprisingly enough, highload people use cassandra
<heat>
i checked cassandra
<dostoyevsky2>
If Cockroach University ever did teach me anything
<Ermine>
including discord
<heat>
cockroach uni sounds like a homeless thing
<nikolapdp>
has anyone tried using sqlite database as a filesystem
<heat>
yeah java is perfectly fine and high performance if you're a good java programmer and know the jvm in and out
<heat>
uhhh, surely someone, check fuse
<nikolapdp>
by that i mean using a raw block device as a backing storagwe
<bslsk05>
'Cockroach University: Intro to Getting Started with CockroachDB' by CockroachDB (00:03:10)
<heat>
fwiw i should check if onyx can run mongodb
<heat>
and set up a nice little cute WEBSCALE stack
<dostoyevsky2>
I guess the teachers are nicknamed Cockroachies or the like
<dostoyevsky2>
heat: Does mongodb even have transactions?
<heat>
surely
<nikolapdp>
i think it does
<Ermine>
it has compare-and-set afaik
<Ermine>
in a book on hft i have there's a chapter on using java for hft
<heat>
gosh i would *not* use java for hft
<heat>
the gang hits a gc pause
<Mondenkind>
there's realtime gc
<Ermine>
i'd not too
<nikolapdp>
there is yeah
<Mondenkind>
though i think more usually they just avoid allocating
<nikolapdp>
and it's apparently good
<Ermine>
But apparently it is possible to use java
<heat>
how do you avoid allocating in java?
<heat>
everything that's not a primitive type needs a new
<Ermine>
idk
<Mondenkind>
well there's escape analysis
<Mondenkind>
but other than that you preallocate
<heat>
they do that?
<Ermine>
i didn't read that chapter
<heat>
if escape analysis can move your new's to the stack, that's pretty sweet and makes me feel severely less bad about using java from time to time
<Mondenkind>
the gc also makes allocation faster than it would be with say malloc/free
<Mondenkind>
but yeah they can stack allocate stuff
<dostoyevsky2>
heat: For HFT they just minimize heap allocations... e.g. custom string types or the like... the other thing is you can just turn off the GC and then restart during the night... or run the GC once every 24h... And you can easily have like 10TB of ram these days
<Mondenkind>
your cache might not be very happy with you if you leak everything
<dostoyevsky2>
heat: Does Java use the stack for object storage? I thought they only store on the heap, so no escape analysis... but Go they use Escape anaylysis if you pass around by value ... but Java also only can pass by reference
<heat>
yes apparently they can perform escape analysis to avoid the heap