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
innegatives has quit [Quit: WeeChat 3.8]
nyah has quit [Quit: leaving]
goliath has quit [Quit: SIGSEGV]
gog has quit [Quit: byee]
Matt|home has quit [Quit: Leaving]
pmaz has joined #osdev
zaquest has quit [Remote host closed the connection]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
mi7 has quit [Quit: leaving]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
[_] has joined #osdev
heat has quit [Read error: Connection reset by peer]
[itchyjunk] has quit [Ping timeout: 240 seconds]
[_] has quit [Remote host closed the connection]
heat has joined #osdev
tiggster has quit [Quit: Leaving]
les has quit [Quit: Adios]
les has joined #osdev
Ali_A has joined #osdev
Ali_A is now known as Someone
Someone is now known as Babylon
bgs has joined #osdev
slidercrank has joined #osdev
heat has quit [Ping timeout: 240 seconds]
Babylon has quit [Quit: Client closed]
slidercrank has quit [Ping timeout: 240 seconds]
heat has joined #osdev
dutch has quit [*.net *.split]
ptrc has quit [*.net *.split]
puck has quit [*.net *.split]
bslsk05 has quit [*.net *.split]
ThinkT510 has quit [*.net *.split]
thinkpol has quit [*.net *.split]
rwb has quit [*.net *.split]
MaxLeiter has quit [*.net *.split]
smeso has quit [*.net *.split]
torresjrjr has quit [*.net *.split]
terrorjack has quit [*.net *.split]
DrPatater has quit [*.net *.split]
asarandi has quit [*.net *.split]
AndrewYu has quit [*.net *.split]
jbowen has quit [*.net *.split]
seds has quit [*.net *.split]
phr3ak has quit [*.net *.split]
immibis has quit [*.net *.split]
dinkelha1 has quit [*.net *.split]
ornitorrincos has quit [*.net *.split]
ptrc has joined #osdev
torresjrjr has joined #osdev
ornitorrincos has joined #osdev
MaxLeiter has joined #osdev
jbowen has joined #osdev
Andrew has joined #osdev
rwb has joined #osdev
puck has joined #osdev
DrPatater has joined #osdev
pounce has quit [Ping timeout: 256 seconds]
dinkelha1 has joined #osdev
asarandi has joined #osdev
smeso has joined #osdev
pounce has joined #osdev
ThinkT510 has joined #osdev
phr3ak has joined #osdev
bgs has quit [Remote host closed the connection]
slidercrank has joined #osdev
hmmmm has quit [Remote host closed the connection]
hmmmm has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
gmacd has joined #osdev
pmaz has quit [Read error: Connection reset by peer]
justmatt8 has quit [Quit: ]
justmatt8 has joined #osdev
justmatt8 has quit [Client Quit]
justmatt8 has joined #osdev
danilogondolfo has joined #osdev
GeDaMo has joined #osdev
Burgundy has joined #osdev
gmacd has quit [Ping timeout: 246 seconds]
gmacd has joined #osdev
pharonix71 has quit [Remote host closed the connection]
pharonix71 has joined #osdev
gmacd has quit [Ping timeout: 240 seconds]
knusbaum has quit [Ping timeout: 265 seconds]
Left_Turn has joined #osdev
Matt|home has joined #osdev
PublicWiFi has quit [Ping timeout: 268 seconds]
Burgundy has quit [Ping timeout: 240 seconds]
PublicWiFi has joined #osdev
slidercrank has quit [Ping timeout: 240 seconds]
slidercrank has joined #osdev
Left_Turn has quit [Remote host closed the connection]
Left_Turn has joined #osdev
terrorjack has joined #osdev
gog has joined #osdev
<gog> hi
<zid> gog
<gog> bis
<zid> I curse you, I make logistics robots deconstruct ore belts in your vicinity!
<gog> or belts
<gog> hahahahahhaahaha
<gog> direct train loading
<gog> scrub
<zid> That's why it's a curse
<zid> a) There must be ore belts need you
<zid> near*
<zid> b) Your inventory is now full of coal, suck it
<gog> i'll just take it to my plastic and liquefaction plants
gmacd has joined #osdev
<zid> nope, it's coming in at like 4 pieces per second
<zid> for the next 20 hours
<zid> cus bots suck at deconstructing belts full of items
goliath has joined #osdev
* mrvn casts a spell of undo deconstruction.
* sham1 pessimizes the deconstruction
<gog> meow
<sham1> Mov
<gog> rep mewsq
<zid> God, if you pessimised deconstructing item belts they'd just stop moving
gmacd has quit [Read error: Connection reset by peer]
gmacd has joined #osdev
<gog> they do
<gog> during deconstruction the belts do stop moving items
<zid> The bots
<zid> would stop
<zid> Trees are another thing they're bad at for some reason it feels like the pathing is just the worst possible solution
* mrvn deconstructs all storage chests. Take that bots.
<mrvn> I don't see the point in liquefaction. Coal is a finite resource and oil is not and usually you have too much of it.
<gog> yeah i never use it
rsonx has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<gog> heat
<heat> gog
Burgundy has joined #osdev
<zid> if you two had a kid would it be geat or hog
<gog> hog
<heat> hoggers
<gog> goat
<gog> goet?
<heat> ūüźź
rsonx has quit [Ping timeout: 245 seconds]
jimbzy has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
bslsk05 has joined #osdev
heat_ is now known as heat
<heat> hi gog i have a philosophical dillema for you
<gog> smash dick
<heat> then i cant piss
<heat> that's very utilitarianist from you gog
<gog> yes
<mcrod> gog: may I pet you
<gog> y4s
<zid> oh no, she's turned sassy
<zid> Who would like a terrible pun tweet on this fine day?
* mcrod pe4s gog
* gog prr
<gog> lmao
<gog> i would like a terrible pun every day of the week
<mcrod> jesus christ
<mcrod> every fucking documentation I look at for shell scripting is for bash
<mcrod> stop it
<gog> bash bash bash bash
<GeDaMo> Jesus, take the shell :|
<gog> lmfao
<gog> i'm gonna port bash to uefi
<zid> there are shells that aren't bash!?
<gog> not that i know of
dutch has joined #osdev
techmetx11 has joined #osdev
jstoker has quit [Quit: *disappears in a cloud of bits*]
DrPatater has quit [Quit: Explodes into a thousand pieces]
riverdc_ has joined #osdev
LostFrog has joined #osdev
DrPatater has joined #osdev
froggey has quit [Remote host closed the connection]
riverdc has quit [Quit: quitting]
les has quit [Ping timeout: 265 seconds]
kazinsal has quit [Ping timeout: 265 seconds]
kazinsal has joined #osdev
AmyMalik has quit [Read error: Connection reset by peer]
les has joined #osdev
Brnocrist has quit [Ping timeout: 265 seconds]
PapaFrog has quit [Ping timeout: 265 seconds]
bnchs has quit [Ping timeout: 265 seconds]
Benjojo has quit [Ping timeout: 265 seconds]
Brnocrist has joined #osdev
jstoker has joined #osdev
froggey has joined #osdev
Benjojo has joined #osdev
<Ermine> gog: may I pet you
<gog> yes
gmacd has quit [Ping timeout: 240 seconds]
* Ermine pets gog
* gog prr
<zid> I figured out how to convert nunbers to latin
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
awita has joined #osdev
<sham1> zid: there indeed are shells that are not bash. Powershell!
<sham1> Anyway, a more interesting challenge would be to instead port UEFI to bash
Ellenor has joined #osdev
heat has quit [Ping timeout: 248 seconds]
heat has joined #osdev
innegatives has joined #osdev
dude12312414 has joined #osdev
<gog> what
<heat> there's a shitty efi python3 port in github.com/tianocore/edk2-libc
<bslsk05> ‚Äčtianocore/edk2-libc - Port of libc to EDK II with applications that depend on libc (47 forks/56 stargazers/NOASSERTION)
<heat> i think intel uses it for scripting purposes
<heat> because the efi shell sucks and everyone knows it
gmacd has joined #osdev
awita has quit [Ping timeout: 268 seconds]
mavhq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
SGautam has joined #osdev
jbowen has quit []
gmacd has quit [Ping timeout: 256 seconds]
jbowen has joined #osdev
<sham1> And that is why one ports bash
gmacd has joined #osdev
<gog> one does not simply port bash
<sham1> Well okay. Csh
<gog> tcsh
<gog> –©
<Ermine> bortcsh
<gog> i want some bortsch
<gog> or some zucchini dip
bnchs has joined #osdev
<gog> bnchs
* gog offer pet
* bnchs accepts
* gog petpetpetpet
* bnchs purrs
bnchs has quit [Killed (NickServ (GHOST command used by techmetx11!techmetx11@user/bnchs))]
techmetx11 is now known as bnchs
* bnchs hugs gog
<puck> heat: just compile python to wasm and compile wasm to edk2
<gog> simple
mavhq has joined #osdev
bgs has joined #osdev
[itchyjunk] has joined #osdev
<bnchs> i'm sorry for the ghost
<bnchs> it's kinda embarrasing
innegatives has quit [Quit: WeeChat 3.8]
goliath has quit [Quit: SIGSEGV]
awita has joined #osdev
dayimproper has joined #osdev
FreeFull has joined #osdev
<gog> ghsot?
dayimproper has quit [Ping timeout: 265 seconds]
xenos1984 has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
gmacd has quit [Ping timeout: 248 seconds]
Pruepeura has joined #osdev
innegatives has joined #osdev
<innegatives> What do these errors mean?
<innegatives> crtstuff.c:(.text+0x88): relocation truncated to fit: R_X86_64_32 against `.dtors'
<innegatives> crtstuff.c:(.text+0x8e): relocation truncated to fit: R_X86_64_32 against symbol `__DTOR_END__' defined in .dtors section in crtend.o
<innegatives> I have mcmodel=kernel flag
Pruepeura has quit [Client Quit]
<bnchs> innegatives: check crtend.c?
<innegatives> it comes from here CRTEND_OBJ:=$(shell $(CC) $(CFLAGS) -print-file-name=crtend.o)
<innegatives> Here's the makefile: https://pastebin.com/e1Fw5awC
<bslsk05> ‚Äčpastebin.com: override MAKEFLAGS += -rRoverride KERNEL := kernel.elfdefine DEFAULT_VAR - Pastebin.com
<bnchs> check crtend.o?
<innegatives> check what exactly?
<bnchs> nvm lemme see pastebin
slidercrank has joined #osdev
<bnchs> sorry sorry i'm a bit dumb
gmacd has joined #osdev
<bslsk05> ‚Äčwiki.osdev.org: Building libgcc for mcmodel=kernel - OSDev Wiki
<innegatives> theres the answer
<sham1> I don't like that use of sed
xenos1984 has quit [Ping timeout: 246 seconds]
wootehfoot has joined #osdev
FreeFull has quit []
<innegatives> geist: travisg: your toolchain scripts do not support mcmodel=kernel ?
<geist> for x86-64? yes they do
<innegatives> how?
<geist> oh wait. no there' no need. it supports mno-red-zone
<bslsk05> ‚Äčgithub.com: toolchains/gcc-patch-000 at master ¬∑ travisg/toolchains ¬∑ GitHub
<geist> i haven't found a need for mcmodel=kernel on x86-64
<innegatives> You never used crt stuff in 64?
<geist> never
<geist> i always provide all of my own stuff for that
<geist> easy enough to do, just look at what crtbegin does and do it yourself. it's not much
<innegatives> ok thanks
<geist> plus generally want to very carefully control when/how that is done in a kernel vs a regular program
<geist> for calling things like constructors and zerong bss, etc
<geist> but the mno-red-zone thing is absolutely needed
<innegatives> you patch gcc 12.1.0 with redzone flag, but scripts pull 12.2.0, is it not needed in 12.2.0?
<innegatives> i mean the patch
<geist> yah just meant the patch applied cleanly so didn't bother updating it
<geist> i actually have a WIP branch for 13.1
<geist> also really, on x86-64 you probably dont even need libgcc.a. there's very little in it that you will tend to find on that particular architecture
<geist> some other arches may need it more, depending on what sort of stuff you write
<geist> (ie, lots of 64bit math on 32bit only cpus, or divides on cpus that dont support divide)
<geist> but x86-64 is full featured enough that there's usually an instructon for what you want, so no need to emit an outcall to libgcc
<geist> it almost kinda makes sense to leave it out so you know exactly what it's trying to use when you get a link failure
xenos1984 has joined #osdev
<innegatives> im not that good, im just trying to get my cpp global constructors to work
SGautam has quit [Quit: Connection closed for inactivity]
<geist> yah basically you can do something kinda like this https://github.com/littlekernel/lk/blob/master/top/main.c#L44
<bslsk05> ‚Äčgithub.com: lk/main.c at master ¬∑ littlekernel/lk ¬∑ GitHub
<geist> the key is to look at the linked binary and see what the constructor list symbols are
<geist> i think there are various ways they can come out, and it depeds on the linker script
<geist> but usually you end up with a ...start and ...end symbol, and the gist is you just iterate through a list of fucntions and call them
<innegatives> so i dont need to link crt stuff?
<gog> i told you last night that in-kernel you'll need to roll your own
nyah has joined #osdev
<innegatives> how come meaty skeleton in osdev and other articles just tell you to link crt stuff? are they wrong?
<gog> the implementations provided by gcc are hosted
<gog> it rolls its own
<gog> crti.s
<innegatives> thats what you mean by rolling your own? those 10 lines of asm?
<gog> but i see it also links to crtend.o and crtbegin.o
<gog> i don't know why it does but it's also not something i would do
<geist> innegatives: yeah that's what i told you a while ago, dont link the crt stuff, just do it yourself
<innegatives> ok will try
<geist> remember not every osdev tutorial is holy. it's just whatever some person did that day
<geist> there are a million ways of doing everything, some are compromises to avoid other problems
<geist> in this case i'd just do it myself because it's pretty easy, and i want to control precisely where the constructors are called, and then i dont depend on exactly what you're talking about with mcmodel=kernel, etc
<geist> so it's a tradeoff. i do it myself, which is some extra work, but then it's a stable interface so it's not going to break on me randomly
<innegatives> my linked kernel doesnt have any symbols like ctor_list or such
<geist> right, thats what i was saying you might need to look at the symbol list of your kernel and see what they're called
<geist> there's probably a pair of symbols for start and end
<innegatives> i mean it doesnt have anything resembling that
<geist> depends on what linker script your using
<gog> the generated code might slap them in .ctors and .dtors and your linker script should put them in the right place
<geist> do you have any global constructors?
<gog> with symbols bordering them
<geist> right
<gog> or rather, you will need to edit your linker scrip tto do so
<geist> i called it __ctor_start, etc https://github.com/littlekernel/lk/blob/master/arch/x86/64/kernel.ld#L61 but that's just what i named it
<bslsk05> ‚Äčgithub.com: lk/kernel.ld at master ¬∑ littlekernel/lk ¬∑ GitHub
<geist> i dont know what linker script you're using, or if you're using the default ones, what the default name is
<geist> suggestion: dont use global constructors, they're really dangerous
<geist> it's kinda a hand grenade you're holding there
<innegatives> geist: do you use them in lk? if not why you have ctor init code?
<geist> the core system doesn't use them, but i can't control if someone links in some C++ and wants to use them
<geist> so i provide the functionality
<innegatives> I was hoping to have a global Console instance so different systems can log without being passed a dependency. Is the non-dangerous way to pass the Console down from main to all the other subsystems?
<geist> also note they're called somewhat into the system: https://github.com/littlekernel/lk/blob/master/top/main.c#L96
<bslsk05> ‚Äčgithub.com: lk/main.c at master ¬∑ littlekernel/lk ¬∑ GitHub
<geist> as in a lot of the kernel is already initialized before calling them
<geist> well, you could do an inplace constructor for it so you can control precisely when it's created
gmacd has quit [Ping timeout: 250 seconds]
<geist> and then leave a pointer to it in a global
<geist> for large singleton C++ objects that is a messy but enerally clean way to solve it
<geist> can write a class that handles the details. i think for zircon we call it something like lazy_initialize<type> wrapper template class
<geist> that lets you alloc a global that you explicitly control when you initialize it
<geist> under the hood it's a byte array of the same size/alignment that it placement news the object out of
<innegatives> hmm, that sounds much better
<geist> but i think i was saying before, this is part of the much more complicated world you take on if you write a kernel in pure C++
<geist> lots more of these fiddly details to be aware of
cultpony has quit [Quit: ZNC - https://znc.in]
<innegatives> geist: some other day someone here told me that all i need to be aware of as far as cpp goes is this list: https://wiki.osdev.org/C%2B%2B
<bslsk05> ‚Äčwiki.osdev.org: C++ - OSDev Wiki
<innegatives> is there more to it?
<geist> oh i dunno, i dont particularly want to read that wall of text
<geist> probably. C++ never ends.
<geist> but i saw your makefile and you're turning off a lot of features so thats good
<geist> but again i wouldn't really recommend trying to write a kernel unless you're at least moderately experienced in it
<geist> especially given that there are lots of things that if you're not aware of, *by omission* you'll have problems with
<geist> ie things you dont know you dont know cause problems with it
cultpony has joined #osdev
<geist> that page seems to cover just the basics, none of the hazards of the language itself
<geist> more like run time support
<geist> flip side is, well if you want to learn the details probably not a bad idea
<innegatives> ok thanks
<innegatives> ill stick to it for a while
<geist> er the sentence aove where i said dont write a kernel i mean 'dont write a kernel in C++'
<geist> writing a kernel, go for it, i totally approve
<geist> just first time doing a kernel plus first time really dealing with low level details of C++ is a double whammy
<heat> aw fuck i have the GREATEST NAPS
<geist> grats!
<heat> geist, fyi crtstuff is usually PIC..... gcc doesn't do it by default because they're smelly poopies
<innegatives> geist: like you said, define global pointer and init the constructor yourself, but for that I assume I need a heap impl?
<heat> but my hosted GCCs, etc, they all have PIC crtbeginS.o and crtendS.o
<geist> innegatives: not for placement new
<heat> not that I entirely recommend linking those two object files in, but it Just Works
<geist> innegatives: look up placement new. it's a special kind where you feed it a void * of the memory to run the constructor on
<heat> it's the least-conflict solution that covers the most ground. this entirely stops working once you realize clang does not have the objects, and only does init_array
<heat> because global initialization is freaking hard
<geist> heat: i think it's not that its PIC, it's the whole mcmodel=kernel stuff
<innegatives> geist: sorry for noob questions but where do i get this void* region of memory from?
<geist> innegatives: you can declare an array of bytes next to it
<heat> geist, PIC compiles fine for -2GB code
<geist> ie *basically* (though not exactly) something like
<heat> erm, links fine
<geist> heat: then take it up with innegatives
<sham1> With the normal caveats about things like alignment applying
<heat> I do distinctly remember that crtstuff is not PIC by default, it's what I'm saying
<geist> innegatives: char bytes[sizeof(foo]]; new (bytes) foo; or something like that
<geist> off the top of my head
<geist> and yeah what sham1 said
<geist> it gets complicated, but that's C++
<sham1> You need something like std::aligned_storage, but basically that
<heat> and bare metal x86_64-elf only does defaults...
<geist> sham1: yeah but doesn't have std:: so it's whatever the underlying thing s
<sham1> You can't go out there and just cause undefined behaviour with placement new
<sham1> Well yeah
<geist> `aliagnas(foo) char bytes[sizeof(foo)];` probably?
<geist> alignas
<heat> yeah
<heat> or good ol __attribute__((aligned(...))
<heat> )
<sham1> I'd rather the C++11+ standard thing of alignas
<geist> yeah i ten to prefer the old ones but have been mostly forced at work because code styles to adopt all the new c++ ones
<geist> and starting to dig it
<heat> i think i use this trick like twice through the whole kernel
<heat> it's majorly useless
<sham1> Of course, once you have an aligned storage thing like that, you can then build an equivalent to `std::variant` and get some very nice stuff out of that
<geist> we have a wrapper thing in zircon that makes it kinda nice, also nukes the deconstructors which is nice
<innegatives> geist: but then don't I need to impl "new"? Which would mean I need to impl malloc?
<geist> innegatives: no. that's why i said look up placement new
<geist> it's not what you think
<innegatives> ok
<geist> there are multiple types of new. *you* have to provide the implementation of
<sham1> Well you have to "implement" placement new, but it's trivial
<geist> but placement new is special because it doesn't rely on a heap
<geist> it simply passes the void * you give it to the constructor
<geist> whereas the 'normal' news you will need to also provide an implementation that calls through to a heap
heat has quit [Read error: Connection reset by peer]
<innegatives> it just says that "no matching function for call to "operator new(...""
<geist> *you* have to provide it
heat has joined #osdev
<sham1> void operator new(std::size_t bytes, void* ptr) { return ptr; }
<sham1> There, placement new
<innegatives> ah ok, thanks
<geist> you have to implement a few built in things, and all of the new and delete implementations (as you use them) you'll also need
<geist> but as sham1 points out, placement new is the most trivial of all
<sham1> You can even eliminate the bytes name, so you get `void operator new(std::size_t, void* ptr) { return ptr; }`
<geist> though std:: you probably dont have, so may need just plain size_t
<heat> i now realize kernel c++ sucks
<heat> wow you need to go through so much garbage
<sham1> I'm just transcribing from cppreference, so yeah. You'd actually use stdint.h provided by compiler as opposed to doing cstdint
<geist> well, i think we've sifted through like 50% of the initial garbage in the last 15 minutes
<geist> but yeah there's lots of footguns and whatnot
<heat> sham1, i have ridonculous hacks to include libstdc++/libc++
<heat> from my kernel
<sham1> Although you could just create cstdint by doing something silly like namespace std { #include_next<stdint.h> } or whatever
<geist> ah, lazy_init is the class
<bslsk05> ‚Äčfuchsia.googlesource.com: zircon/kernel/vm/vm.cc - fuchsia - Git at Google
<heat> i think the footguns really are the language itself
<geist> kinda neat, i need to reproduce that for LK
<heat> like this is just depressing boring work. there's a lot of the language you can't actually use
<sham1> Or something like `using size_t = ::size_t;` or whatever other silly BS
<heat> or better, shouldn't
<sham1> Of course, that can be then made into a macro and you can just do something like `DECLARE_TYPE(uint8_t); DECLARE_TYPE(uint16_t); ...`
<sham1> And yeah, kernel C++ loses a lot of the nice features you'd otherwise get, like exceptions
<heat> fyi declaring things into std apart from the tuple stuff is UB
<bslsk05> ‚Äčfuchsia.googlesource.com: zircon/system/ulib/lazy_init/include/lib/lazy_init/lazy_init.h - fuchsia - Git at Google
<heat> and will blow the fuck up if you try to include anything else libc++
<heat> again, fucking footguns
<sham1> Well myos::size_t then
<geist> i think at it's core it does a trick where it uses a union of the type and an aligned byte array of the tyoe
<sham1> Although you're also implementing your own subset of the standard library and the STL so yeah
<geist> there's some detail of C++ where unions of objects dont get constructed automaticaly
<geist> i forget the precise details
<heat> yes, they do not
<sham1> Yeah, with unions you have to take care
<heat> you need to palcement new them
<bslsk05> ‚Äčfuchsia.googlesource.com: zircon/system/ulib/lazy_init/include/lib/lazy_init/internal/storage.h - fuchsia - Git at Google
<sham1> That's one of the tricky things with doing something like a `myos::variant`
<heat> also you need to explicitly call operator=, ~class() for dtor, etc
<innegatives> one more noob question, declaring "Console *console" global pointer in my console.hpp leads to multiple definitions error (i do have guards), I init it with placement new in my kernel_main, where should I put the global pointer to be accessible everywhere without getting multiple defs error?
<sham1> Or `myos::expected` because you of course want to have errors without exception stuff
<geist> ah i see. it doesn't do a byte array, it just unions the object with an empty struct so that it doesn't get the constructor automatically run
<sham1> innegatives: extern the global pointer in the header and then define it in kernel_main
<geist> thus auto handles the alignment/size stuff
<innegatives> ah ok nice
<heat> the gang figures out C++ while writing a kernel in C++
<sham1> Twitch writes OS
<sham1> But yeah, once you have a heap, C++ does become a bit easier but you still have to deal with not having exceptions
<innegatives> how the hell did you guys learn all this crap
gmacd has joined #osdev
<heat> heroin
<geist> time
<sham1> Through sheer stupidity of spending so much time doing this kind of stuff
<heat> i have dedicated soooooooooooooo much time to my stupid fictional bad UNIX
<geist> or beig forced to because work
<geist> some thing si'm more interested in than others, but programming language details are fairly low on my list
<geist> but getting good codegen/performance/etc out of the language i have is high on the list, so lots of times i'm more or less forced to grok the details or i dont feel good abou tit
<sham1> I just like language lawyering
<sham1> I do it with C as well
<geist> yah i precisely dislike language lawyering. mostly because it's a neverending battle at work, and i let others do it
<geist> also makes it hard to actually like commit code if you have too many LLs around
<geist> much like real lawyers i guess
<morgan> i used to be able to language lawyer the hell out of C89 and now i've forgotten half of it 'cause I haven't written any C in five years and i'm much happier
<sham1> Sometimes the wiki has annoying amounts of UB in the example code, but oh well, it's just example code. One is better off rewriting it anyway
<geist> word.
<geist> sometimes it's better to teach with simpler, less perfect code, than to try to force someone new to undestand the complete wall of details, and thus they dont really learn
<sham1> Right and okay, for some "minor" UB like unaligned pointers I'm not too harsh, although it still hurts my soul, but then there are some things that just annoy me
<sham1> For example, casting just random pointers into pointers to structs. *That* grinds my gears, and sure, for things like for example multiboot stuff it's unavoidable, but still
<geist> but knowing when to bite your tongue is important
<geist> otherwise people stop listening
<geist> i think when teaching new folks the key is to introduce things in layers of complexity
<sham1> Right
<sham1> Other minor things are the use of packed structs with things like the GDTs and bitfields in general but again I do get that those do have utility as far as education is concerned
<geist> yeah i'm a bit torn about that. i generally dont like using bitfields for that sort of thing if nothing else because it's hard to tell when you're modifying a bitfield vs a full word. the ABI issue of how the bits are laid out i'm not as worried about *if* it's arch specific (like the GDT)
<geist> as in the compiler wont/cant really change that layout without an ABI change anyway
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<sham1> C++ famously has had a stable ABI :P
<sham1> Like okay, bitfields changing probably isn't that big deal since it's also inherited from System V ABI for C, but still
wootehfoot has quit [Read error: Connection reset by peer]
<sham1> One of the reasons I'm so enamored with micro- and nanokernels is that they let you get away from kernel space and into a (slightly) saner territory faster
goliath has joined #osdev
heat has quit [Ping timeout: 250 seconds]
heat has joined #osdev
<innegatives> Can someone please tell me why I get this error when compiling this: (text+0x330): relocation truncated to fit: R_X86_64_PLT32 against symbol `isr_handler' defined in .text section in ./idt.o https://github.com/jafarlihi/mepsitahl
<bslsk05> ‚Äčjafarlihi/mepsitahl - [WIP] x86_64 OS (0 forks/0 stargazers/MIT)
<innegatives> Is it because I link kernel to higher half?
gmacd has quit [Ping timeout: 250 seconds]
<innegatives> ah shit i fixed it
awita has quit [Ping timeout: 250 seconds]
<gog> hi
<sham1> hi
<gog> what's shakin
innegatives has quit [Quit: WeeChat 3.8]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<geist> sham1: right, that's my point. the layout of structs/etc is very much specified by the arch, at the C level
<geist> doesn't change much
<geist> if it did everything in the planet would break
<geist> name mangling, etc was a bit more flexible over the years
johnjaye has joined #osdev
<lav> gog: Shakin is a village in Dodangeh-ye Sofla Rural District, Ziaabad District, Takestan County, Qazvin Province, Iran.
awita has joined #osdev
<heat> geist, isn't it possible you kind of painted yourself into a kernel with the whole "expose vm objects" thing to userspace?
<heat> it seems like you're exposing way too many internal details to ever be able to change the inner workings significantly
innegatives has joined #osdev
<geist> it's a thing i've thought about a lot
<geist> there's some amount of abstraction there that's not obvious, and it's more of a polymorphic thing: the vm object may be a this or a that but you treat it like it's a container of bits
goliath has quit [Quit: SIGSEGV]
johnjaye has quit [Quit: WeeChat 4.0.0-dev]
immibis has joined #osdev
<innegatives> does osdev get easier once you are done with the initial hurdles?
CompanionCube has quit [Quit: ZNC - http://znc.in]
Stary has quit [Quit: ZNC - http://znc.in]
<geist> yes
thatcher has quit [Remote host closed the connection]
<geist> there is a certain amount of background knowledge you should ideally have, or at least will have to acquire pretty early on
<geist> though you are making it harder on yourself by both starting osdev and picking an advanced language to do it in
thatcher has joined #osdev
<innegatives> besides SDM, what can I read to crack x86_64 IDT interrupt ordeals?
<geist> the AMD manuals
<geist> similar but written differenlty. some things are clearer there
gmacd has joined #osdev
<sham1> Also more authoritative IMO. After all, it's not called AMD64 for nothing
gmacd has quit [Ping timeout: 240 seconds]
innegatives has quit [Quit: WeeChat 3.8]
CompanionCube has joined #osdev
CompanionCube has quit [Remote host closed the connection]
gmacd has joined #osdev
bgs has quit [Remote host closed the connection]
Stary has joined #osdev
awita has quit [Remote host closed the connection]
danilogondolfo has quit [Quit: Leaving]
CompanionCube has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
<heat> geist, i understand the sheer power you get by simply exposing all that (and its a microkernel, so you kind of have to)
<heat> but if you decide doing CoW vmos is stupid, you just won't be able to remove it
<geist> right
<geist> though really we do abstract that a bit
<geist> you dont raelly create one as much as you ask for a clone of a vmo, and then the kernel makes whatever it can to do what you want
<geist> ie, it's a but more subtle, to explicitly give ourselves wiggle room
<heat> hmm, interesting
<Ermine> vmos = ?
<heat> vm objects
<Ermine> thank you
<heat> aka what people usually call the containers of pages that get mapped for file-backed mmaps, etc etc
<heat> or pretty much what you'd call struct address_space in linux
slidercrank has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
vdamewood has joined #osdev
innegatives has joined #osdev
<innegatives> What's the difference between ISR and IRQ?
<innegatives> one is request other the handler?
<gog> an irq is an external event that causes the cpu to be vectored to an isr
<gog> interrupt request
<gog> interrupt service routine
<gog> an interrupt is not necessarily an irq
<gog> it can also be an exception or caused by an instruction
<heat> well, that's x86-speak
<gog> yeah
Burgundy has quit [Ping timeout: 250 seconds]
<gog> i don't know anything else about non x86
<heat> more formally, exceptions are synchronous stuff, interrupts are hardware-generated async stuff
<heat> i.e cli does not affect exceptions, you'll always trap
<gog> await heat
<heat> heat.js
<gog> yes
<gog> best js framework
<heat> x86 likes to confuse exceptions and interrupts because fuck me and fuck you and fuck everyone
knusbaum has joined #osdev
<gog> yeahhhhh
<gog> we love x86 here
<heat> i use "traps" for everything non-x86
<heat> because it soundz kool and actually covers both cases AFAIK
<heat> also arm calls everything exceptions
<heat> terminology is fun
Left_Turn has quit [Read error: Connection reset by peer]
<gog> heh traps
* gog fingerguns
<heat> the gang figures out what a "page" is
<heat> page, page frame, large page, huge page, compound page, page(s), page allocator
<heat> struct page
<heat> or paging vs swapping vs mmu
<heat> osdev is full of stupidly overloaded terms
<gog> osdev is fun
knusbaum- has joined #osdev
<FireFly> y'know I never thought about it but only just realised the "page" metaphor is probably related to "word"
<FireFly> in the sense of a page of memory I mean
knusbaum has quit [Ping timeout: 265 seconds]
<heat> also cache line :v
<heat> wait until you figure out linux got folios now
<FireFly> I guess yeah, maybe
<FireFly> lines are a bit more.. like, works outside of that metaphor too
<FireFly> but makes sense ye
<heat> i think we're just retrofitting meaning into words
<FireFly> do you think? hm
<FireFly> maybe
<heat> "characters" and "words" are probably truly connected though
<nortti> iirc under DOS a 16-byte chunk (granularity of pointers that only have the segment) was a paragraph
gmacd has quit [Ping timeout: 240 seconds]
<gog> a 3-tuple of 5, 7 and 5 bytes is a haiku
<FireFly> checks out
<heat> linux
<FireFly> the native memory structure of the epynomous operating system, of course
<heat> a linux is when you 69 hehe nice funny sex number
<gog> hahaha
<gog> hahahahahahahhahahaha
<gog> hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
* gog dead
<mjg> i'm scared of what's going to come after genz
<mjg> maybe a great reset
<gog> nuclear armageddon
<bnchs> mjg: maybe we won't live to our 40's or 50's
<mjg> getting to mid life is too mainstream?
meisaka has quit [Ping timeout: 248 seconds]
meisaka has joined #osdev
innegatives has quit [Ping timeout: 265 seconds]
knusbaum has joined #osdev
knusbaum- has quit [Ping timeout: 265 seconds]
Matt|home has quit [Quit: Leaving]
Matt|home has joined #osdev
<gog> hi
<nikolar> Hello
<zid> no
<nikolar> Back from the dead i see
<gog> zid likes to say no when i say hi
<gog> i don't think he likes me very much
<zid> no
<gog> see
<moon-child> meow