klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
Maja has quit [Ping timeout: 246 seconds]
<mcrod> heat
<geist> dat heat!
<mjg> mon i got another flame to write about linux
<mjg> at this point i may just want to take a break
<mjg> bsd-level breakage
netbsduser` has quit [Ping timeout: 240 seconds]
agent314 has quit [Remote host closed the connection]
[itchyjunk] has joined #osdev
FreeFull has quit []
<heat> mjg you should take software less seriously
<mcrod> i just made a powerpoint of 22 slides
<mcrod> i'm super corporate now
<heat> yes you are
<heat> hail corporate
* mcrod bow
* heat spear
<mcrod> :(
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
MiningMarsh has quit [Ping timeout: 246 seconds]
troseman has joined #osdev
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
heat has quit [Quit: Client closed]
terminalpusher has joined #osdev
heat has joined #osdev
<Mondenkind> mcrod: just put a hammer and sickle logo in the bottom corner of every slide and you're good
<Mondenkind> mjg: come on you can't blue ball me like this
<heat> kinky
duderonomy has joined #osdev
netbsduser` has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
terminalpusher has quit [Remote host closed the connection]
terminalpusher has joined #osdev
netbsduser` has quit [Ping timeout: 246 seconds]
terminalpusher has quit [Ping timeout: 246 seconds]
SGautam has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
netbsduser` has joined #osdev
netbsduser` has quit [Ping timeout: 256 seconds]
gog has quit [Ping timeout: 246 seconds]
<sham1> I think you'll find that he can
troseman has quit [Quit: troseman]
Valeria22 has quit [Quit: Konversation terminated!]
netbsduser` has joined #osdev
Jari-- has joined #osdev
bradd has quit [Remote host closed the connection]
netbsduser` has quit [Ping timeout: 250 seconds]
SGautam has quit [Quit: Connection closed for inactivity]
Jari-- has quit [Ping timeout: 260 seconds]
bgs has joined #osdev
goliath has joined #osdev
gabi-250 has quit [Remote host closed the connection]
gabi-250 has joined #osdev
netbsduser` has joined #osdev
kof123 has quit [Ping timeout: 252 seconds]
<ddevault> well, it's a start https://l.sr.ht/AIRa.png
nyah has joined #osdev
<mjg> heat: 90% of real world software development is writing rants about it
<mjg> heat: a trade secret
<ddevault> this look familiar to anyone?
<ddevault> don't know much about C++ tbh
GeDaMo has joined #osdev
<Mutabah> the top of the backtrace is `abort`...
<Mutabah> at a guess, something threw an exception when it wasn't expected to - or with no unwind support
<sham1> Some kind of an exception from a destructor
<sham1> Because from the stack trace it looks like it's destructing global objects
<sham1> Although it could also be the unwind code
<ddevault> yeah, it's in unwind-dw2-fde.c
<ddevault> hits a gcc_unreachable in base_from_object examining what looks like DWARF bits?
bauen1 has quit [Ping timeout: 245 seconds]
Left_Turn has joined #osdev
Burgundy has joined #osdev
<ddevault> meh, binutils expects a rather posix system
gog has joined #osdev
netbsduser` has quit [Remote host closed the connection]
netbsduser` has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
netbsduser` has quit [Ping timeout: 246 seconds]
bauen1 has joined #osdev
[itchyjunk] has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 256 seconds]
Left_Turn has quit [Remote host closed the connection]
Left_Turn has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
phoooo has joined #osdev
Left_Turn has joined #osdev
bas1l has joined #osdev
Ellenor has joined #osdev
bauen1 has quit [*.net *.split]
zhiayang has quit [*.net *.split]
nvmd has quit [*.net *.split]
divine has quit [*.net *.split]
bliminse has quit [*.net *.split]
rorx has quit [*.net *.split]
mavhq has quit [*.net *.split]
Mutabah has quit [*.net *.split]
AmyMalik has quit [*.net *.split]
meisaka has quit [*.net *.split]
basil has quit [*.net *.split]
drakonis has quit [*.net *.split]
ppmathis has quit [*.net *.split]
zhiayang has joined #osdev
divine has joined #osdev
nvmd has joined #osdev
mavhq has joined #osdev
rorx has joined #osdev
Mutabah has joined #osdev
meisaka has joined #osdev
ppmathis has joined #osdev
bauen1 has joined #osdev
bliminse has joined #osdev
drakonis has joined #osdev
Ellenor is now known as AmyMalik
terminalpusher has joined #osdev
MiningMarsh has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
terminalpusher has quit [Remote host closed the connection]
<phoooo> question, does qemu (riscv) with bios none fill the fdt entries?
zxrom has quit [Quit: Leaving]
<phoooo> i am just getting the root entry and anything else
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<phoooo> nevermind, solved it!
phoooo has quit [Quit: Client closed]
phoooo has joined #osdev
phoooo has quit [Quit: Client closed]
Left_Turn has joined #osdev
Turn_Left has joined #osdev
netbsduser has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
gareppa has joined #osdev
danilogondolfo has joined #osdev
Turn_Left has quit [Ping timeout: 256 seconds]
Turn_Left has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 245 seconds]
Vercas2 has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas2 is now known as Vercas
gabi-250 has quit [Remote host closed the connection]
gabi-250 has joined #osdev
Maja_ has joined #osdev
Maja_ has quit [Remote host closed the connection]
goliath has quit [Quit: SIGSEGV]
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
Valeria22 has joined #osdev
elastic_dog has quit [Ping timeout: 248 seconds]
<dzwdz> is it possible to use gcc's default limits.h while also extending it with my own defines?
<dzwdz> assuming it even comes with a default limits.h, which i think it does?
osdever has joined #osdev
<osdever> hello, here i am, i am working on my OS
<heat> yes it is
<heat> dzwdz, add a limits.h to your sysroot that does #include_next <limits.h>
<osdever> heat: thanks, you are doing the same?
<heat> the compiler stops giving you a limits.h when your target isn't bare
<heat> osdever, what?
<osdever> heat: working on your OS
<heat> yes
<dzwdz> error: no include path in which to search for limits.h
<heat> what's your target?
<osdever> dzwdz: it sounds like your GCC has no sysroot support, you have erred
elastic_dog has joined #osdev
goliath has joined #osdev
<dzwdz> heat: i have a custom toolchain, this seems to only occur when compiling with -ffreestanding
<dzwdz> but i'm yet to verify
<heat> custom toolchain? custom target you mean?
<dzwdz> yes
<heat> because yes those will not have a compiler-supplied limits.h anymore
<heat> this is where you write your own, congrats
<dzwdz> that sounds suboptimal
<heat> nope
<heat> its the solution
<heat> entirely OPTIMAL
<osdever> you may use one of the libcs which are popular
<osdever> for example: Dietlibc, uclibc, ulibc, pdpclibc, pdlibc, mlibc, musl, or glibc
<dzwdz> the compiler knows the sizes of the types it uses better than i do
<heat> actually no
<dzwdz> brb
<heat> the sizes are pretty constant
<heat> the limits are also pretty constant, basically 2's complement shit
<heat> the big thing that varies is that size of long and thus its limits
<heat> the size*
<heat> for like anything linux supports, char is 1 (as it must be, per the spec), CHAR_BITS is 8 (as it must be, per POSIX), short is 2, int is 4
<osdever> sometimes is int 8, or even 2
nvmd has quit [Quit: WeeChat 3.8]
<heat> >for like anything linux supports,
<osdever> i do not run linux, no no
<gog> hi
<gog> is int ever 8? depends on the target and the compiler
<gog> i've never seen it be 8
<heat> no
<gog> i don't even know what it tastes like
<heat> not on LP64 at least
<gog> heat
<gog> do you see what i did there
<heat> gog
<gog> do you C what i did there
<gog> heat
<heat> haha
<gog> haha
<heat> hilarious
<gog> ikr
<heat> gog comedy gog comedy
<gog> i'm having a not great day :|
<heat> why
<Cindy> mew
<gog> because i suck at my job
<heat> waz wrong
<heat> you dont
<gog> we're deploying a long-delayed feature of mine
<gog> and i had to rush because the requirements changed last minute
<gog> i think it's ok now
<gog> but it's been so delayed and it's my fault
<heat> sounds like
<heat> sounds like its not your problem
<gog> it is though
<heat> >the requirements changed last minute
<heat> boohoo bitchez, not ur fault
<gog> they wouldn't have changed if i had finished it sooner
<gog> nobody is mad at me
<gog> my boss is excited to get this released because it eliminates about 2000 lines of bad copypasta code
<gog> and it's a critical feature
<gog> but i'm like
<gog> aaaaaaaaaaaaaaaaa
<gog> we've been dogfooding it for a month
<gog> i've fixed so many bugs and refactored it twice
<dzwdz> i think i'm going insane
<gog> me too
<dzwdz> limits.h was working for me on a custom target as long as i had a dummy sysroot with an empty /usr/include/limits.h
<heat> so
<heat> erm
<dzwdz> i was reworking the build system and it broke
<heat> you didn't have a limits.h
<heat> >i had a dummy sysroot with an empty /usr/include/limits.h
<dzwdz> yup
<heat> no shit
<dzwdz> wdym?
<heat> you're saying you had a dummy limits.h in your sysroot and include <limits.h> worked
<heat> no shit
<dzwdz> and i got LONG_MAX etc
<heat> but you weren't including the real thing
<heat> no way
<dzwdz> the limits.h was because gcc was including include-fixed/limits.h
<dzwdz> which has an #include_next <limits.h>
<heat> >include-fixed
<heat> yikes
<heat> yikes
<heat> yikes
<heat> can you just roll your own kthxbye
<osdever> yes gcc also fixed my includes from newlibc
<osdever> although i had to butcher newlibto make it fit my kernel respective
<osdever> i don't design a linux clone
<osdever> i read Windows Internals and do similarly but not the same
<bslsk05> ​edk2.groups.io: [RFC PATCH 1/1] MdePkg: Add a libc implementation
<heat> you can yank my shit from limits.h
<heat> should be fairly portable
<osdever> LibcLibc is a new portable libc like dietlib, newlib, musl, mlib?
<heat> just replace #if defined(MDE_CPU_X64) || defined (MDE_CPU_AARCH64) with #if defined(__x86_64__) || defined(__aarch64__)... etc
<heat> osdever, no
<heat> and musl isn't portable
<dzwdz> that will make two files i've ripped off people here
<dzwdz> thanks
<osdever> heat: i don't use it, but i read it is top choice of osdever
<osdever> at first i considered it but i chose newlibc instead
<osdever> but newlibc doesn't satisfy me fully because it is small, lacking, and it is much posix-oriented
<heat> dzwdz, aktshually
<heat> i think there's a better define for that
<heat> __LP64__?
<heat> yeah LP64 is what you want here
<heat> __LP64__
carbonfiber has quit [Quit: Connection closed for inactivity]
kingoffrance has joined #osdev
<osdever> does anyone else write an os more like windows than like linux and bsd?
<gog> i don't write an OS
<gog> but also there's reactos
<gog> which is specifically a reimplementation of the NT kernel
<Ermine> I write atrocities rn
<sham1> Yeah, bold of you to assume that I do osdev
<Ermine> gog: may I pet you
<gog> i write sins, not tragedies
<gog> Ermine: yes
* Ermine pets gog
<osdever> i like to look at reactos
* gog prr
<osdever> but i don't want to imitate NT precisely, it's just inspiration
<Ermine> There's also NeptuneOS which does NT but they use seL4
<osdever> i will even use a good idea if it comes from linux
<sham1> Well the reason that people do more POSIX-oriented stuff is because, well, POSIX exists. We know how that looks like
<gog> they implemeted NT as a service running on seL4?
<gog> neat
<gog> kinda like mklinux almost
<osdever> i think it will be nice if i can implement linux style Remote Copy Update
<sham1> While if you get inspired by NT... well, what does that look like?
* kingoffrance .oO( developers! developers! developers! )
<gog> ZwDoTheThingButKernelMode()
<heat> ah yes, remote copy update
<heat> the RCU!
<gog> i'm trhowing away my rcu, jojo!
<osdever> sham1: everything is an object controlled by the object manager which is also the underlying "file system", the io is done by request packets, devices are treated like files, there is dpcs to realize deferred processing of work
<Ermine> I also heard of XT architecture which claims to be derived from NT
<kingoffrance> i will basically end (or rather, start, then build atop) up like that: "Burroughs Large Systems", wikipedia: No Assembly language or assembler; all system software written in an extended variety of ALGOL 60 named ESPOL. However, ESPOL had statements for each of the syllables in the architecture.
<kingoffrance> however, there will be "instructions" to point to functions that implement new instructions, meta all the way down
<kingoffrance> 1960s hardware, in software, today!
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
<osdever> heat: yes
<osdever> i think it is smart
<heat> the joke is that you butchered the name
<heat> also no you cant haha its patented!
* gog patents heat
<osdever> has the patent really not runout yet
<heat> there are dozens
<heat> capitalist gog
<gog> 5442758 is still valid
<sham1> kingoffrance: but that's just assembler but Algol
<gog> or maybe not idk
<Ermine> socialist heat?
<gog> anyhow it's 5 im gonna go home comrades
<gog> arise ye workers from your slumbers
<gog> and go home to tak ea lil nap
<GeDaMo> There are processors where the assembly language is just Forth
<heat> arise ye works from your office chairs
<osdever> hopefully most of the patents are outdated
<sham1> Choppers
gog has quit [Quit: Konversation terminated!]
<osdever> then they will be useful to study to learn about rcu
<heat> no
<Ermine> google claims 5442758 is outdated
<heat> studying from patents is death by 1000 cuts
* kingoffrance awards sham1 magical double vision points
<kingoffrance> blessed are though sham1, for you have seen through the word games
<kingoffrance> *thou
<sham1> yes
<kingoffrance> https://forum.amiga.org/index.php?topic=25333.0 They allegedly made over $50 million out of that patent.
<bslsk05> ​forum.amiga.org: Commodore and XOR patent - Page 1
<heat> mjg, oi bruv you around mate?
<osdever> i just read that FreeBSD now having their own rcu style
<osdever> they call it EPOCH
<osdever> but i didnt read about it yet so maybe the phoronix guy is a liar and it has nothing todo with rcu
nvmd has joined #osdev
<Ermine> Phoronix guy definitely can't into osdev
<osdever> yes alot of people who talk about operating systems know nothing about them
<osdever> especially me
<osdever> but aslo so many phoronix forum ppl
<sham1> Moronix
* sham1 runs
<Ermine> Phoronix forum ppl are even worse, so they spread bullshit and disinformation
xenos1984 has quit [Ping timeout: 246 seconds]
<Ermine> sham1: this is correct denomination
<mjg> heat: well ofc mate
<heat> i was going to ask you wtf kind of shit SCHED_4BSD is doing
<heat> does it have a huge lock?
xenos1984 has joined #osdev
<heat> sched_tdcnt is just an int
<heat> nothing else, just an int
gog has joined #osdev
<Ermine> 4BSD scheduler?
<heat> freebsd's scheduler
<gog> meow
<Ermine> SCHED_GOG would be better ide
<Ermine> idea
<gog> SCHED_GOG ignores all tasks and plays video games instead
<Ermine> Nah, that's SCHED_ERMINE
<gog> dang
<mjg> heat: it has one global lock
<heat> cheers mjg, im crying
<mjg> heat: it is the legacy scheduler. interestingly the one global lock is not ultra tragic at a handful of cores in a real workload
<mjg> i profiled it out of curiosity
<mjg> in fact it got me wondering if per-cpu locking for schedulers is way too far
<mjg> if you could have info about, say, 4 cores under one lock you could make more informed decisions
<mjg> without a tradeoff
<mjg> not that sched_4bsd is making them
<heat> >be mjg >profile something that looks stupid just be upset and say its PESSIMAL >its not PESSIMAL >its not PESSIMAL?
<mjg> what?
<heat> it's a meme
<heat> anyway that's cool
<mjg> sorry mate, i don't hang out in fortnite
<mjg> but now that i mention it, i think BFS had a global or close to it lock?
<mjg> anyway don't look at 4bsd, it is CRAP
<mjg> people like to claim the old stuff was fit for the period or whatever
<mjg> but that's rarely true
<heat> i was just trying to understand how loadavg work
<heat> s
<heat> because fuck maths
<mjg> lmao
<mjg> loadavg is another lol metric
<mjg> lolled into oblivion on linux
<heat> just a sec rebooting into a superior loadavg-less operating system
<mjg> to thep oint where one of i think scheduler devs referred to it as "silly"
heat has quit [Remote host closed the connection]
<gog> get a load of this average
<gog> 17:56:39 up 20 min, 3 users, load average: 1.68, 1.12, 0.69
<gog> 3 users?
danilogondolfo has quit [Quit: Leaving]
<mjg> you, your wife, cat?
<gog> oh it has me logged in on pts/1 and /2
heat has joined #osdev
<Ermine> I've read about thise numbers but idr what do they mean
<gog> they don't mean anything
<gog> they're nonsense numbers like bogomips
<heat> they mean something
<heat> count of runnable + UNINTERRUPTIBLE sleep processes/threads over 5 mins, 10 mins, 15 mins
<mjg> aight mofo here comes a quiz
<heat> quiz me bitch
<mjg> you have load of 1
<dzwdz> doesn't linux count processes waiting on io too?
<dzwdz> or is that also uninterruptible sleep
<mjg> you kill the task, wait a minute
<mjg> what's the load now
<heat> yes, uninterruptible
<dzwdz> ok
<heat> mjg: not 0 but not 1
<heat> some moving average of that shit
<mjg> maybe half then?
<gog> 0.69
<gog> 4.20
<mjg> gog: close!
<mjg> it is about 0.75
<heat> no, not half, ofc not
<dzwdz> so does read() on linux never return EINTR?
<heat> dzwdz: wrong IO there
<zid> O_NONBLOCK
<sham1> O_YESBLOCK
<zid> O_MAYBEBLOCK
<nikolar> Isn't it some exponential decay type od thing
<heat> dzwdz: when they measure IO, they mean block IO
<mjg> bottom line on linukkkz la can be through the roof and there is no real problem
<sham1> O_BLOCKMEDADDY
<mjg> i don't even know if DEVOPS KURW^W even look at it today
<mjg> seems like an old timer metric
<heat> GNU make does
<nikolar> In a steady state, it's supposed to be the count of active processes, but anything other than it is mystery
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 245 seconds]
<sham1> Stop cursing out devops
heat has quit [Quit: Client closed]
<gog> hi
heat has joined #osdev
<nikolar> hello
<zid> gog, curse out devops with me
<gog> heck you devops
<gog> so dang devoppy
<zid> Those bastards and their vops they keep de- ing
<zid> why not be PRO vops
<bslsk05> ​redirect -> www.reddit.com: Reddit - Dive into anything
osdever has quit [Quit: NT]
* kingoffrance obligatory waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaterfall
<heat> yay i got load averages
<zid> I think one of the major charactrs in my book is doing a lelouch
phoooo has joined #osdev
<phoooo> hi! just out of curiosity, what happens if i rewrite the dtb/fdt?
bauen1 has quit [Ping timeout: 245 seconds]
<phoooo> technically it is loaded in normal memory (not mmio) so it should be fine
<clever> phoooo: i believe its just normal ram, so you can modify parts of it or just reuse it as regular ram, once your done extracting data from it
<phoooo> yeah, that's my conclusion too; but i was afraid to have some *side efects*
<zid> well some code would have to run that read it, for that to happen
<zid> so.. do you believe you have spooky ghost code running, like an x86?
flx- has quit [Ping timeout: 240 seconds]
<phoooo> no, no
<phoooo> it's just me and my code
<heat> you could have the side effect of crashing the whole machine if its read-nly or something
<phoooo> it's just regular ram, i map it rw later
<phoooo> at least in the virt board
<heat> exactly
<heat> you can't be sure
<heat> and AFAIK nothing guarantees you that
<phoooo> i mean, if for some reason it is not regular ram, i wont be able to access it whatsoever
<heat> no
<heat> could be MMIO, could be write-protected
<phoooo> yeah, of course, but i was referring to the fact that if it is regular ram, my allocator just marks it free
<phoooo> and therefore gives it to whatever asks for memory
<phoooo> but if it is mmio, that wont happen
gareppa has quit [Quit: WeeChat 3.8]
<heat> you should be reserving that range anyway
<phoooo> alright
<phoooo> will do so then
<heat> also consider libfdt uses it continuously throughout the kernel's runtime
<heat> it never dynamically allocates
<heat> so even if you're not using it, being able to reclaim that space is pretty unexplored space
<phoooo> okay
<phoooo> thanks!
stolen has joined #osdev
tomith 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!]
heat has quit [Remote host closed the connection]
heat has joined #osdev
phoooo has quit [Ping timeout: 246 seconds]
benlyn has joined #osdev
<bslsk05> ​github.com: lk-overlay/app/inter-arch/inter-arch.c at master · librerpi/lk-overlay · GitHub
<clever> heat: when i wrote some custom FDT parsing code, i used fdt_next_node() to walk the tree, and as i encounter interesting nodes, i copy the values off to global vars
<clever> once this loop has finished, the dtb in ram no longer serves any purpose, and nothing points to it
<clever> so i can just treat it as free ram
phoooo has joined #osdev
<phoooo> clever: is that guaranteed to always work?
<clever> phoooo: when the dtb is in regular ram, yeah
<clever> its just binary data, nothing makes it magical
gorgonical has joined #osdev
<phoooo> okay okay
<gorgonical> Turns out trying to use Linux's spinlock interface for a cross-kernel shared lock is a bad idea
<phoooo> but that's in case I don't use libfdt
<phoooo> that is, if I just get the desired data and don't care about the binary representation anymore
<phoooo> anyway, thanks for the info
<heat> gorgonical, lol what
<gorgonical> heat: who knew that the kernel implementation of spinlocks has extra semantic information? lol
<gorgonical> not me, apparently
<heat> ticket locks should be pretty safe apart from preempt_disable/enable
<heat> i know their qspinlocks are a bit fucked
<gorgonical> anyway, I am using a spinlock to coordinate between my kernel and linux and if you acquire a spinlock linux forbids you from sleeping
<heat> really need percpu
<heat> yep
<gorgonical> But in my case I still think it'
<clever> gorgonical: ive made the mistake of using a mutex (will sleep when a conflict is found) from within an irq handler
<clever> but that wasnt setup as a fatal error
<clever> so instead, it only blew up when a thread tried to grab a mutex its already owning
<gorgonical> hmm
<heat> you just need to use one of the many options that help you debug that
<clever> the irq handler temporarily borrows whatever thread it happens to interrupt
<heat> including lockdep
<heat> and classic may_sleep(); calls around the kernle
<gorgonical> heat: I know what the problem is and exactly where it happens, just I need to change how the driver works
<gorgonical> But this didn't happen with my QEMU kernel so I must have changed some config
benlyn has quit [Ping timeout: 248 seconds]
<gorgonical> What's the "correct" lock to use here then, from Linux's perspective?
<heat> none
<heat> they all require coordination
<gorgonical> How do you mean?
<heat> mutexes require shared threads (task_struct*)
<gorgonical> Or you mean that I need to reimplement a lock thing here
<heat> spinlocks sometimes require shared percpu areas
<heat> and dont allow sleeping if you *really* need to sleep
<heat> semaphores work like mutexes, rw sems work like mutexes
<heat> you should really state your problem
<heat> not the crash :)
<gorgonical> Okay yes. I have an inter-kernel channel that is just implemented as two one-way buffers between the two kernels
<gorgonical> I have a state machine in my driver that coordinates the protocol between them, but I need a single bit of information to indicate state, which in this case is who has the write lock
<heat> have you tried seqlocks?
<heat> seqlocks sound perfect here, maybe
<gorgonical> I haven't heard of them but I also have little experience in careful smp grounds
netbsduser has quit [Ping timeout: 256 seconds]
<heat> but like, a manual seqlock
<heat> so the idea is that you have a shared u32 or something
phoooo has quit [Quit: Client closed]
<heat> when reading, you check if the sequence counter is even (if not, someone's writing, and you wait for that), then you do your read, and then you check if no one wrote in the meanwhile
<gorgonical> I guess a seqlock does encode part of what I've got in my protocol
<heat> writers take a lock (need to serialize against any other writers, skippable here), bump the sequence, do the write, end the write
<heat> ending the write means bumping the seq again
<heat> i've seen seqlocks (as an idea) be used across user <-> kernel or KVM <-> kernel barriers
<gorgonical> So the value is that by reading the sequence number before and after data read you can tell if someone changed the data
<gorgonical> Because otherwise I don't see any more information in this than a write lock
<heat> yes, and if someone is changing it you just actively wait
<gorgonical> Because what i have now is A takes lock, sends notification to B, B reads, sends ack to A, A releases lock
<gorgonical> The general probl
<gorgonical> This protocol is really dumb and lockstep, but it's easy
netbsduser has joined #osdev
<gorgonical> Because with this lockstep I don't need a queue. You can be either idle, reading, or writing, and you cannot transition between reading and writing
bauen1 has joined #osdev
Left_Turn has joined #osdev
vdamewood has joined #osdev
Turn_Left has quit [Ping timeout: 245 seconds]
dude12312414 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
SGautam has joined #osdev
<dzwdz> gcc reads $SYSROOT/usr/include/ during the build, right?
[itchyjunk] has quit [Ping timeout: 256 seconds]
goliath has quit [Quit: SIGSEGV]
[itchyjunk] has joined #osdev
<mcrod> hi
troseman has joined #osdev
bgs has quit [Remote host closed the connection]
heat_ has joined #osdev
heat has quit [Ping timeout: 246 seconds]
stolen has quit [Quit: Connection closed for inactivity]
<heat_> dzwdz, yes
<heat_> pass -v and you'll see include search paths, including those gcc sees don't exist
heat_ is now known as heat
<dzwdz> whoops, i phrased that badly
<dzwdz> i meant when building gcc itself, after ./configure --sysroot=/whatever/
<dzwdz> i'm wondering what happens if said sysroot is empty
<heat> nothing
Left_Turn has quit [Read error: Connection reset by peer]
<heat> it just can't build against those headers it's expecting, so IIRC (but im really not sure) it'll fail the build
<heat> when build libgcc, or libstdc++, or libsanitizer, whatever
<heat> building*
heat has quit [Remote host closed the connection]
heat has joined #osdev
<zid> libgimple-dimple
<heat> PIMPL
<zid> peep it mimple pupid, loser
nyah has quit [Quit: leaving]
Burgundy has quit [Ping timeout: 246 seconds]
Matt|home has quit [Quit: Leaving]
sauce has quit []
troseman has quit [Quit: troseman]