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
goliath has joined #osdev
raphaelsc has quit [Remote host closed the connection]
bauen1 has joined #osdev
pounce has joined #osdev
Gooberpatrol66 has quit [Read error: Connection reset by peer]
Gooberpatrol66 has joined #osdev
pandry has joined #osdev
alfplayer has joined #osdev
pandry has quit [Ping timeout: 256 seconds]
dude12312414 has joined #osdev
goliath has quit [Quit: SIGSEGV]
LostFrog is now known as PapaFrog
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
joe9 has quit [Quit: leaving]
edr has quit [Quit: Leaving]
heat has quit [Ping timeout: 260 seconds]
[itchyjunk] has quit [Remote host closed the connection]
m5zs7k has quit [Ping timeout: 260 seconds]
m5zs7k has joined #osdev
gog has quit [Ping timeout: 255 seconds]
Matt|home has quit [Ping timeout: 276 seconds]
Gooberpatrol66 has quit [Ping timeout: 245 seconds]
Gooberpatrol66 has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 256 seconds]
Gooberpatrol66 has joined #osdev
Gooberpatrol66 has quit [Remote host closed the connection]
mkwrz has quit [Ping timeout: 268 seconds]
mkwrz has joined #osdev
pretty_dumm_guy has joined #osdev
gbowne1 has quit [Remote host closed the connection]
exit70 has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
xenos1984 has quit [Read error: Connection reset by peer]
exit70 has joined #osdev
remexre has quit [Ping timeout: 260 seconds]
remexre has joined #osdev
xenos1984 has joined #osdev
pandry has joined #osdev
danilogondolfo has joined #osdev
stylefish has joined #osdev
stylefish has quit [Remote host closed the connection]
m5zs7k has quit [Ping timeout: 264 seconds]
m5zs7k has joined #osdev
m5zs7k has quit [Ping timeout: 268 seconds]
gog has joined #osdev
m5zs7k has joined #osdev
Gooberpatrol66 has joined #osdev
netbsduser has joined #osdev
Left_Turn has joined #osdev
Left_Turn has quit [Ping timeout: 255 seconds]
GeDaMo has joined #osdev
Left_Turn has joined #osdev
xvmt_ has joined #osdev
xvmt has quit [Ping timeout: 240 seconds]
xvmt_ is now known as xvmt
xvmt has quit [Ping timeout: 256 seconds]
zetef has joined #osdev
gog has quit [Ping timeout: 260 seconds]
xvmt has joined #osdev
pandry has quit [Ping timeout: 260 seconds]
pandry has joined #osdev
pandry has quit [Ping timeout: 252 seconds]
pandry has joined #osdev
pandry has quit [Ping timeout: 245 seconds]
pandry has joined #osdev
goliath has joined #osdev
pandry has quit [Ping timeout: 256 seconds]
pandry has joined #osdev
pandry has quit [Ping timeout: 264 seconds]
pandry has joined #osdev
rustyy has quit [Quit: leaving]
rustyy has joined #osdev
pandry has quit [Ping timeout: 256 seconds]
rustyy has quit [Client Quit]
rustyy has joined #osdev
pandry has joined #osdev
joe9 has joined #osdev
zetef has quit [Remote host closed the connection]
gorgonical has quit [Ping timeout: 255 seconds]
gabi-250_ has quit [Ping timeout: 240 seconds]
gabi-250_ has joined #osdev
heat has joined #osdev
HIA has joined #osdev
<zid> heat there you are, did you fix the big outstanding onyx bug yet
<heat> what bug
<zid> the keyboard is encrypted
<heat> that it sucks? no
<heat> never
<heat> unborn yourself and create a new save game as poortugal
<zid> we already tried that as russia and I beat you at that life too
* HIA decrypts china's undefined spaces in keyboards as secret places to go via air port scanners
<zid> advent in.. 14 hours
cross has quit [Remote host closed the connection]
<HIA> ETA: -140000
Matt|home has joined #osdev
Left_Turn has quit [Ping timeout: 256 seconds]
Left_Turn has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
HIA has quit [Quit: joins]
<zid> Nice that the schizos just let you know immediately
<zid> rather than making you follow them down the rabbithole first
HIA has joined #osdev
<kof123> there's an anubis atop the advent of code tree mcro d :D
cross has joined #osdev
zetef has joined #osdev
flom84 has joined #osdev
dude12312414 has joined #osdev
Matt|home has quit [Read error: Connection reset by peer]
virt has joined #osdev
Left_Turn has joined #osdev
flom84 has quit [Quit: Leaving]
gildasio1 has quit [Remote host closed the connection]
zxrom has quit [Ping timeout: 252 seconds]
virt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
virt has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
Matt|home has joined #osdev
netbsduser has quit [Ping timeout: 245 seconds]
HIA has quit [K-Lined]
netbsduser has joined #osdev
pretty_dumm_guy has quit [Ping timeout: 256 seconds]
pretty_dumm_guy has joined #osdev
zxrom has joined #osdev
gog has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
<mjg> ey mofoz, anyone with fedora linux?
<gog> no
Left_Turn has quit [Ping timeout: 252 seconds]
virt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xenos1984 has joined #osdev
<zid> gog: sickos.jpg
<gog> yessss hahaha yesssss
<zid> omg is gog a meme lookup service
<gog> MQL
<gog> mem query language
<zid> and the results are in GMML, gog meme markup language
<gog> yah
<gog> i moved house today
<gog> new house is nice
<zid> new house is awful
<gog> has some quirks that i'm going to either pester the landlord about or fix myself
<zid> moving, mainly
<gog> moving sucked yeah
<gog> but we got it done in less than a day
<gog> have to go back tomorrow to clean up old house
<zid> It takes me 18 months or so to slowly throw things away
virt has joined #osdev
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
zetef has quit [Remote host closed the connection]
<Ermine> mjg: i'm with fedora
pretty_dumm_guy has quit [Ping timeout: 276 seconds]
<Ermine> what do you want mate
pretty_dumm_guy has joined #osdev
<mjg> nuthin'
qubasa has joined #osdev
<heat> mjg ☕
<heat> am i right fellas
<heat> he never tells us what he wants
vdamewood has joined #osdev
edr has joined #osdev
Hammdist has joined #osdev
netbsduser has quit [Ping timeout: 256 seconds]
tomith has joined #osdev
netbsduser has joined #osdev
gbowne1 has joined #osdev
blockhead has quit []
Left_Turn 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!]
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
virt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Matt|home> alright.. i've been at this for a while and im just not sure how this is supposed to work.. stack memory is ordered, heap memory is unordered, whatever. how exactly does heap memory let you change it at runtime
<Matt|home> for context: im trying to solve the problem of creating an array of n size with a commandline argument
<zid> malloc(strtol(argv[1], NULL, 10))
<zid> you're welcome.
<Matt|home> .. any chance you'd be willing to walk me through that..
<zid> ...what?
<Matt|home> like, i thought after you ran the compiler through C code all variables were given addresses
<zid> int x;
<zid> x has an address yes
<zid> but the *value* of x changes at runtime.
<zid> int *y;
<zid> y has an address, the *value* of y changes at runtime.
<zid> the *value* that y contains, is an address.
<Matt|home> right. but for example, i cannot do something like: myarray[argv[1]]; ./program -arraysize 50;
<Matt|home> that is very illegal
<Matt|home> i don't understand how malloc or calloc fixes that
<zid> I don't even know what you're trying to say with that
<zid> argv[1] is an address
<Matt|home> okay, bear with me
<zid> you can't subscript an array with an address
<Matt|home> the program is supposed to take one argument, which represents the size of the array. ./program -arraysize n , doesn't matter
<zid> malloc returns a value for myarray to contain
<zid> int *myarray = 123;
<zid> myarray[1] = access memory at address 127
<Matt|home> ... i don't understand
<heat> Matt|home, the heap is *dynamically* allocated at runtime
<zid> which bit?
<heat> dynamic implies you can allocate and free it
<zid> There's two statements there
<heat> with dynamic sizing
<Matt|home> ... okay. so the stack is allocated before runtime, and the heap allocates memory at runtime?
<heat> static data (in the program's .data) is static, you can't change the size of it at runtime
<zid> none of that is relevent to anything you've asked so far
<heat> the stack also supports doing that btw
<Matt|home> ;_;
<heat> with VLAs
<zid> you don't seem to understand that.. memory addresses exist
<heat> like
<Matt|home> sigh. here, please be a little patient, im exhausted right now. i'll go ahead and write up everything in a pastebin
<heat> int main(int argc, char **argv) { int array[atoi(argv[1])]; } is valid C99 code
<zid> I'd think it'd b e more important to clear up the fact you don't seem to understand what memory is
<heat> it wasn't before because compilers were bad and stupid, and it's bad code now because it's pessimal
<acidx> it's spicy C99 code, but still valid
<zid> rather than caring about heap and stack and doing writeups
<acidx> (well, would need a prototype foir atoi(), otherwise it would be passed an integer rather than a ptr to a char)
<heat> INTS ARE POINTERS
<heat> CHANGE MY MIND
<zid> like it genuinely seems like we need to bust out the postal address metaphors
<acidx> heat: ints are usually 32-bit, pointers are commonly 64-bit
<zid> completely untrue, acidx
<heat> look at mr fancy here
<zid> it's not even like, *remotely* accurate
<heat> with his 64-bit machine
<mjg> i print all my pinters wiht %d
<zid> ints are usually 16bit, pointers are usually 16bit
<acidx> there you go
<mjg> and c programmers are usually 2 bit:X
<acidx> late 1900s computing
<zid> very occasionally you get a weird machine that is 32/32
<heat> mjg, is that a non-binary joke?
<zid> and on like, a tiny segment of thousand dollar chips, 32/64
<heat> ANYWAY vax vax vax
<zid> 8bit micros and pointers don't exist might actually be most common...
<zid> but then you don't really have "int" in the first place
<heat> if it runs on a vax, it runs everywhere, that's what i usually say
<heat> so if it doesn't run on your "64-bit" "architecture" then it may be that your architecture is not real
<heat> wake up sheeple
<Matt|home> okay
<Matt|home> https://pastebin.com/8BEgYRsf <-- i hope this gets the idea across of what im trying to do
<bslsk05> ​pastebin.com: Problem: understanding when arrays can have their sizes determined.1) First - Pastebin.com
<Matt|home> you're saying that with your method heat the array size can be set after compile time? i don't understand how that works
gildasio has joined #osdev
<heat> it just... works
<Matt|home> i mean im guessing it's because heap memory can be modified at any time?
<heat> the stack is somewhat dynamic
<heat> the stack expands and retracts
<heat> the heap expands and retracts
<zid> The language spec says it works
<zid> so the compiler generates a program where it works
<heat> .data is static, with a static size and does not expand nor retract
<zid> and if you have *any* clue about how memory addressing works, you can come up with several simple ways it could implement it
<Matt|home> okay. so it's not an OS thing that specifies "okay this group of memory is the heap this is the stack" ?
<zid> but like I keep saying, you seem to lack that fundamental knowledge
<heat> i don't understand what you mean by that
<netbsduser> Matt|home: the stack sometimes is managed with a distinct discipline by the vmm than heap memory
<Matt|home> doesn't matter.. i appreciate your help guys
<netbsduser> in that the vmm may be programmed to have the stack extended downwards in the event of a fault on some address not far prior to the stack
<heat> yo
<heat> that's out of scope!
<zid> all of this is out of scope
<zid> he doesn't understand how /memory/ works
<heat> static memory is static because it was simpler to make it static
<zid> management strategies are well beyond that
<zid> storage durations, heap, stack, etc
<Matt|home> it's been a very long time okay :\ i haven't done any coding in years
<zid> it's not a dig at you
<heat> it doesn't grow, it's a single region of size N, N which must be determined at link time
<Matt|home> mbad
<zid> If it's a dig at all it's a dig at heat for throwing out a lot of words very quickly none of which are going to help
<heat> sorry for trying to address the question
<zid> matt: "I don't understand why addition works" heat: "Well if you take a set of sets containing all sets, then by reduction..."
<zid> me: "Have you ever seen a number line?"
<Matt|home> <heat> int main(int argc, char **argv) { int array[atoi(argv[1])]; } is valid C99 code <-- are you absolutely sure?
<Matt|home> let me try
<zid> VLAs are infact, part of C99, yes
<heat> 400% sure
<zid> If you're lucky it will assemble to lea rsi, argv[1]; call atoi; sub rsp, rax
<heat> eh, i'm fairly sure it'll assemble to nothing
<heat> i hope
Gooberpatrol66 has quit [Remote host closed the connection]
<zid> reading comprehension, heat
<Matt|home> "a dependent statement may not be a decleration" is the error im getting
Gooberpatrol66 has joined #osdev
<zid> which compiler?
<heat> what program, what compiler
<Matt|home> vs code, gcc ,lemme try compiling
<netbsduser> i loathe vlas
<netbsduser> they are a beastly and worthless thing
<Matt|home> okay, VS code gives me the error, gcc does not
<heat> intellisense moment
Gooberpatrol66 has quit [Remote host closed the connection]
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> ITS NOT A C FEATURE IF CL.EXE DOESN'T IMPLEMENT IT
<heat> RIGHT??
<Griwes> it;s commonly agreed in some circles that like 85% of the uses of VLAs is accidental, by people who thought that they'd get an error if the array size was not a constant expression
<Ermine> not so intelli sense
<zid> https://godbolt.org/z/ssoTh4YWW yup, gcc's vla output is still.. very strange
<bslsk05> ​godbolt.org: Compiler Explorer
<netbsduser> microsoft's c compiler if i remember rightly hews close to an antiquated C and doesn't implement things that have been around for years like mixing of declarations and statements
<heat> that's not true
<zid> no, microsoft's C compiler's issue was that it only supported C++99 or whatever the closest standard was
<Matt|home> https://pastebin.com/gdiM20YJ <-- this is the code snippet giving me the error in vscode
<bslsk05> ​pastebin.com: /* For now, we are assuming an extremely standard game, will implement diffe - Pastebin.com
Gooberpatrol66 has joined #osdev
<netbsduser> it's to be expected as microsoft are C parvenus and were never part of its living tradition like the unix world was and is
<Matt|home> line 13
<Matt|home> im sorry to be anal about this, but just to be absolutely clear: that _is_ valid C code?
<heat> yep, that's fine
<heat> and valid
<zid> it's gross, mind you
<Ermine> You can always download clang
<zid> VLA + trying to declare something inside a switch
<Matt|home> thank you
<heat> but in all honesty you probably want to malloc instead
<heat> most uses of VLAs are just malloc for lazy people
<zid> VLAs are banned in most codebases these days I feel
<zid> They're impossible to police
pretty_dumm_guy has quit [Ping timeout: 256 seconds]
<Matt|home> i don't know what VLA is, but i do like vs code :\
<zid> [x]
<zid> is a VLA
<zid> variable length array
<Matt|home> ah
<netbsduser> Matt|home: i'm sorry but at a glance i believe you have written code which is neither accepted by most compilers nor syntactically sound by the iso standards
<Matt|home> i just asked if it was valid and you said yes ;_;
<heat> fyi vscode supports clangd
<heat> that's 200% correct
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<netbsduser> i haven't checked the grammar but i don't believe it's acceptable to have a bare declaration in that position at line 13
<netbsduser> while if you encased it in {} it would be
<zid> yea I think that's the case
<zid> I'd n ever ever ever dream of writing code like that, so I don't remember the rules on where/how you can dec inside things like cases
<heat> oh wait, there's a syntax error there
<Matt|home> okay , { } seems to have appeased vscode
<heat> numdecks = optarg;
<heat> should be numdecks = atoi(optarg);
<bslsk05> ​gist.github.com: c11 grammar · GitHub
<bslsk05> ​gist.github.com: c11 grammar · GitHub
<bslsk05> ​godbolt.org: Compiler Explorer
danilogondolfo has quit [Ping timeout: 245 seconds]
<netbsduser> as you can see what is demanded is a `statement` and a `declaration` is not tolerated there
<zid> There's hairy ass rules for these dangly bois
<heat> huh, weird
<Matt|home> okay..
<zid> there's a nice pdf but I don't remember what it's called ever
<zid> that has all sorts of C parser gotchas in it
<zid> and which version of gcc they had to be fixed in :P
<heat> n1256.pdf!
<Matt|home> https://pastebin.com/oh ffs screw you pastebin, screw you
<bslsk05> ​pastebin.com: Pastebin.com - Not Found (#404)
<zid> no it was all dangling else things and quotes from the spec
<zid> with references to gcc versions that were buggy wrt it
<Matt|home> i've made the adjustments you guys said to, thank you
<netbsduser> i still advise against VLAs
<zid> I could probably find it by grepping my irc logs
<zid> I still advise against declaring shit in ranom places, on top of VLAs
<netbsduser> because in the solely acceptable case for a VLA - when you know that the size of the array is well-bounded - you could just as well use the upper bound instead
<Matt|home> yep. with my code the way it is now, because the array was created inside an if/else in a switch, i can't seem to access it from outside
<Matt|home> the scope issue i ran into last time
<netbsduser> and if you use a VLA when the size is not guaranteed to be appropriately bounded, you are one of the 4 CVEs issued against systemd for doing so
<heat> systemd
blockhead has joined #osdev
<Matt|home> so i guess i really do need to use malloc for this
<heat> hurr durr
<zid> malloc won't fix your scope issue
<netbsduser> well systemd actually used alloca() in this case, but they are devil twins
<zid> alloca is just vlas for linux nerds
<zid> my mouse has ran out of electricity
<Matt|home> alright, time for a break. i wasted six hours today basically writing comments -_-
danilogondolfo has joined #osdev
<Ermine> rob pike said windows is better than linux
danilogondolfo has quit [Remote host closed the connection]
* blockhead wonders, did he step into 4troll by mistake?
<netbsduser> rob pike says a lot of things
<heat> Ermine, he's correct
<netbsduser> he even said smalltalk spelt out words like "create" in its methods, rather than "creat", because there was no grep in smalltalk-80
<netbsduser> he even said a lengthy piece which is called plan 9
<zid> I only hear good things about rob pike
netbsduser has quit [Ping timeout: 252 seconds]
virt has joined #osdev
netbsduser has joined #osdev
<heat> mjg, fyi i needed to organize some patches so i created a dir named patchen
<heat> it won't be long until i start using it unironically
<Ermine> heat: seems like I'm not too far away fron screaming "linux pessimal, windows optimal!!!"
<immibis> why did grep prohibit spelling words properly?
<bslsk05> ​commandcenter.blogspot.com: command center: Notes from a 1984 trip to Xerox PARC
virt has quit [Ping timeout: 268 seconds]
<netbsduser> "The way defaults work in methods (isomorphic to procedures) is interesting, but necessary because the generality of the design leads to argument-intensive methods. There are too many big words, which stems partly from the lack of a grep (making it necessary to have overly descriptive names) and partly from a desire to have the language look a little like English."
Left_Turn has quit [Read error: Connection reset by peer]
netbsduser has quit [Ping timeout: 256 seconds]
<heat> gog, i took inspiration out of your efi makefile
<heat> good shtuff
<gog> where
<heat> your efi loader makefile
<heat> for clang
<heat> but i have a major annoyance with it
<heat> you're calling CC LD