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
Left_Turn has quit [Ping timeout: 250 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 250 seconds]
heat_ is now known as heat
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 265 seconds]
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
kori has quit [Quit: WeeChat 3.8]
rnicholl1 has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
Left_Turn has joined #osdev
rnicholl1 has joined #osdev
Turn_Left has quit [Ping timeout: 265 seconds]
Left_Turn has quit [Read error: Connection reset by peer]
hirigaray has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
[_] has joined #osdev
[itchyjunk] has quit [Ping timeout: 240 seconds]
[_] is now known as [itchyjunk]
pog has quit [Ping timeout: 250 seconds]
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
[itchyjunk] has quit [Read error: Connection reset by peer]
<vny> So I am parsing the page tables periodically to observe which pages were accesed. I am wondering if there is a way to know if the last access was a read or write to a page, is this information availabile in the page table?
<heat> no
smeso has quit [Quit: smeso]
<clever> vny: the only real option, is to falsely flag the page as read-only, and then take a pagefault upon write
<clever> then you can update your stats, fix the tables, and retry the operation
smeso has joined #osdev
Arthuria has quit [Ping timeout: 240 seconds]
osmten has joined #osdev
m5zs7k has quit [Ping timeout: 250 seconds]
m5zs7k has joined #osdev
Vercas has quit [Quit: buh bye]
Vercas1 has joined #osdev
Vercas1 has quit [Client Quit]
Vercas1 has joined #osdev
bliminse has quit [Remote host closed the connection]
Vercas1 has quit [Client Quit]
Vercas1 has joined #osdev
Vercas1 has quit [Client Quit]
Vercas1 has joined #osdev
kof123 has quit [Ping timeout: 258 seconds]
tiggster has quit [Remote host closed the connection]
bliminse has joined #osdev
kof123 has joined #osdev
bgs has joined #osdev
alpha2023 has joined #osdev
crankslider has quit [Ping timeout: 248 seconds]
alpha2023 has quit [Ping timeout: 240 seconds]
bgs has quit [Remote host closed the connection]
frkazoid333 has quit [Ping timeout: 240 seconds]
frkzoid has quit [Ping timeout: 248 seconds]
slidercrank has joined #osdev
goliath has joined #osdev
Matt|home has quit [Remote host closed the connection]
Matt|home has joined #osdev
Matt|home has quit [Ping timeout: 240 seconds]
danilogondolfo has joined #osdev
m5zs7k has quit [Ping timeout: 240 seconds]
m5zs7k has joined #osdev
pmaz has joined #osdev
icarus has joined #osdev
icarus has quit [Quit: leaving]
GeDaMo has joined #osdev
nyah has joined #osdev
SGautam has joined #osdev
k0valski188915 has quit [Ping timeout: 250 seconds]
bauen1 has quit [Ping timeout: 250 seconds]
vdamewood has joined #osdev
pog has joined #osdev
elastic_dog has quit [Ping timeout: 265 seconds]
<zid> I just saw a guy named dick jaspers
<zid> That sounds painful
<pog> hi
<zid> ff2's encounter rate is incredibly dumb
<zid> at least in PR
elastic_dog has joined #osdev
<mcrod> hi
<Ermine> hi pog
<zid> hype OG
zxrom has quit [Ping timeout: 268 seconds]
<pog> meow
<zid> maoam
pmaz has quit [Ping timeout: 246 seconds]
<pog> i am eating fritata
<zid> did you give up remembering which t was doubl
<pog> yes
* vdamewood sets a fishy down next to pog's fritata
* pog chomp fishy
bauen1 has joined #osdev
dminuoso has quit [Quit: ZNC 1.8.2 - https://znc.in]
gxt__ has quit [Ping timeout: 240 seconds]
zxrom has joined #osdev
Left_Turn has joined #osdev
gxt__ has joined #osdev
frkzoid has joined #osdev
<Ermine> pog: may I pet you
osmten has quit [Quit: Client closed]
heat has quit [Ping timeout: 240 seconds]
heat has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
<zid> did anyone do advent of code 2022?
<zid> I just remembered I got stuck on one and now it's bugging me
<GeDaMo> There's an #adventofcode channel with 94 nicks
gmacd has joined #osdev
gmacd has quit [Ping timeout: 268 seconds]
gmacd has joined #osdev
<zid> GeDaMo: I asked, I got pointed to a solution in an esolang and when asked if he could make it print an intermediate value, "no" :p
<GeDaMo> :|
gmacd has quit [Ping timeout: 240 seconds]
k0valski18891 has joined #osdev
goliath has quit [Quit: SIGSEGV]
heat has quit [Remote host closed the connection]
gmacd has joined #osdev
heat has joined #osdev
<sham1> Nyah
gmacd has quit [Ping timeout: 246 seconds]
gmacd has joined #osdev
gmacd has quit [Ping timeout: 268 seconds]
gmacd has joined #osdev
gmacd has quit [Ping timeout: 248 seconds]
gmacd has joined #osdev
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
gmacd has quit [Ping timeout: 265 seconds]
goliath has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 240 seconds]
<zid> GeDaMo: someone else showed up and helped, I figured out what's wrong at least, but no idea what I'm supposed to do about it :P
<GeDaMo> That's progress! :P
<zid> sorta? :p
<GeDaMo> The beginning of wisdom is knowing that you know nothing :P
Turn_Left has joined #osdev
xenos1984 has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
Left_Turn has quit [Ping timeout: 250 seconds]
<vny> In the linux /proc is KB Kebi bytes or Kilobytes?
<vny> thanks clever, I could try that
<heat> KiB
_koolazer has quit [Remote host closed the connection]
koolazer has joined #osdev
<sham1> One would hope that it's KiB
<heat> i hope its KB, for the memes
<heat> all my pages are 4000 bytes long
<heat> what r u going 2 do? nothin? that's right
<nortti> cylinder-head-sector RAM addressing
<sham1> no
<zid> My ram is already CHS, but the CHS are very specifically picked
<zid> I have 1 sector of 4096, 1 head of 1 sector, and 4 billion cylinders
<sham1> So every page a sector?
<mjg> oy funny interview question
<mjg> it used to be that there was no tmpfs
<mjg> but instead there was a magic device which just took ram and pretended to be disk space
<mjg> and you would mkfs on it
<mjg> the q is what's the difference
<mjg> :d
<heat> openbsd vibes
<zid> sham1: Yea I think drives should be like that anyway tbh
<mjg> openbsd hs tmpfs
<mjg> except it is disabled
<nortti> what
<heat> exactly
<heat> they ""have"" ""tmpfs""
<sham1> Didn't get enough people. Gotta do with mfs
<mjg> you can enable it
<mjg> i think it mostly works?
<nortti> why is it disabled?
<mjg> they claimed too many bugs and no maintainers
* heat does a cartman de raadt voice
<mjg> so for kwality
<heat> SECURITEH
<mjg> but i know they kept patching it afterwards
<mjg> here is a dirty secret: they have numerous dumbfuck problems in vfs and vm layers
<zid> I have too many bugs
<mjg> some of which got inherited from the original codebase
<zid> I should have done this as a graph
<mjg> and tmpfs, its own bugs aside, was probably exposing the rest
<mjg> so
<zid> I wouldn't need recursion if it were a graph
<sham1> But recursion makes for the perfect graph traversal
gmacd has joined #osdev
<mjg> so what about my interview q!
<zid> what
<mjg> i bet you webosdevs have no idea!
<zid> what question
mi7 has joined #osdev
<mjg> timed out
<mjg> zid get's an F
gmacd has quit [Ping timeout: 268 seconds]
<nortti> off the top of my head it makes the allocation for the filesystem fixed-size
<zid> You were talking about tmpfs being fake
<nortti> and running a normal filesystem over such a block device probably also gets you worse performance when writing, since persistent filesystems must perform flushes / writes in specific order to avoid corruption in case of an unclean shutdown, a non-issue for tmpfs
<nortti> also stuff like avoiding fragmentation which is a non-issue for in-ram data
<heat> much worse performance, redundant flushing of data from memory to memory, redundant duplication of tmpfs data
<nortti> oh and if there is no TRIM support you can't easily reclaim unused blocks
<heat> much more complex code paths with locking, etc
<mjg> heat is going the grifter route
<heat> it will also strive to do block allocation like it's a physical drive, which makes 0 fucking sense
<mjg> while nortti gives more tangible details
<heat> why is this the grifter route?
<mjg> nortti gets B, heat gets C for trying
<mjg> heat: vague claims
<mjg> "complexity bro"
<nortti> < heat> much worse performance, redundant flushing of data from memory to memory, redundant duplication of tmpfs data ← is the redundant duplication due to filesystem cache, or is there more to it?
<zid> I got an F because you forgot to ask a question
<mjg> if i forgot to ask, how come they answered
<heat> nortti, page cache has a copy + block device being in ram gets another copy
<zid> they extrapolated to entertain you
<zid> and I don't care enough to
<mjg> 19:08 < mjg> the q is what's the difference
<zid> that's not a question
<mjg> what
<zid> differences have to be between things, and questions have to end in question marks
<zid> neither was satisfied
<mjg> heat: fun fact: the original tmpfs port to freebsd (from net) was doing double copying anyway :X
<zid> U for question asking
<mjg> amongst other PESSIMAL behavior
austincheney_ has joined #osdev
<heat> the major advantage of a proper tmpfs is that you can use the already-existing dcache and page cache to literally store things. you do not need a filesystem for any of this. details of a proper filesystem are redundant if this data is never going to sit on a physical disk anyway
<vny> Why doe some regions in maps/smaps have no names?
<mjg> what?
<heat> have you considered googling
<mjg> what do you consider "names" in this contxt
<mjg> or better yet, paste some
<heat> it's obviously anonymous memory
<mjg> that is what i expect, but note heap and stack have an annotation
<mjg> while other lines are straight up empty when they would not have to be
<mjg> so maybe the q is why they don't have anything noted
<heat> there's a relatively-recent prctl that lets you name anonymous vmas
<zid> mjg: I used to like cornflakes, what's the q difference
jbowen has quit [Ping timeout: 250 seconds]
<zid> sorry failed, too slow
<heat> it was available out-of-tree on android for the longest time too
<mjg> zid: what's the difference between a duck
<zid> Number of legs
<heat> mjg, anyway does this last answer satisfy you or do you want even meatier details
<vny> Yes, I found this answer https://stackoverflow.com/questions/2787241/smaps-un-named-segment-of-memory My question is rather, is it always anon_maps?
<bslsk05> ​stackoverflow.com: linux - SMAPS Un-named segment of memory - Stack Overflow
<heat> yes
<mjg> heat: i was not particuarly serious mate
<mjg> but zid apparently is
austincheney has quit [Ping timeout: 250 seconds]
<mjg> really salty about failing the OS midterm
<heat> i'm not logging off without the A+
<zid> salty about you giving me an F when it was your problem
<zid> awful teacher
<zid> why am I paying for this
<mjg> i'm gonna have to see your parents
<heat> btw mjg does freebsd have KTSAN?
<mjg> no
<heat> cringe
<mjg> brah
<mjg> lemme find a corporate reason why
<heat> have you seen linux KCSAN?
<mjg> heat: the project is avoiding displacing focus from primary goals
<mjg> nope
<mjg> i mean i think they have one, but i have not seen any of the code
<mjg> for any other sanitizers either
<mjg> they defo have kasan and kmsan
<heat> it randomly samples 1 out of 2000 accesses and sets up a watchpoint, delays some good microseconds, and then checks if shit changed
<heat> it's hacky AF
jbowen has joined #osdev
<mjg> uuuh
<mjg> fsck
<mjg> that is one shite idea
<heat> anyway i'm implementing KTSAN for onyx
<mjg> off hand i don't see a way to implement this in a sensible manner
<heat> google has an abandoned "proper" ktsan for linux in some branch in github that they never bothered to upstream
<heat> also it seems that the LKMM is really funny and conflicts with normal semantics. like lots of code assumes that word-aligned accesses are atomic
<heat> so kcsan is the dumb and stupid way
<mjg> i will note that injecting artificial delays is an ok idea here and there
zxrom has quit [Quit: Leaving]
<mjg> there was a project for userspace
<mjg> they were detecting races by plopping in said delays
nvmd has joined #osdev
xenos1984 has quit [Ping timeout: 248 seconds]
<geist> yeah also running under emulation can really uncover a lot of weird delays too
<geist> races that is
bslsk05 has quit [Read error: Connection reset by peer]
ptrc has quit [Read error: Connection reset by peer]
ecs has quit [Read error: Connection reset by peer]
ecs has joined #osdev
moberg1 has quit [Quit: Disconnecting]
ptrc has joined #osdev
sauce has quit [Remote host closed the connection]
moberg has joined #osdev
sauce has joined #osdev
xenos1984 has joined #osdev
<mrvn> do you keep track of all memory access per thread and reset that every time a synchronizing opcode is used?
ZipCPU has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
ZipCPU has joined #osdev
<heat> seriously the google sanitizer people are geniuses
<heat> life changing shit
<mjg> geist: funny bug i introduced once
<heat> ubsan, asan, tsan, msan, kcov, libfuzzer, syzkaller
<heat> these motherfuckers are making a C development best-hits
<mjg> geist: only showed up for people running freebsd on laptops in a vm
<mjg> :p
<mjg> a race which is not realistic on bare metal
<mjg> but shows up no problem when vcpu is starved literally for seconds
<heat> bro, my kernel unreliably boots in qemu tcg because of vfs path walking races
<mjg> lmao
<mjg> i mean oh
gmacd has joined #osdev
<nortti> oh yeah, what is the preferred way to run virtual machines on windows (+ intel CPU) nowadays? I want to check out onyx but my only computer with new enough CPU runs windows
<mjg> wait you are not even lockless
<heat> tldr im not too fucked USE KVM
<mjg> so what's going on there
<heat> nortti, virtualbox works ok I think? but it worked horribly when hyperv was enabled though
<heat> mjg, some bits are pseudo-lockless IIRC since I don't hold the lock when waiting for a dentry lookup to finish
<heat> and that's more or less where it was crashing
<mjg> :XX
<mjg> you suckkzor
<mjg> you need to revalidate teh state
goliath has quit [Quit: SIGSEGV]
<heat> have you considered that if C wasn't this garbage all the sanitizer people wouldn't have jobs
<heat> C literally saves jobs
<heat> rust is late-stage capitalism
<mjg> not true
<mjg> at least for csan
<mjg> the only thing which rust "solves" in the area is fully locked operation, and only if you take at most one lock at a time
<mjg> anything past that and you are in shite
<heat> you know what also solves concurrency bugs? the big kernel lock
<heat> let's bring that back
<heat> or if you're a BSD, let's keep it
* mjg puts on nitpick hat
<mjg> you are conflating concurrency with parallelism
<mjg> and bkl interestingly does not solve it :S
<mjg> you still drop it around going to sleep
<mjg> so a fully UP kernel can still have racez
<mjg> like the one you got for path walk
vdamewood has quit [Read error: Connection reset by peer]
<heat> well naturally you can't have 2 threads running in the kernel at the same time, so you can't have this race
<heat> if one wakes up and grabs the bkl, someone else dropped it after doing the thingz
vdamewood has joined #osdev
<mjg> sample example
<mjg> you lookup foo/../bar
<mjg> on your way to do it you may need to taken lockkkz which will put you off cpu
<mjg> once that happens the state can aribtrarily change
<mjg> and you still need to validate *that* after you get back
<sham1> Concurrency is not parallelism
* sham1 slaps heat with Rob Pike
<mjg> most unhelpful word choices tho
<sham1> Of course Mr. Pike also didn't come up with the concept. And how could he? He's not a CS theoretician
<mjg> is he capable of understanding a brilliant programming language though?
<sham1> Well maybe. He certainly feels qualified to judge other people's capabilities
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
<zid> I had an idea that's actually fun
<zid> I write a connect 4 server, you guys write bots to play it
<sakasama> I thought mankind had agreed everyone's spare time would best be spent bioengineering catgirls?
<zid> no need to bioengineer, just do some very painful surgery
<zid> to implant plastic triangles into your skull
<zid> because as we all know, cat girls have 4 ears, 2 of which don't work
<sakasama> Imitation catgirls are depressing.
plasma41 has joined #osdev
<mrvn> zid: who said they don't work? They are for WiFi and GPS.
<mrvn> connect 4 has been solved. You can just lookup the best move.
gmacd has quit [Ping timeout: 256 seconds]
dude12312414 has joined #osdev
mi7 has quit [Read error: Connection reset by peer]
xenos1984 has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
zxrom has joined #osdev
gmacd 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!]
gmacd has quit [Ping timeout: 250 seconds]
terminalpusher has joined #osdev
xenos1984 has quit [Ping timeout: 248 seconds]
gorgonical has joined #osdev
<gorgonical> I wish arm trusted firmware could read FIT images
<gorgonical> This whole business with the platform specific gobbledygook makes me really sad because a better solution exists
<mrvn> maybe the device tree should have some boot services
slidercrank has joined #osdev
<gorgonical> how do you mean
<mrvn> some pointers to firmware code to do some basic things. Like print to serial, or load a file
gmacd has joined #osdev
<gorgonical> I just wish this platform-specific, brittle way of putting things where they go wasn't the norm. Uboot has a FIT loader but it's in the SPL and I don't want to wrangle the boot stack
mavhq has quit [Ping timeout: 250 seconds]
<plasma41> mrvn: like the interrupt vector table for BIOS services on PCs?
bauen1 has quit [Ping timeout: 265 seconds]
<mrvn> and like boot services on efi
xenos1984 has joined #osdev
Matt|home has joined #osdev
danilogondolfo has quit [Remote host closed the connection]
Gooberpatrol66 has quit [Ping timeout: 240 seconds]
linkdd has left #osdev [#osdev]
Gooberpatrol66 has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 250 seconds]
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
mavhq has joined #osdev
valshaped has quit [Read error: Connection reset by peer]
valshaped has joined #osdev
dutch has quit [Quit: WeeChat 3.8]
nyah has quit [Ping timeout: 265 seconds]
nyah has joined #osdev
innegatives has joined #osdev
bslsk05 has joined #osdev
terminalpusher has quit [Ping timeout: 245 seconds]
dutch has joined #osdev
terminalpusher has joined #osdev
innegatives has quit [Ping timeout: 250 seconds]
terminalpusher has quit [Remote host closed the connection]
terminalpusher has joined #osdev
<mcrod> hi
<plasma41> o/
gmacd has quit [Ping timeout: 240 seconds]
epony has joined #osdev
<mcrod> I think people need a cheat sheet of C stuff at their desk sometimes
<mcrod> thinking about converting an int to a string? ok, use `sprintf`
<mcrod> the opposite? use `strtol`
<mcrod> etc
<heat> >ok, use `sprintf`
<heat> fucking what ;_;
<bnchs> sometimes i'm wary of using stdlib funcs
<bnchs> but it's better to use those than implement my own
<mcrod> to convert an int to a string?
<mcrod> you absolutely can use sprintf
<heat> i wouldn't pull sprintf just for that
<mcrod> well _yeah_
<heat> ofc if you're pulling it elsewhere then that's kind of ok, but it's still slow
<mcrod> we don't give two shits about performance in this case
<bnchs> heat: >is slow
<bnchs> depends on implementation
<mcrod> heat this is to take a number and show it on a seven-segment display
<bnchs> micro$hit doesn't count
<heat> it does not depend depend on the implementation
<heat> depend depend depend
<sham1> How would you turn an integer to a string
<heat> sprintf *is* slow
<sham1> Let's assume locale-independence because locales are annoying as they are
<bnchs> heat: depends. on. implementation
<mcrod> I have no idea how fast IAR's sprintf implementation is
<heat> show me a fast sprintf that's faster than a number_to_string(unsigned long)
<bnchs> there is no part of the specification that says sprintf has to be slow
<heat> i'll call bullshit on that
<mcrod> if you give a shit about speed, I do agree that sprintf isn't the right call, most likely
<mcrod> but in this case
<mcrod> who cares
<mcrod> in 99% of cases we don't give a shit about performance other than meeting our timing requirements
<mcrod> as the real-time gods intended
<sham1> sprintf(buf, sizeof(buf), "%", num); // might be slow, but at least one knows what one bers4
<sham1> Err
<mcrod> %d my son, %d.
<sham1> "%d"
<sham1> Y
<sham1> Tired + phone
<heat> also snprintf
<heat> literally roasted
<sham1> But anyway, where is the turning of integers into strings a bottleneck
<mcrod> i will say that IAR doesn't give a _fuck_ about performance in the majority of cases
<mcrod> they care exclusively about producing the tiniest code possible
<mcrod> so their C implementation is probably 9 times slower than a drunk priest on sunday
<heat> tiny here would equal performance
<mcrod> probably, yeah
<mcrod> again I have zero, repeat, zero idea of how the underlying assembly looks for this
<heat> i assume you're running on flash, your core is in-order with very tiny caches
<mcrod> yes
<mcrod> we're almost out of space and that's going to kill us soon, but yes.
<heat> wait you're literally getting MURDERED?
<heat> that's kind of excessive IMO
<mcrod> yes, the STM32 people will come alive out of the machine and kill us for making them fat
<mcrod> it was nice knowing you
<mcrod> overall, I would say that I haven't had trouble with their C implementation, but I'd much prefer to write our own honestly.
<mcrod> er, C standard library
<mcrod> we honestly hardly make use of it as it is
<mcrod> probably at compile-time it can do the same thing as the 'more efficient' code, but we don't compile with optimizations either
<mcrod> so that's a no
<heat> you don't compile with optimizations??
<mcrod> no
<mcrod> we do not
<mcrod> heat listen to me
<heat> no shit you're running out of flash
<heat> note: I don't know how well AVR optimizes
<mcrod> ARM...
<mcrod> a) if we'd turn on -Os, that would probably hinder our ability to debug the system
<mcrod> so we try to make sure -O0 works
<heat> I never, ever use O0
<mcrod> why the hell not
<zid> O0 is hysterically useless
dude12312414 has quit [Remote host closed the connection]
<mcrod> why?
<heat> too big, too slow
<zid> it's just outright aful
<zid> it's unreadable and the warnings don't work
<heat> oh right, the warnings too
<mcrod> I do remember stuff like -Wlogical-op not working on -O0, but works on -O1
<heat> I would rather have -O2 or -Os and then get fucked if something can't debug properly
<zid> O0 is literally "Work less good" mode
<zid> for any purpose
<mcrod> dunno if i'd agree with that **for this particular product**
<zid> Debugging is worse, waiting times are worse, code quality is worse
<heat> because 1) I can't use gdb for lots of purposes 2) when I need to use gdb, I can usually get by with optimizations
<mcrod> remember
dude12312414 has joined #osdev
<mcrod> this is something you put into a vending machine to allow customers to get a pepsi
<mcrod> this is **NOT** performance sensitive
<heat> 3) when I can't, I hack something up so the compiler doesn't lose track of the local variable I want
<zid> okay?
<zid> I'd *still* build it LTO and O2/O3
<heat> -Os gets you less code
<mcrod> yes
<mcrod> i don't deny that
<heat> -O0 is traditionally hysterically large
<mcrod> i've compiled it with -Os and our shit went to like 336KB
<mcrod> which, great
<heat> how large is it with O0?
<mcrod> 443
<heat> see, that's great
<zid> how much is .text?
<mcrod> not a clue
<zid> 10%? 100%?
<heat> a cheeky -ffunction-sections -fdata-sections --gc-sections could improve things further
<sham1> -Og my beloved
<mcrod> hell
<mcrod> even armclang says: "For good debug experience, Arm recommends -O1 rather than -O0. When using -O1, the compiler performs certain optimizations, but the structure of the generated code is still close to the source code."
<heat> sham1, Og is a silently noop in clang that matches -O1 btw
<heat> i hate Og because of that
<mcrod> here's the thing; we absolutely should be thinking entirely about code size, except in cases where we have to meet timing requirements (i.e. higher performance is necessary)
<sham1> clang? Get that proprietary-adjacent thing away from me
<mcrod> and we don'tl
<mcrod> *don't
<mcrod> we actually have no way to profile any of the code
<mcrod> it's great
<mcrod> we have no tracing support at all
<heat> i would wager it's way faster to have less code than more, in your case
<heat> given you're running directly XIP on flash
<mcrod> probably a good wager
<mcrod> but as I said, we do not have the ability to profile anything on this product
<mcrod> not code coverage, not speed, not power, not the amount of hairs on your head, nothing. and i mean nothing.
<heat> anyway you could also try -flto but I genuinely don't know how well that could work
<mcrod> that could cause a problem with code placement
<heat> could be brilliant, could accidentally inline half the program into two functions
<mcrod> also, *to the best of my knowledge*
<mcrod> i don't think you can do LTO with IAR
<heat> doesn't gcc support avr too?
<mcrod> why the hell do you keep saying avr
<heat> aren't you on fucking avr
<mcrod> my brother in christ it is arm, a r m
<mcrod> ARM
<mcrod> A R M
<heat> oh
<heat> leg
<mcrod> i've said it like 4 times
<mcrod> :(
<heat> even better, does gcc not support your thing?
<mcrod> no it absolutely does
<mcrod> they won't let me try and switch us over, most likely.
FreeFull has joined #osdev
<heat> try anyway, measure, get results
<mcrod> one thing I'll fucking tell all of you now though, IAR's linker scripts are pleasant compared to gcc's crap
<heat> i have no opinion on ld linker scripts
<heat> they're both garbage and great
<mcrod> are you kidding me they look awful
<zid> gcc is not binutils, mcrod
<zid> totally different projects
<mcrod> binutils, yes
<mcrod> i could not think of the name
<zid> yea I'm with heat
<mcrod> so I said gcc hoping you would correct me
<mcrod> and you did
<mcrod> thanks
<zid> they're shitty but also "being a linker that supports a lot of stuff" is a shitty thing to have to have a config format for
<zid> so it sortof balances out
<mcrod> anyway, I have no doubt at all that clang/gcc would be a much better fit for this
<mcrod> same with fucking Linux machines
<heat> yeah and they're not all that bad once you get the hang of it
<zid> For everything I've ever done with a linker script, they're pretty simple tbh
<heat> btw, it's far easier to get a script that works if you only use a single linker
<mcrod> I've been saying "let's go to gcc/clang" for such a long time
<zid> it's the gnu env that adds most of the complexity
<mcrod> the lack of tracing support is a problem that will never get solved though
<heat> my kernel linker scripts support ld.bfd, gold, lld
<zid> err mcrod*
<mcrod> that doesn't look terrible
<heat> very kawaii
<bslsk05> ​github.com: Onyx/linker.ld at master · heatd/Onyx · GitHub
<zid> This is your brain on portugal
<mcrod> yeah see this looks like a children was drawing on the sidewalk to me
<mcrod> *a child
terminalpusher has quit [Remote host closed the connection]
<zid> That's just what the inside of heat's skull looks like
<mcrod> read: i'm sure it's fine
<zid> tidy source code -> tidy mind
<heat> i really need to wire up some preprocessor rules on the linker script to clean up some of the scripts
terminalpusher has joined #osdev
<heat> lots of this really is just common stuff that's *duplicated* across archs, etc etc
<mcrod> also
<mcrod> we would get access to asan
<mcrod> and ubsan
<mcrod> if we'd move to gcc/clang
<heat> you have no space for asan, you probably have no space for ubsan
innegatives has joined #osdev
<heat> sorry to be a downer :(
<mcrod> yeah admittedly I don't know how huge it is
<mcrod> i do know armclang DOES ship ubsan
<mcrod> but that indeed doesn't mean _we_ can use it
<epony> no $you
<heat> lets see
<epony> why you no armcrust
<epony> hm?
<heat> CONFIG_UBSAN=n vmonyx: 1317589 bytes
<mcrod> definitely not.
<epony> you mean USBAN
<heat> CONFIG_UBSAN=y CONFIG_KTSAN=y vmonyx: 3568112 bytes
<mcrod> definitely not.
<zid> bonus points: There's 120kB of .data
<epony> don't you know sysctl yet?
<zid> err 1.2MB*
<epony> bonus points revoked
<zid> so tht's actually 100k -> 2M
<heat> although not the exact same kernel config i should mention
<mcrod> honestly
<mcrod> in theory this code could probably be 200KB, tops
<heat> i don't know for sure how much ubsan costs, but it adds a lot of branches and needs a bunch of rodata
<heat> inline ASAN is super expensive, costs a few megs in my case
<zid> 200k is a fuck lot of actual code
<mcrod> *binary
<heat> KTSAN is even more calls, but is probably similar in cost to non-inline ASAN
<heat> erm, s/KTSAN/TSAN/
<zid> like, 200k of code is a quarter million source lines if you have some comments and stuff
<junon> Thanks for the help yesterday. Setting up the GDT and TSS were indeed the problem, the breakpoint now hits correctly and I can correctly debug the problems with the page fault stuff. Stack was getting exhausted with the println implementation for the serial, thus a page fault was occurring (which is expected, my stack will grow) and then the page fault handler tries to get a lease on the spin lock for the serial port, which is already locked, which means it hangs.
<junon> Neat :) Figured out all my issues, thanks again zid, heat and geist! Really helpful :)
<mcrod> zid: no, I mean, the binary could be 200KB
<heat> junon, sweet!
<mcrod> the actual source code is mostly full of straight garbage.
<heat> zid, no, that's far off in my case
<heat> 363K for 14k lines
<zid> yours is all template explosions
<heat> wait, do you mean code as in .c, or code as in .text?
<junon> and force unlocking the spin lock works as expected! :)
slidercrank has quit [Ping timeout: 240 seconds]
Turn_Left has quit [Read error: Connection reset by peer]
[itchyjunk] has joined #osdev
terminalpusher has quit [Remote host closed the connection]
nvmd has quit [Quit: WeeChat 3.8]
zxrom has quit [Remote host closed the connection]
zxrom has joined #osdev
nyah has quit [Quit: leaving]
bauen1 has joined #osdev
Gooberpatrol66 has joined #osdev
FreeFull has quit []
pmaz has joined #osdev