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
Ali_A has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Ali_A has quit [Quit: Connection closed]
mahmutov has joined #osdev
joe9 has quit [Read error: Connection reset by peer]
joe9 has joined #osdev
heat has joined #osdev
nyah has quit [Ping timeout: 272 seconds]
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
dequbed has quit [Ping timeout: 240 seconds]
dequbed has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
srjek has quit [Ping timeout: 252 seconds]
ns12 has left #osdev [bye]
<geist> okay straight talk, network stack
<geist> how often should you consult the routing table when sending packets? obviously the model is you consult it every time
Matt|home has quit [Ping timeout: 240 seconds]
<geist> since if routing table change, it should find new route!
<geist> but, clearly that's slow for modern throughput
<geist> so i *assume* modern stacks do some sort of caching of that per socket or whatnot, and then maybe have a mechanism to shoot down existing caches
<heat_> usually you cache it on connections
<geist> but i haven't looked
<heat_> even for udp
<geist> yah was thinking that too
<geist> so, obvious way is to hold some pointer to the nic or whatynot in the socket itsef
<geist> but thinking a simpler scheme may be some sort of routing table generation counter
<geist> and bump it when table changes, and next packet out will force a re-eval
<geist> can see obvious issue with that?
<geist> (would still hold pointer, but would be simpler with shootdowns on routing table change)
<heat_> well, why do you want it to change?
heat_ is now known as heat
<geist> ip changes, link goes up and down, etc
<heat> yes but in that case the whole connection goes down
<heat> if you start messing around ip route add in linux i'm 99% sure you won't mess with any existing connections
<geist> possibly. question is how does one shoot down connections that way
<geist> oh sure i'm not saying you shoot connections down, just force a reeval in case what you added should be the new route, etc
<heat> right, but what I'm saying is that the old connections will use the old route
<geist> i suppose the correct model is yuo find all outstanding connections and reevaulate each one, deciding to shoot down or update
<geist> hmm
<geist> unless the old route is now invalid
<kazinsal> option 2: do something like Cisco Express Forwarding wherein every time the routing table changes you pre-cache destination information based on the changes in a radix tree
<heat> if you think tcp, tcp doesn't make sense if you change the IP in the middle
<kazinsal> for IPv4 you can do this super cleanly with a four-level 256-way trie
<heat> haha 16 bytes go brrrrrrrrrrr
<kazinsal> for IPv6 I have no idea what you'd want to do really
<geist> actually that's a point. on ipv6 for exampel if you're doing the ephermeral local address thing you'll actually be cycling through them reasonably quickly
<geist> but in that case you almost certainly dont want to throw away an address there's a socket open on
<geist> i assume when i creates a new ephemeral local address it puts it at the top of the routing entries so new sockets start to pick it
<geist> but keeps the old ones alive as long as there are existing connections. or if the existing connections have cached everything, as heat was saying, the routing entries can go because they dont need to be consulted... hmmm
<heat> that probably depends on how you cache things
<geist> yah you almost want a pointer not so much to the network interface object, but a particular address object associated with the network interface
<geist> that way the open connection holds a ref to the address
<geist> but that would be independent of whether or not hte address is in the routing table
<geist> but if in the case of a link going down you force the address to go out of scope, you can then do a reverse shootdown, finding all of the open connections and stop them
<bslsk05> ​github.com: Onyx/inet_route.h at master · heatd/Onyx · GitHub
<heat> really simple
<heat> *copied*
<heat> a socket never points at the routing table
<geist> yah might take a look in a bit. trying not to pollute my brain with too many existing implementatinos until i felt like i've thought about it enough
<geist> kind of a mental exercise so i arrive at kinda the same thing the hard way
<geist> at the very moment here in my refactoring of my stack i have the socket hold a copy of the local address that will be used to find the nic in the routing table (which i have not implemented yet, it's just hard coded to pick the first nic)
<geist> but it mostly holds a copy of the local address so it can compute the ip pseudo header before going down a level
<geist> and of course tghe pseudo header has always been a huge violation of the layering
<geist> since otherwise in the pure layering model the UDP/TCP layer doesn't care what the underlying layer is and the routing table hasn't been consulted yet
<heat> layering is BS
<geist> truth
<heat> UDP/TCP sometimes have slightly different behaviour on v6 vs v4
<heat> v6 has no fragmentation
<geist> i'll probably still just implement the naieve 'check the routing table each time' here in a minute, but want to at least plan for the obvious optimization
<geist> yah, and i think checksums are non optional on v6
<geist> i haven't yet really dove into what would take to do a dual stack ad how much UDP/TCP code can be reused between them. presumably basically all of it, but as you say there are subtle differences
<geist> but since i actually have a V6 network here at my house and my computers use it extensively i should do it
<heat> yes, and the pseudo header is different, and the network stack is usually different (as you can usually do v4-on-inet6 sockets, and socket options are different)
<heat> geist: believe it or not, linux duplicated the code
<heat> tcp on ipv4 and ipv6 are two separate files
<geist> hrm
<heat> i 'member bsd did something similar too
<heat> i ended up using templates
<heat> I believe fuchsia's netstack3 is also heavily generic/templated code, but don't quote me on that one
m3a has joined #osdev
<geist> and it uses rust so it's totally magic
<heat> rewrite lk in rust
<heat> actually you should have written it in rust right from the start
<geist> yah if i really had the foresight i would have gone and implemented it in a language before the language was created
<heat> of course
<heat> the worst part of lk is that it isn't written in rust, the best is that you can rewrite it in rust
<heat> oh what
<geist> honestly i dont know why cpus aren't implemented in rust
<heat> my kernel is performing magic tricks
<heat> it's executing in memory that isn't mapped
<geist> since cleary cpus are the weak spot in the chain
<geist> back when Woz implemented the Apple ][ in rust the world was a better place
<kazinsal> without rust we couldn't have multi-terabit switch fabric ASICs
<geist> right, and obviously the moon landing
<kazinsal> finally unpacked my mac classic ii after having moved in like, almost a year ago
<kazinsal> boots right up like a charm
<geist> oh yay
<geist> so now the question is does the MMU fully operate on those
<geist> the classic II is famous for being slower than it should because of narrow memory bus
<geist> but... it's an 030 and it has a built in MMU i think
<kazinsal> yeah, the only thing it doesn't have guaranteed is an FPU
<kazinsal> not sure if this one has one or not
<kazinsal> I need to figure out if I can get this thing online. without any expansion slots you can't jam ethernet into it but it's got two RS-422 ports with a funky miniDIN-8 connector
<geist> i've seen at least one project that uses a rpi to emulate a modem for the purposes of gettig these things online
<geist> these things as in old things
<geist> but probably dosen't need a rpi for that if the software is avail
<kazinsal> yeah, I'm wondering if I can RS-232 it up
<kazinsal> I've got a cisco box handy that has a few extra serial ports for dialing in
<geist> i wonder how difficult a simple iscsi client is to implement
<heat> i'm so confused
<heat> i'm get a page fault for a random cr2, the rip isn't mapped and the TLB is fine
<heat> getting*
<heat> the issue is that the cr2 != rip so it's executing something
<geist> and what's the flags say? read or write?presumably it's not a instructino fetch
<geist> does it line up with what is in any of the registers?
<heat> honestly I don't even know
<heat> anything
<heat> i keep getting weird bugs that I can't 100% repro
<geist> probably worth sitting down now and trying to build some directed stress tests
heat has quit [Ping timeout: 256 seconds]
the_lanetly_052 has joined #osdev
the_lanetly_052 has quit [Max SendQ exceeded]
the_lanetly_052 has joined #osdev
not_not has joined #osdev
<not_not> Haiiii
atrapa has joined #osdev
not_not has quit [Ping timeout: 272 seconds]
<geist> bet it runs like butt
<kazinsal> this poor old drive is so slow
<geist> i put together a 7.1 install on my mac SE and it was terribly slow, reverted back to 6.5
<geist> but i've also seen that even with classic IIs its still pretty bad
<geist> like 7.x is when it suddenly exploded in complexity and ran much worse
<kazinsal> yeah, a 16 MHz '030 with a slower than normal memory bus is a bit of a dog for this
<kazinsal> hrm. netbsd/mac68k will run on it iiiiiiif it had more memory and a bigger hard disk. needs at least 6 megs of memory and 60 megs of available unpartitioned disk space
<kazinsal> I gotta say I'm impressed that the display is still extremely crisp and straight. doesn't look like it has any major deflection issues or anything
<kazinsal> up close it almost looks like e-ink
<geist> i think some folks actually make new memory sticks for them
<geist> thought i saw some on tindie the other day
<geist> though those may have been mac VRAM sticks
<geist> yah i do like the B&W displays, my only complaint is the refresh rate is too low for modern tastes
<geist> it is kinda headachy over time
<geist> i think all of the B&Ws had the same 50hz rate or so
<kazinsal> yeah, it's slightly off from whatever my phone's camera is expecting
<kazinsal> it's funny, it looks fine straight on but in my peripheral vision I can see the flicker
<geist> oh hmm, online says it's 60.14Hz
<geist> so that's probably why your phone cant deal with it
<kazinsal> neat example of persistence of vision operating a bit different when you're focused on something then when you're not
<geist> but it seems much more flickery than 60hz usually. maybe it's the decay rate of the phosphors on mine
<geist> but i have a wyse50 terminal here with green phosphors, for example, and it's completely fine. looks perfect
<geist> no flickers, completely pleasing
<kazinsal> does seem the sound isn't working though. nothing on the onboard sound, nothing through the headphone jack either. probably a funky capacitor
<kazinsal> holy moses this thing is BRIGHT when you crank the brightness control panel slider up
<kazinsal> dear apple: can you please send me some new retinas? thanks in advance
<geist> yah might want to be careful with old caps on those
<geist> i think the later classics and whatnot were in the Bad Era of surface mount caps
<kazinsal> yeah I'll probably do a teardown soon
ThinkT510 has quit [Quit: WeeChat 3.4.1]
xenos1984 has quit [Read error: Connection reset by peer]
<kazinsal> doho, I do have a copy of resedit on here.
ThinkT510 has joined #osdev
Teukka has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
Teukka has joined #osdev
atrapa has quit [Quit: atrapa]
Likorn has joined #osdev
dennis95 has joined #osdev
Killaship34 has quit [Ping timeout: 256 seconds]
aejsmith has quit [Remote host closed the connection]
aejsmith has joined #osdev
mlombard has quit [Quit: Leaving]
mahmutov has quit [Ping timeout: 260 seconds]
GeDaMo has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
Ali_A has joined #osdev
Ali_A has quit [Quit: Connection closed]
Burgundy has joined #osdev
Ali_A has joined #osdev
vimal has joined #osdev
Ali_A has quit [Quit: Connection closed]
m3a has quit [Quit: leaving]
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
mahmutov has joined #osdev
nyah has joined #osdev
C-Man has quit [Ping timeout: 260 seconds]
C-Man has joined #osdev
Likorn has joined #osdev
bliminse has quit [Quit: leaving]
freakazoid343 has quit [Ping timeout: 256 seconds]
bliminse has joined #osdev
k4m1_ has joined #osdev
k4m1 has quit [Ping timeout: 260 seconds]
k4m1_ is now known as k4m1
mahmutov has quit [Ping timeout: 260 seconds]
hodbogi has joined #osdev
nyah has quit [Quit: leaving]
nyah has joined #osdev
mahmutov has joined #osdev
k4m1 has quit [Remote host closed the connection]
k4m1 has joined #osdev
gog has quit [Ping timeout: 272 seconds]
hodbogi has quit [Quit: Lost terminal]
srjek has joined #osdev
gog has joined #osdev
gog has quit [Ping timeout: 260 seconds]
scripted has joined #osdev
<scripted> Okay, so the mbd is successfully being pass-throughed to my pageframe allocator but the mmap_len is still 0 according to gdb. Not sure what the problem is here, can anyone help? https://github.com/ScriptedDeveloper/CrazeOS/blob/unstable/src/pageframe/pageframe.c
<bslsk05> ​github.com: CrazeOS/pageframe.c at unstable · ScriptedDeveloper/CrazeOS · GitHub
gog has joined #osdev
<nomagno> scripted: is it an OS if it doesn't support userspace?
<mrvn> why do you have the mbd as globals?
<nomagno> I guess what the readme means is it's a kernel but the OS will be housed in these too at some point
<mrvn> and what's the memory contents? hexdump the mbd
<mrvn> atoi(lltoa(end_mmap_addr, 10)? What's that supposed to do?
<scripted> mrvn: hold up, my atoi function is faulty
<scripted> let me remove that
<mrvn> That must be the most convoluted cast from long long to int I have ever seen
<mrvn> It will break with repeated or overlapping entries as well
<mrvn> (it == the code)
<mrvn> sizeof(uintptr_t) isn't portable, will only work on 32bit or 64bit.
<mrvn> line 37
<scripted> Ok, I removed the atoi function and that lltoa bs in the while loop
<mrvn> Why does line 20 work?
<scripted> Why shouldn't it work?
<mrvn> line 21: current_end_entry is uninitialized
<mrvn> scripted: assigning an integer to a pointer?
<scripted> oh hell
<scripted> I see a fat warning for that
<mrvn> Try adding: -O2 -W -Wall
<scripted> Ok I did
<mrvn> now fix all the warning and then comment your code.
<scripted> Okay
<scripted> fyi, I used this article
<bslsk05> ​anastas.io: OSDEV: Implementing a basic x86 page frame allocator in C
<scripted> not sure if it's an actual good one
<mrvn> Seems bad to me. It has page frames by number or by address. Pick one.
<mrvn> Also how would that ever free a frame later on?
<scripted> Yeah that's the next step
Vercas has quit [Remote host closed the connection]
<mrvn> I would say that code is just a bad way to parse the memory map.
<scripted> How would you do it?
<mrvn> Beware that on actual hardware you do get memory maps with repeated or overlapping entries.
<scripted> god
Vercas has joined #osdev
<scripted> I'm not even sure why I'm writing a page frame allocator
<scripted> what can I do with page frames?
<mrvn> For the fram allocator simply implement a stack. free() pushes frames on the stack, alloc() pops the top of the stack.
<mrvn> When you have page frames then you can map them into the virtual address space.
<scripted> and then write a vmm?
<mrvn> yes.
<scripted> and when comes the pmm part?
<mrvn> that is the frame allocator
<scripted> ahh
<scripted> I see
<scripted> how do I implement a stack?
<mrvn> As for parsing the memory map: I first go through and collect al the usable ranges into a sorted list or tree. Merge overalpping or touching ranges. Then as second pass remove all the ranger that are not MULTIBOOT_MEMORY_AVAILABLE, your kernel .text, .data, .bss, ...
<mrvn> scripted: you can use a single linked list. Just put the address of the next page in every page to link them all.
<scripted> I see
<scripted> how much ram should I use for the stack?
<mrvn> If you don't have all memory mapped somewhere you can optimize that by putting 511 pointers to free pages + a pointer to the next stack page into a page.
<mrvn> scripted: 0
Ram-Z has quit [Ping timeout: 240 seconds]
<mrvn> or 4/8 byte. All you need is a pointer to the start of the list.
<scripted> Okay, so no allocation/very little allocation for stack
<mrvn> The metadata for the stack will be in the free pages itself.
<scripted> Right, so no need to allocate them
pretty_dumm_guy has joined #osdev
<scripted> I will first try to get this page frame allocator work and then optimize the code like you said
<scripted> instead of writing complete new
<mrvn> Start by writing a function that simply prints out the memory map in a human readable form.
<mrvn> start, end, size, type
<scripted> So I should delete the whole page frame allocator?
<scripted> like right now I only understand 1/3 of what I'm doing so I assume that's bad
<mrvn> I would start from scratch.
<scripted> or even worse, what my code is doing
<scripted> Ok, makes sense
<scripted> Is it true that the lowest megabyte is used for video?
<mrvn> no, but part of it
<scripted> Also, how do I get the start of the mmap and the end?
<scripted> Like I can only get the upper mem, lower mem etc
Ram-Z has joined #osdev
Matt|home has joined #osdev
freakazoid343 has joined #osdev
heat has joined #osdev
srjek has quit [Ping timeout: 256 seconds]
freakazoid343 has quit [Ping timeout: 240 seconds]
<scripted> Hello?
freakazoid333 has joined #osdev
<heat> HELLO
Likorn has quit [Quit: WeeChat 3.4.1]
<scripted> How can I get the start, end etc?
<scripted> Like it's not in the structure
<scripted> is there an osdev article about this?
<heat> what's not in the structure?
<heat> what structure?
* geist yawns
<geist> good morning folks
<gog> hello
<geist> yay a gog
* geist pets the gog
* gog prrs
* vdamewood gives the gog a fishy
* gog chomp fishy
<heat> yo geist have you seen x86's new top byte ignore stuff?
<vdamewood> Kitty go prrr
<geist> no i haven't
<heat> it's hilarious
<geist> oh yeah?
<heat> AMD and intel got two different solutions
kingoffrance has quit [Ping timeout: 240 seconds]
<geist> oh course
<geist> they're pretty firmly not on the sme page when it comes to system mode stuff
<heat> AMD's solution adds a new wrmsr to context switching
<heat> you have to restore the EFER
<geist> it has a control bit in it?
<heat> a new one yeah
freakazoid333 has quit [Ping timeout: 256 seconds]
<heat> they also broke bit 63 which linux people very firmly told them not to
<geist> do you need to switch it on context switch? what if TBI is just on?
<heat> you need to switch it on context switch because apparently "programs might/will break"
<geist> perhaps if you sometimes have it on, sometimes not. but if you always do then you might not need to
<geist> a detail worth investigating
<heat> intel sticked it in cr3
<heat> which is sane
<geist> indeed. however how does it affect user vs supervisor mode? or is it on all the time?
<scripted> heat: mrvn told me to get the start, end etc, but how do I get that?
<geist> if so, what bit is not effectively user/supervisor address? bit 56?
<heat> intel is only on in userspace, amd is on in supervisor and userspace iirc
<heat> yes
<heat> you also get ~2 bytes of tbi on standard 48-bit addressing with intel's solution
<heat> scripted, of what?
<geist> ah see that's probably whyt he intel one can do it simpler, there's no ambiguity as to how it applies to kernel space
<scripted> of the mbd
<geist> what is mbd?
<scripted> multiboot header
<geist> ah the multiboot memory map structure?
<scripted> memory structure
<scripted> yes
<heat> go through the array
<geist> i think mrvn was just saying start by printing it out
<heat> find the start
<heat> find the end
<geist> whcih has the side effect of showing you how it works, etc. gets your bearings tos tart on the next phase
<geist> ie, step 1 is parse it by printing it out, then you know whats in it and how to read it so you can get to step 2
<scripted> but how do I get the start address?
<geist> (breaking down the problem into a series of steps)
<scripted> it's not an object in the struct
<geist> hmm, do you have multiboot docs in front of you? i dont remember off the top of my head but it should describe it
<heat> the start address of what?
<heat> you get a pointer to the memory map
<scripted> geist: No I don't
<geist> then there's your step 0.5
<scripted> heat: of memory
<geist> dont figure this stuff out by hearsay, go find the docs
<scripted> got it
<bslsk05> ​wiki.osdev.org: Multiboot - OSDev Wiki
<bslsk05> ​www.gnu.org: Multiboot Specification version 0.6.96
Brnocrist has quit [Ping timeout: 256 seconds]
<geist> GeDaMo: awww come on they could have found it :)
<geist> was trying to lead them to searching the interwebs for it so they'd find it themselves
<geist> oh actually they did. sorry
<geist> anyway, yeah i think it is just a list of tag entries and it's 'inline' the multiboot info block
<geist> just a variable size of them
<scripted> what is a list of tag entries?
<scripted> like
<scripted> what do you mean
Brnocrist has joined #osdev
<scripted> define "it"
<heat> look at the fucking spec
<scripted> sorry sir
<heat> it's all there
<geist> hang on, i think multiboot version 2 is substantially different
<geist> not sure multiboot version 1 (which is the docs they're looking at) has it
<bslsk05> ​www.gnu.org: Multiboot2 Specification version 2.0
<geist> you want multiboot 2
<scripted> here is 2
<heat> does he?
<geist> ah multiboot 1 also has it, it's just less structured
<geist> search for 'mmap' on the multiboot 1 page
<scripted> Ok
<scripted> got it
<scripted> magic, flags, checksum etc
<geist> so yeah i'd start by writing some code to find and parse that, since that's your starting spot
<geist> plus you can print it and sanity check that you're parsing it properly
<geist> and optionally write some printing code
<geist> these are all things you'll need and want, so you just start building up your toolkit
<geist> it's like step 1 of 10000, but you gotta start somewhere
<scripted> so just parsing the staff got by the structure, got it
<scripted> thanks
<scripted> https://imgur.com/a/e9iADrO like this?
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
<zid> I've still never used mb2
<heat> i doubt your map is 144 entries long
<geist> but the low/upper mem looks right
<geist> that's the legacy format stuff
<scripted> heat: yeah, I used the wrong string manipulation function
<heat> how long is it then?
<geist> if you look at the main table it says that offset 44 and 48 is the mmap addr/length
<geist> but you also have to have flags[6] set
dude12312414 has joined #osdev
<scripted> I'm trying to figure out how to convert uint32_t to char* first
<scripted> but I can also attach a debugger and read the value of the mmap_len like that too
<heat> normally
<geist> suggestion: print it as hexadecimal first. easier
<geist> plus more useful for addresses
matrice64 has joined #osdev
<geist> hex is easier to print since each digit is just a 4 bit nibble, and so you dont need much math, just bit shifts, to get to the characters
<scripted> too late, I attached a debugger to qemu
<heat> laughs in / 16
<geist> okay, but i think you're missing the point
<geist> the *point* is to decode it in software and print it
zaquest has quit [Ping timeout: 260 seconds]
<geist> the value doesn't matter, we dont really care, we're trying to get you to parse it
the_lanetly_052 has quit [Ping timeout: 260 seconds]
<scripted> geist: ah got it. I thought the way of getting the value didn't matter.
<scripted> either way, it didn't work via gdb either
<heat> well no, I care
<scripted> it can't access that memory either way
<scripted> for some reason
<heat> I can see if you're parsing it right if you tell me the numer lol
<scripted> yes sir
<geist> right, the value *matters* in the sense that if you're parsing it it should be sane
<geist> but it doesn' tmatter in the sense that it doesn't change our life in a meaningful way
<heat> 144 is way too large, even if you were running some cursed UEFI set up
<geist> but the result is you're parsing it properly
<geist> yah
<scripted> heat: 144 is wrong too
<heat> tip: uint32_t's are parsed in the same way as other unsigned ints
<heat> in fact I bet a uint32_t is an unsigned int
<zid> uint32_t is just defined as half a uint64_t obviously
<zid> typedef uint32_t __attribute__(("axe")) uint64_t;
<zid> I assume you're supposed to use PRIu32 for it though?
<heat> yeah
<heat> but
<heat> who the fuck uses those
<zid> I don't in code where I wrote the printf hardcoded to int = 32 :P
<heat> my printf isn't mine
<heat> so it's nice and correct
<zid> I can knock out a printf in 10 mins tht supports %d and %x and that's.. 99% of what I use anyway
<heat> don't knock a printf out :0
<geist> heat: i use those
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
<geist> or have been starting to use those more, with the *64s at least
<scripted> might be completely wrong
<zid> I'd use them if I ever wrote code that used uint types
<geist> because of differences in type on various architectures for 64bit values
<zid> I either use int, or I'm writing code where I've written the print implementation myself and I'm using 'u32'
<geist> doesnt matter unsigned or not, it's long vs long long in various arches
<scripted> yeah okay thats completely wrong
<geist> well, 0x90 == 144 so seems like you're at least consistently printing something
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
<scripted> oh my god
<zid> twelve 12 byte entries and it's a byte length?
<heat> hahahahah
<heat> hahahahaha
<scripted> :sad:
<zid> I know I'm hilarious heat but geez
<scripted> I want to copy a hex print function so fucking much
<geist> scripted: suggestion: try printing the mmap address too, not just the length
<scripted> but that'd be cheating
<heat> wait, it's bytes
<heat> 9 entries?
<heat> looks kinda legit
<geist> yah possible
<zid> my guess was 12*12 or 9*16 and I lost the 50/50 :(
<scripted> I might just completely learn how hex works
<heat> you should yeah
<geist> that's the idea here
<geist> these are all skills you'll need one way or another
<heat> i understand you're kinda lost here in osdev but that was also how I started
<scripted> completely skipped that
<scripted> heat: when did you start
<heat> i essentially learned most of my C while doing osdev
<heat> 2015
<zid> I kept my very early osdev stuff to myself and just dropped it when i got stuck, then came back a few years later, repeat
<scripted> heat: that's what I'm doing
<geist> yah, it's a harsh way to learn but a great attitude to use it all as a learning exercise
<heat> i know
<scripted> it's fucking hell compared to 3 months ago where I used C++ like it was python
<scripted> are you fucking kidding me
<bslsk05> ​'Hex Explained In Under 7 Mins' by CryptoJunkies (00:06:51)
<scripted> I thought this is a hex explanation!!!
<heat> hahahahahahaha
<heat> thanks eth
<heat> ok hex explained then
<scripted> I watched this for like a minute till I realized its something completely different
<heat> each digit goes from 0 to 0xf
<heat> so, base 16
<zid> I'm surprised schools don't do number bases other than 10 mor commonly
<zid> I remember learning about base 10 in year 3 in primary school, but nothing after
<heat> it's exactly like base 10, but with 16 instead
<heat> a is 10, b 11, ... f 15
<scripted> dont understand till this day how I dont suck at math but physics is killing me
<heat> how old are you
<scripted> not old
<scripted> early teen years
<zid> someone needs to make a hex version of these
<zid> (that's how we were taught number theory)
<heat> this may seem like gatekeeping physics but yeah that's not real physics
<heat> is it really physics if you don't have a line integral in sight?
<zid> physics isn't physics until chemistry is involved
<scripted> wait
<zid> because you're going small enough, hot enough, or fast enough for it to matter :p
<scripted> this is algebra?
<heat> what's algebra
<zid> number theory
<bslsk05> ​'Hexadecimal number system | Applying mathematical reasoning | Pre-Algebra | Khan Academy' by Khan Academy (00:07:34)
<scripted> am I missing something?
<zid> 'pre-algebra;'
<heat> i would not call number systems algebra
<scripted> I wouldn't too
<heat> but algebra is really generic
<zid> This is technically number theory, the pieces of it you can learn before algebra.
<geist> and of courseyou can learn what you want when you want
<scripted> I heard of number theory but never learned it
<scripted> geist: this is not possible sadly
<heat> how
<scripted> school
<zid> No learning! *smack with newspaper*
<heat> you can still learn what you want when you want
<heat> bet osdev is not part of your curriculum
<scripted> technically you dont have to do anything than dying
<geist> yah that's what i mean when i was saying that. trying to gently remind you that school is not the gateway to all knowledge
<scripted> heat: what do you mean by that?
<heat> unless sortie is your headmaster
<scripted> oh
<scripted> nvm
<scripted> heck yeah, they be teaching elementary school kids osdev
<sortie> Everyone, we have a new dark arts professor
<heat> professor UB
<scripted> cant find any good hexadecimal videos online
<geist> yah not sure vids are what you want there
<heat> my uni's operating systems course is just "hey this is a very brief overview of how an os works, here's how you do stuff with posix, done"
<scripted> at least videos help at high school shit
<geist> a decent page that talks about it should giveyou what you need
<zid> It's what all the cool kids do, look it up on youtube
<zid> I recommend the plastic props.
<geist> yah i'm not sure vids are good for all things, though i think i understand that younger generations are vid first
<scripted> zid: thats what we are tought in high school
<geist> i saw that when talking to my nephew and niece
<zid> Try the plstic props.
<scripted> "look it up on youtube"
<heat> search hexadecimal on tiktok
<GeDaMo> I don't really like videos for learning, I prefer reading
<scripted> heat: my teacher told us to search math videos on tiktok
<scripted> im serious
<scripted> all of 'em are tiktok addicts
<heat> your teachers are kinda shit
<scripted> they are
<scripted> ;)
<scripted> but hey, it's high school
<heat> when i was a youngin we couldn't even use wikipedia
<scripted> wikipedia is untrustworthy
<scripted> teachers like youtube as a learning source, but not wikipedia
<scripted> for some reason
<heat> youtube is super trustworthy
<scripted> yes of course
<zid> wikipedia is garbage for learning because it's vetted and how to teach something is an opinion, imo
<zid> youtube is ALL opionion and none of is vetted
<heat> i learn all my history and politics with prageru, great source
<scripted> you can trust pewdiepie explaining basic algebra
<heat> not biased
<bauen1> scripted: the same people that told me wikipedia isn't a reliable source and generally untrustworth are now pointing me to random youtube videos with "alternative opinions" :(
<GeDaMo> Wikipedia at least has references
<zid> Got your plastic cubes yet?
<heat> just a great, solid, honest source that is not funded by big oil
<zid> Speaking of funded by big oil, got your plastic cubes yet?
<heat> no plastic
<heat> :(
<scripted> bauen1: based
<scripted> it's quite funny how all my teachers tell me to look up everything on youtube and watch a video and you guys tell me not to do so
<zid> scripted: got your plastic cubes yet?
<heat> zid is the type of person to have a numbers theory course sponsored by exxonmobil
<GeDaMo> Chinese abacus can be used for hexadecimal https://en.wikipedia.org/wiki/Suanpan
<bslsk05> ​en.wikipedia.org: Suanpan - Wikipedia
<scripted> zid: which plastic cubes?
<zid> the ones I keep linking you pictures of
<bslsk05> ​www.pinterest.com: Hexadecimal Explained. How to convert hexadecimal to decimal. | Computer programming, Gcse computer science, Computer science
<geist> scripted: honestly it depends. not *all* things in youtube are bad. someone showing you how to change the oil on your model car, etc
<zid> what about your model of model car
<geist> that sort of stuff that's a direct application of a thing for a thing is great on youtube
<scripted> zid: error 404
<scripted> sadly not there
<geist> but stuff like basic programming or whatnot is a super hit or miss
<zid> amazon images are 100% hotlinkable, is your ISP doing silly things
<geist> and frankly i dont want to sit there at whatever pace the person explaining it is
<geist> but then maybe youtube is closer to the experience of sitting in class that high schoolers or whatnot are expecting at the moment
<scripted> zid: No, I mean the mathcurious link
<heat> scripted, you see how the decimal system works?
<zid> geist: I've never had a pdf tell me DON'T FORGET T LIKE AND SUBSCRIBE
<zid> AND NOW A MESSAGE FROM OUR SPONSOR, AUDIBLE
<heat> hexadecimal is like that but with 6 more digits
<geist> not to say there are bad youtube vids. i watch them constantly but they're usually some specific niche topic
<scripted> heat: eh
<heat> DOLLAR SHAVE CLUB
<geist> like fixing an amiga 1200, or dissassembling a NES game or whatnot
<zid> I'd go more basic, explain base 10.
<zid> Hence the cubes.
<geist> things where clearly someone isn't going to write a book or pdf or page on that exact topic
<zid> Or just get me to do it, I don't mind
<bslsk05> ​'Base 10 Number System' by Geoff Mihalenko (00:03:47)
<scripted> I have never learned this
<zid> why are you on youtube
<heat> stop looking for fucking videos jesus
<scripted> because this is elementary school stuff
<zid> there's literally people offering to personally explain it to you
<zid> and you're searching youtube
<geist> omg reminds me of this series of dumbass videos demonstrating liters vs quarts
<scripted> ok im here
<geist> it goes on for like 5 minutes pouring one into the other, demonistrating that they're not the same thing
<heat> do you know how to count in base 10?
<scripted> No
<heat> hexadecimal is like -- well you're fucked then
<zid> count to 14 for me?
<geist> (hint: you do)
<scripted> 1
<scripted> 2
<scripted> 3
<zid> on one line would be preferable
<scripted> 4
<geist> one line please
<scripted> 5
<scripted> 6
<scripted> 7
<scripted> 88
<scripted> *8
<scripted> 9
<geist> one line
<scripted> 10, 11 ,12 , 13 ,14
<heat> yeah
<zid> okay so you do know how to count in base 10
<zid> why did you start a second column after 9?
<geist> that's base ten. see how it bumps the second number after 9?
<zid> (this is hard to answer, don't worry)
eddof13 has joined #osdev
<bslsk05> ​ideone.com: sv5mKq - Online IDE & Debugging Tool - Ideone.com
<scripted> for(int i = 0; i <= 14;i++){printf("%i", i);
<scripted> there you go
<zid> yea headed there GeDaMo :D
<zid> scripted: focus
<zid> why did you start a second column after 9?
<geist> professor zid is speaking, quiet in the back of the auditorium
<scripted> zid: What do you mean?
<scripted> I just did so
<scripted> like
<scripted> I
<heat> yes, but why
<scripted> do
<zid> you at least notice that you did right?
<scripted> now
<scripted> I did
<zid> You went one column numbers, then numbers with two columns
<zid> because you ran out of digits right?
<scripted> yeah
<zid> That's a convention, we count 0 through 9, then reuse all the numbers again in a special way
<scripted> yes
<zid> (ten numbers, base ten)
<heat> hexadecimal is decimal with 6 more digits
<geist> (maybe base 8 next as an example?)
<zid> So that 'second column', you were using for 10 11 12 13 etc
<scripted> yes
<scripted> till 99
<zid> is actually showing ONE TEN and ZERO ONES
<zid> and ONE TEN and ONE ONES
<zid> or, referencing the image, the number 12 is "one stick, and 2 cubes"
<scripted> yes
<zid> If you write 463 that means "One sheet, six sticks, and 3 cubes"
<scripted> yes
<zid> That's base ten, and the basic number theory of 'what strings of digits mean'
<scripted> makes sense
<zid> do you know powers of ten?
<scripted> 10² etc
<scripted> you mean this?
<zid> Yep
<scripted> yes
<zid> You can also express numbers in that form
<zid> 463 is 4*10^2 + 6^10^1 + 3*10^0
<zid> four sheets, 6 sticks, 3 cubes
<zid> 463
<zid> all the same thing
<scripted> you could do this in 1000 different ways
<nomagno> A positional numeral system of radix/base N always works like that, yes
<nomagno> Base 36 (0-9A-Z) is the same
<nomagno> Only it's digit*(36^position_index)
<zid> Soo.. base n is where instead of writing 4*10^2 etc you write 4*n^2 etc
<scripted> now why is it called base 10
<heat> 0 through 9
<scripted> ah
<GeDaMo> There are ten unique symbols
<zid> so for base 4, you have for different digits, and you start a new column every 4
<zid> and your columns are worth 4, 4*4, 4*4*4, 4*4*4*4 etc
<zid> four different*
<nomagno> scripted: more pedantically because the radix is 10. Each position increases value by a power of 10
<scripted> ah
<scripted> I see
<heat> zid is actually a pretty good teacher
<zid> 1232 would be 1*64 + 2*16 + 3*4 + 2*1
<scripted> I'm surpised
<nomagno> In hexadecimal, where values are 0-15, each position increases value by a power of 16
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<scripted> never thought I'd learn math through irc
<heat> loving this numbers theory class sponsored by exxonmobil
<scripted> thank you
<zid> base 16 is just the opposite, where instead of having fewer numbers before you start a new column, you have more numbers
<zid> we don't have special pictures for those (a circle, a line, a squiggle, a double squiggle, aka 0 1 2 3 ..)
<zid> so we tend to re-use letters of the alphabet
<zid> so A = one more than 9, B = 2 more than 9
<zid> etc
<heat> count to 14 in hexadecimal now
<scripted> C = 3 more than 9?
<heat> and then in binary
<scripted> dont know binary too
<zid> yup, so the 'digits' of base 16 are 0123456789ABCDEF
<scripted> lolol
<heat> hex = base 16, binary = base 2
<zid> binary is just base 2
<zid> you have 2 total digits
<zid> start a new column when you get to 2
<zid> 0, 1, 10, 11, 100, 101, 110, 111
<nomagno> 14 in binary -> 1110
<zid> 8 + 4 + 2 + 0
<zid> checks out
<GeDaMo> Four binary digits are exactly equivalent to One hexadecimal digit
<zid> (1*2^3 + 1*2^2 + 1*2^1 + 0*2^1)
<scripted> 1111
the_lanetly_052 has joined #osdev
<heat> what's 1111?
<scripted> just tried to replicate what GeDaMo said
<nomagno> scripted: In binary, that's the same as hexadecimal 'F'
<scripted> ah, so the last one
<GeDaMo> four binary digits range from 0 to 15 as does one hex digit
<zid> for 'day to day hex' you just need to remember 1, 16, 256 in the same way you remember 1 10 100 in base 10
<scripted> now why is that in the form how ram sizes?
<scripted> *of
<GeDaMo> 0b1111 = 0xF = 15
<zid> hex is just a shortcut for writing binary
<nomagno> You'll rarely need more than four hex digits
<geist> this is why hexadecimal is a nice way to display binary numbers, since it evenly divides out: each four bits of binary is one hex digit
<geist> since 16 is a power of 2
<heat> ram sizes are powers of two, hex is base 16 (power of 2)
<scripted> I see
<GeDaMo> nomagno: a 32 bit int requires 8 hex digits :P
<geist> 1111 1111 1111 1111 1111 1111 1111 1111 = 0xffffffff
<nomagno> GeDaMo: 32 bits was a mistake, and the C standard committee agrees!
<zid> it's much easier to double 1, 2, 4, 8, 10, 20, 40, 80, 100, 200, 400, 800, .. via hex
<scripted> ah so 0b1111 = 11 + 4 = 15
<zid> than it is to do it in decimal via 1 2 4 8 16 32 64 128 256 512 1024 2048 4096..
<zid> no it's 8 + 4 + 2 + 1
<nomagno> uint16_t -> based
<nomagno> uint32_t -> cringe
<geist> though folks dont use octal much (base 8) it also has the property of being a power of 2. so in that case every 3 bits is a number
<scripted> zid: why is that so?
<zid> because of place value
<heat> 2^0 + 2^1 + 2^2 + 2^3
<zid> 1111 in decimal is one thousand, one hundred, one ten and one unit
<zid> 1111 in binary is one eight, one four, one two, and one unit
<nomagno> geist: I think the main issue with octal is it's extremely awkward for its main use case, noting single bytes down
<nomagno> Because the leftmost digit is restricted
<GeDaMo> Machine word sizes used to be more varied
<geist> nomagno: right thats because modern machines use 8 bit bytes, so octal fell out of favor
<scripted> now why the fuck didn't I learn this in elementary school
<zid> we did.
<zid> :P
<zid> we had plastic cubes and everything
<scripted> we didn't have shit
<bslsk05> ​en.wikipedia.org: 36-bit computing - Wikipedia
<nomagno> geist: it was also used for 7-bit stuff such as ASCII
<nomagno> Which is even more akward
<geist> nomagno: but like on a pdp8, for example used 12, or pdp10 used 36, or pdp-1 used 18 bit bytes. all nice octals
<bauen1> scripted: i learned it in elementary school, but nobody at that time hinted that it could also be applied to not-10-based systems
<zid> 1111 in decimal: 1^10*3 + 1*10^2 + 1*10^1 + 1^10^0, 1111 in binary: 1*2^3 + 1*2^2 + 1*2^1 + 1*2^0
<zid> just to finish out that thought
<scripted> but why do you write that out like that?
<zid> because we're "talking" in base 10
<heat> it turns out not-10-based systems are pretty useless for normal people and only programmers think they're useful
<zid> it makes it VERY hard to talk about number bases without it
<zid> and the "words" for numbers barely help
<scripted> I dont think irc is the best place to learn about this
<GeDaMo> Usually we distinguish bases with prefixes 0b for binary, 0x for hexadecimal
<zid> 1*hundred + 1*ten + 1*one helps a tiny bit, but 'hundred' in base 16 actually means '256'
<geist> and vice versa. base 10 is useful for humans but hard for computers (with the caveat that many computers have BCD modes, which is basically base 10 math)
<zid> so it's easier to write the powers out
<heat> the gang goes on a zoom call to learn numbers with zid
<zid> And it's also how numbers work conceptually, each column is a power bigger than the previous column
the_lanetly_052 has quit [Ping timeout: 256 seconds]
<nomagno> I think hex could be a fairly worthy competitor to decimal in an alternate timeline, it would be more painful for scientists but it packs more punch per digit
<zid> one cubie, one line, one sheet, one cube, one hypercube etc
<zid> of side length n where n is the base
<bslsk05> ​github.com: sophia/kprintf.c at main · adachristine/sophia · GitHub
<gog> convert any base to a string
<zid> 12 is the superior base
<heat> decimal is our default because we've got 10 fingers
<zid> it's way more composite
<zid> heat: i'm from fenland so I have 12
<zid> gimmie six!
<bslsk05> ​i2-prod.cambridge-news.co.uk <no title>
<scripted> I think I learned the base 10 number system
<heat> wtf
<scripted> in elementary school
<nomagno> 16 finger gang
<GeDaMo> YOu can count to 12 on the fingers of one hand by using your thumb to indicate joints of your fingers
<nomagno> scripted: Uh, you DEFINITELY did
<zid> we all did, just the rest of us seem to remember :p
<zid> I can count to 1024 on one hand
<gog> i don't count
<zid> I gave up counting on my hands after age 6 though
<scripted> yeahh I did
<scripted> it was just way too behind
<scripted> in my brain
<heat> what the fuck do you mean
<scripted> oh shit
<heat> you definitely know how to count
<scripted> now I just used german methaphors in english
<zid> One person said: "The T- shirts are wrong I have seven fingers and three thumbs on each hand and 10 toes on each foot lol [sic]".
<scripted> yes but like
<scripted> I never heard ot the term base 10 number system
<zid> well, now you hve
<zid> and you've connected it to what you already know
<heat> you've heard of decimal though
<heat> dec = 10
<heat> tenimal
<heat> you count with 10 digits
<scripted> unconsciously I know it
<geist> they usually domt teach it as base 10 until they start teaching about base N
<zid> hexadecimal -> 16imal (hex = 6, dec = 10)
<zid> seximal is the best number base.
<heat> 69imal
<gog> nice
<zid> sexseximal is second best
<heat> man 2 nice
<nomagno> Sexagesimal but you don't believe in that age thingy
<scripted> so it has letters since 11 12 13 14 wouldn't make sense
<scripted> and 15
<gog> and 10
<bslsk05> ​'a better way to count' by jan Misali (00:18:01)
<heat> you could use other symbols of course
<zid> That's a youtube video about how to count, if you genuinely want a youtube video
<scripted> I found this
<bslsk05> ​www.sciencedirect.com: Just a moment...
<zid> nope, you want this video
<scripted> Why?
<zid> it's funny
<scripted> I thought videos are bad
<zid> I and pre-vetted it
<scripted> yeah fuck no
<scripted> 18 minutes
<scripted> get outta here
<zid> I'm watching it :p
<heat> you've been here for almost an hour learning how monke count
<geist> vids aren't bad. just vids as the default way of learning is bad
<GeDaMo> You've already spent more time than that learning about number bases in here :P
<scripted> but why till 15
<gog> number cringes
<scripted> and not like till 16
<scripted> or 210
<gog> because 0-15 is 16 values
<geist> 0 uses a spot
<zid> if you want 210 to be a single digit you need base 211+
<gog> [0,15]
<GeDaMo> four binary digits are equivalent to one hexadecimal digit
<scripted> simply make your own number system
<scripted> to osdev
<gog> alternatively [0,16)
<zid> That's what this video is about
<scripted> to make your OS more "original"
<zid> how do make your own number system, he's a conlanger
<heat> gog, never seen that notation
<gog> but since these are discrete values it's the same as [0,15]
<heat> just [0,16[
<bslsk05> ​en.wikipedia.org: Cistercian numerals - Wikipedia
<scripted> fuck, never thought counting would get this complicated
<gog> heat: we always used ) to indicate non-inclusive
<gog> idk if that's an american notation thing
<heat> y a n k s
<geist> gog: not sure. i've seen it all over the place
<zid> I vote we divide the channel into fifths, we each claim 0.2497 of the channel.
<geist> i try to use it when printing out ranges and whatnot when i remember
freakazoid12345 has joined #osdev
<gog> i wonder if it's changed or smth since i've been in maths classes
<gog> ¯\_(ツ)_/¯
<gog> it's less ambiguous in handwriting i'd say
<scripted> but guys
<heat> maybe it's an american thing
<scripted> why is it base 16 and not base 17 or base 18???
<gog> maybe it is
<gog> scripted: because base 16 is a power of two base
<scripted> why is it 16?
<heat> we use ; as a separator here because of , being the decimal separator
<heat> so [0;16[
<scripted> power of 4
<gog> it's easy to remember power of two bases and how they map to binary
<geist> because it's a power of 2
<GeDaMo> scripted: because four binary digits are exactly equivalent to one hex digit
<gog> 4 is a power of 2
<scripted> ah
<scripted> I see
<gog> 16 is 2^4
<scripted> so it was basically created to make binary more readable
<gog> 2 * 2 * 2 * 2
<geist> as we were saying before the reason hexadecimal is useful is because it's a power of 2. base 4, base 8, base 16, base 32 are also useful. but 16 is a nice sweet spot
<scripted> long binary
<gog> squished binary actually
<gog> long binary is binary
<geist> because it's also a even divisor of 2^8 2^16 and 2^32
<zid> [19:44] <zid> it's much easier to double 1, 2, 4, 8, 10, 20, 40, 80, 100, 200, 400, 800, .. via hex
<gog> there's octal too
<zid> [19:44] <zid> than it is to do it in decimal via 1 2 4 8 16 32 64 128 256 512 1024 2048 4096..
<zid> That's literally the reason we use hex
<zid> it's not the *direct* reason, but it's the reason
<geist> and yes, fundamentally it's to make binary more readable
<geist> sicne the cpu itself dont know nothin bout hexadecimal
<heat> makes decimal more readable too
<zid> and the way you 'read' binary is to add powers of 2 together
<GeDaMo> Two hex digits for one byte
<geist> it's pure binary
<zid> decimal gets.. messy, with powers of 2
<scripted> but why is there a 0 in front of any hex?
<zid> there's an 0x
<geist> that's a convention
<zid> to show it's base 16
<heat> you can also use h at the end
<zid> because it's really hard to write a subscript 16 on a computer
<scripted> yes but why not 3
<GeDaMo> 0x indicates a hex value rather than decimal
<scripted> like 3x
<heat> 3Ah
<zid> because 3x doesn't make any sense?
<geist> 0x. it's really 0 as an escape code, and 'x' as hexadecimal
<scripted> zid: yes but 0x also doesn't make much sense to me
<geist> '
<heat> ok
<scripted> there's gotta be a reason
<scripted> for 0
<zid> 0 by itself was the prefix for octal
<geist> '0b' is also used sometimes for binary
<zid> that got extended to 0b and 0x for binary and hex
<scripted> ah
<geist> that's why, and why 0 was a prefix for octal, i dunno. but that's what they decided on
<scripted> now that makes sense
<zid> 1152921504606846976 base 10, 1000000000000000000000000000000000000000000000000000000000000 base 2, 1000000000000000 in hex
<geist> it'll also screw you up sometimes. if yuo in C type something like 0123 thinking it's decimal 123, it's actually octal 123
<zid> if you want a.. bigger example of why decimal sucks
<zid> I've literally never done that once, I'm sure it can happen though
<geist> *should* have been something like o123 or x123 or b123, but that's backwards compatibility for you
<zid> I caught it as a bug in someone else's code though
<GeDaMo> 0c
<zid> they were doing \x00 escapes in a big string
<geist> occasionally in manyuals or whatnot you'll see a trailing 'h' like 0123h
<zid> and dropped an x
<geist> same thing as 0x123
<zid> on paper you write a small subscript 16
<scripted> all right
<scripted> math teacher gonna be confused next time
<geist> but yeah i think the real reason is back when C was getting started they only non decimal nubmer they needed was octal, since that was popular at the time, so they just used 0 as a prefix for that
<geist> and then added hex support later, so slipped it in with 0x
<zid> I blame VAX
<zid> it's always VAX's fault
<gog> yes
<scripted> vax?
<zid> ancient computer archtecture
<geist> then actually very recently i think 0b became a standard for binary, though it was an extension for a while
<gog> aka the best computer eveer
<zid> where a lot of modern weirdness comes from
<geist> nah, vax was much after that. pdp11 possibly, because it was suddenly a very popular 16 bit computer
<zid> it was modern enough they needed to 'invent' things like representing number bases, but ancient enough they needed to use hacks to do it
<geist> and a lot of unix/C grew up there
<scripted> is everyone studying computer science here
<gog> i did
<zid> we still use a lot of those hacks
<zid> no I never went to school
<scripted> what do you mean
<scripted> you went to school?
<geist> but pdp7 where C originally grew up on i believe was an 18 bit machine, and thus octal was more appropriate
<scripted> You're done?
<j`ey> neevr went to university/college
<zid> I'm 32 bro
<scripted> yeah
<scripted> zid
<geist> sicne that's 6 bits of octal
<scripted> I understand
<scripted> you know too much
* j`ey went to uni, but it was crap
<scripted> to be young
<gog> zid never went to any school, he was born with the knowledge of good and evil
<zid> But I lost the good half of the manual
<scripted> did the knowledge pay off
<gog> i went to uni but dropped out 3/4 through my bachelor's
<scripted> why
<gog> reasons™
<zid> face was too pretty was causing casualities
<gog> not back then :(
<zid> I still get really good acne that "will definitely go away in a few years" everybody said to me when I was 12 :p
<zid> I just got taller
<j`ey> zid: I dont get acne but didnt get taller, apparently its one or the other
<scripted> so in hex you start with the biggest number right
<scripted> 0xF
<zid> wat
<scripted> or wait
<GeDaMo> What? :/
<scripted> thats the smallest one
<scripted> stupid
<zid> "in decimal you start with the biggest number right, 9"
<scripted> lmao
<geist> most significant digit
<scripted> yeah no
<GeDaMo> You start at 0 in all bases
<scripted> 0x0
<GeDaMo> Oh, ok :P
<scripted> so yeah we all know the earth is flat right
<zid> if you're about to say something about hex, and it isn't true about decimal, you're wrong :p
<heat> yea yea
<scripted> so yeah we all shit in the bath tube right
<scripted> lol
<heat> wha
<geist> so the story goes, Alan Turing liked to use base 32 much to the chagrin of his cow-orkers
<geist> since that basically used 0-9 and then most of the alphabet
<scripted> theoretical informatics scaries me
<scripted> a lot
<heat> what's that
<scripted> if I look at it, it seems like alien language
<zid> being naked in public scares me
<zid> you do you
<heat> pussy
<zid> heat ONLY goes out in public naked
<geist> what is happen?
<bslsk05> ​www.theregister.com: The weird world of non-C operating systems • The Register
<zid> yea saw that on reddit yesterday
<scripted> me too
<zid> someone here said "ooh my thing got mentioned"
<heat> beta clothes vs chad naked
srjek has joined #osdev
<freakazoid12345> nice
<heat> when do they make a "the weird world of bad linux imitations"
<zid> so that your thing can be mentioned?
<heat> yeah
<scripted> 0x1F = 16
<gog> scripted: no
<scripted> or I'm just stupid
<heat> thou art stupid
<gog> 0x10 == 16
<zid> 16 + 15
<zid> 10 + F
<gog> 0xf + 1 = 0x10
<scripted> oh
<zid> one stick, and F cubies
<zid> one stick is 16, we're in base 16
<GeDaMo> 0x1F = 1 * 16 + 15 = 31
<scripted> so 0xf+1 and 0xF1 is not the same?
<zid> 1+2 and 12 is not the same?
<scripted> lol
<zid> >if you're about to say something about hex, and it isn't true about decimal, you're wrong :p
<GeDaMo> 0xF + 1 = 15 + 1 = 16
<geist> 0xf0 and 1 == 0xf1
<gog> 0xf1 == (0xf << 4) + 1
<scripted> god damn
<zid> probably should have had him count in hex at some point
<scripted> lol
<scripted> I know how to count in hex!!!
<geist> i think ya should have started with octal, but the time has passed
<zid> go on then (ON ONE LINE THIS TIME)
<scripted> ok
<zid> I did quickly do base 4 but I forgot to ask him to count
<scripted> till?
<zid> 20
<scripted> oh god
<GeDaMo> Count to 0x20
<scripted> okok
<zid> (That's two sticks, so you should know which decimal number it represents instantly)
<heat> geist, i've never used octal apart from file permissions
<heat> and accidentally, of course
<heat> "lets pad the numbers with 0s so they all line up correctly"
xenos1984 has quit [Read error: Connection reset by peer]
<gog> chmod 0777 ~
<gog> note: do not do this
<heat> that's not breaking much
<scripted> 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF 0xA6 0xA7 0xA8 0xA9 0xB0
<zid> bzzt
<geist> heat: sure but point is it's nice to count in
<gog> i mean if you're the only user on your computer
<scripted> chmod 777 /
<zid> B0 is several hundred.
<zid> You were supposed to be counting to 32 :P
<zid> 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20
<scripted> he said till 20
<scripted> what
<GeDaMo> How did 0xA6 come after 0xF ?
<geist> whaaaaa how did you go from 0xf to 0xa6?
elastic_dog has quit [Ping timeout: 260 seconds]
<zid> he's.. insane?
<zid> Literally my best guess
<geist> no, lets not insult the student
<scripted> 0xF = 15
<GeDaMo> And after 15 comes ... ?
<scripted> 0xA = 10 + 6 = 0xA6
<zid> A6 = 10 sticks and 6 cubies
<nomagno> 0xF0 = 16
<scripted> so 16
<GeDaMo> 0x10 = 16
<heat> NO
<scripted> oh my god
<gog> are we being played
<GeDaMo> scripted: https://ideone.com/sv5mKq
<zid> A6 = 10 sticks and 6 cubies, one stick is 16 decimal, so you said decimal 166 comes after decimal 15
<geist> count the way you did decimal: after 9 is 10 because the last digit rolls to 0 and the next one increments by one
<geist> so 0xf is really 0x0f, add one to that....
<nomagno> scripted: that's like the people in 1st grade who failed the roman numerals test. Yes, we had a test for that, and yes, I miraculously still remembered
<nomagno> :D
<gog> oh yeah we had to do roman numerals too
<gog> the worst numeric system
<heat> gog: you just lose all security but that's not breaking stuff
<scripted> nomagno: never learned those as well
<geist> come on everyone they're getting it, just need to get over this hump
<heat> chmod -R 0000 ~ would be much worse (DO NOT DO THIS)
<nomagno> got: They're fun tho
<gog> yes
<geist> scripted: focus. do you see why 0xf does not to 0xa6?
<nomagno> Makes you realize how bad pre-middle-middle-ages European merchants had it
<scripted> go
<scripted> what
<scripted> what my my irc client doing
<heat> idk
<heat> it's connected to libera
<zid> more focus than that
<heat> established a tcp connection, did the irc stuff
<scripted> everyone else using weechat too?
<zid> more focus than that
<heat> no
<nomagno> I'm using a matrix client, FluffyChat Android
<scripted> oh
<scripted> wait
<nomagno> Then connecting trough the bridge
<scripted> after 0xF
<gog> i use konversation
<zid> you guys are awful
<zid> literally trying to distract him on purpose
<heat> nomagno, bet that if you practice roman numerals all your life you get really good at stuff
<gog> anyhow, after 0xf
<gog> what
<scripted> let me think
<geist> yah seriously. we're almost there
<GeDaMo> What is 16 in hex?
<zid> hint: if it's true in decimal..
<scripted> 0x16
<heat> when you count from 9 to the number after 9 you put a 1 in the next column
<nomagno> heat: multiplication and crap is objectively more complex though
<scripted> or am I just stupid
<zid> scripted: 9 is the biggest digit in base 10, what comes after 9?
<scripted> 10
<zid> scripted: f is the biggest digit in base 16, what comes after 9?
<heat> no it's 19
<zid> scripted: f is the biggest digit in base 16, what comes after f?
<zid> but yea, you keep saying after 9 comes 19 or 18 or something for some reason, not 10, as soon as you're talking about hex
<zid> You count to 9, run out of digits, and start a new column, 1 stick and 0 cubies.
<zid> You count to f, run out of digits, and start a new column, ? stick and ? cubies.
<scripted> something with 0x1?
<geist> apply what yuo know about base 10
<nomagno> Yes, getting there
<scripted> 0x10???
<heat> yes
<gog> yes!
<geist> yes!
<scripted> finally
<nomagno> YEEEES!
<scripted> god
<geist> now, if you guessed that, you need to know *why*
<j`ey> scripted: do you know how to count in binary?
<scripted> because
<nomagno> now what' comes after 0x1F?
<scripted> after 0x1F?
<heat> yes
<nomagno> Yes
<j`ey> drum roll
<scripted> um
<GeDaMo> In decimal, what comes after 19?
<scripted> 1F is 16
<heat> NO
<zid> it is not.
<geist> no
<scripted> oh god
<geist> so back to the start, given what you just learned. count to 0x20
<GeDaMo> 0x10 is 16
<zid> You know, the name of the base?
<zid> x-imal = "how many digits before you start a new column"
<scripted> 0 1 2 3 4 5 6 7 8 9 A B C D E F 0x10 0x11 0x12 0x13 0x14
<geist> good, now keep going past 0x14
<scripted> 0x15
<geist> through at 0x20
<scripted> 0x16, 0x17, 0x18, 0x19, 0xA
<zid> you said A already
<zid> so you've gone backwards for sure
<scripted> oh
<scripted> right
<zid> what comes after 19 in decimal?
<scripted> 20
<scripted> 0x20?
<heat> no
<geist> aaah yeah you just confused em zid
<nomagno> What comes after 9 in hex?
<scripted> 0xA
<geist> so start from 0x16 again
<scripted> so 0x2A?
<nomagno> Right, so after 0x19?
<zid> 2A is two sticks of 16, and 10 cubies.
<scripted> 0x2A?
<geist> stop guessing. that's more hurtful
<scripted> oh
<heat> you see how you reset the first column when you count from 19 to 20?
<geist> start by counting again
<heat> 19 + 1 != 29
<scripted> 0x2A?
<scripted> wait
<scripted> I just said that
<geist> if you answer with a ? i'm assumingy ou're guessing
<zid> In sticks and cubies for decimal: 0c, 1c, 2c, 3c, 4c, 5c, 6c, 7c, 8c, 9c, 1s0c, 1s1c, 1s2c, 1s3c, 1s4c, 1s5c, 1s6c, 1s7c, 1s8c, 1s9c, 2s0c
<nomagno> scripted: the left column gets increased when you do F+1
<GeDaMo> Count from 0x10 to 0x20
<nomagno> You're doing 9+1
<geist> yes, what GeDaMo says
<nomagno> There's still 'room'
<scripted> oh god
<geist> counting is i think the best way.
<heat> scripted, grab a piece of paper
<heat> two columns
<scripted> 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20
<zid> there we go
<heat> one has units of 16^0, the second has units of 16^1
<heat> wrong
<geist> not quite scripted
<geist> close, but after 0x19....
<nomagno> scripted: That's decimal
<nomagno> After 0x19 comes 0x1X
<zid> In sticks and cubies for hexadecimal: 0c, 1c, 2c, 3c, 4c, 5c, 6c, 7c, 8c, 9c, Ac, Bc, Cc, Dc, Ec, Fc, 1s0c, 1s1c, 1s2c, 1s3c, 1s4c, 1s5c, 1s6c, 1s7c, 1s8c, 1s9c, 1sAc, 1sBc, 1sCc, 1sDc, 1sEc, 1sFc, 2s0c
<scripted> 0x1A
<nomagno> Yes. Now keep going from there
<zid> You kept going from 1sFc (one stick, 15 cubies) to 2A (2 sticks, 10 cubies) for some reason
<scripted> 0x1B
<geist> zid: i really dont think the stick and cubies thing is working
<geist> that's confusing as heck, to be frank
<scripted> 0x1C, 0x1D, 0x1E, 0x1F
<zid> cus he doesn't wanna read it and pay attention
<zid> not because it doesn't make sense
<heat> would be easier from a visual POV
<nomagno> scripted: just keep going
<heat> this is text
<scripted> zid: sorry for ignoring you
<geist> zid: it doesn't make sense to *me*
<zid> scripted: Go fill out an entire sheet of A4 paper with as many numbers as you can count and report back :p
<geist> i get kinda what you're doing, but it's too abstract
<heat> scripted, count from 1f to 0x30, one line
<nomagno> scripted: and after 0x1F, there's no more digits after F
<zid> It's literally the opposite of abstract, it's practical and physical
<zid> assuming you made the props I told you to make
<scripted> so
<nomagno> 19 + 1 is 20, what's 1F + 1?
<GeDaMo> It's physical and practical if you have physical cubes ans sticks
<heat> shhhhhhhhhhhhh let him think
<scripted> 0x2?
<geist> yah we have definitely hit too many cooks
<zid> 2 is the number after 1
<nomagno> 0x2 means 2
<zid> doesn't sound right to me
<scripted> right
<scripted> :facepalm:
<scripted> my brain isnt working today
<bslsk05> ​'Too Many Cooks | Adult Swim' by Adult Swim (00:11:11)
<scripted> might be I slept way too less
<nomagno> You're getting there
<nomagno> The left column has 2
<nomagno> The right column is empty
<zid> Might be worth staring at a hexadecimal counter until you can predict the pattern
<scripted> 0x1f0
<zid> shouldn't take 5 minutes tbh
<nomagno> You need to put SOMETHING in the right column of the number
<scripted> 0x1f1
<GeDaMo> No
xenos1984 has joined #osdev
<heat> geist, whats with that vid's title?
<nomagno> scripted:, no, 0x1F + 1 is the number 0x(2 EMPTY)
<nomagno> Replace that empty with a value that means nothing.
<geist> heat: too many cooks!
<scripted> 0x20
elastic_dog has joined #osdev
<GeDaMo> Is that the spoof sitcom which goes a bit wild?
<nomagno> Yes. Now if 0x10 meant 16, what does 0x20 mean?
<geist> GeDaMo: yeah
<scripted> 32?
<heat> yeah
<heat> and so on
<nomagno> Yes. Now what's 0x1F0 + 1? Think it trough
<scripted> god
<nomagno> You can do if. The rightmost column isn't full, you can see that visually
<scripted> 0x1F1?
<heat> yes
<nomagno> Yes.
<heat> 1ff + 1?
<scripted> 1ff1?
<heat> no
<scripted> lol
<scripted> 1ff0
<heat> no
<heat> stop guessing, think it through
<heat> from right to left
<scripted> 0x2?
<scripted> no
<scripted> stopo
<scripted> wrong
<heat> where did all the digits go?
<GeDaMo> Do you know how to do manual addition? Carrying digits to the next column?
<scripted> im showing severe incompetence in this
<nomagno> ^ Its the exact same, you can't delete the empty columns
<nomagno> You need to leave zeroes
<bslsk05> ​shogun.rm-f.net <no title>
<zid> Click that and watch it.
<nomagno> 19 + 1 isn't 2
<nomagno> It's 20
<nomagno> 4F + 1 isn't 5, it's 0x50
<nomagno> 1FF + 1 isn't 2, it's ?
<nomagno> What's the ?
<heat> hehe counting page go brrrrrrr
<scripted> 0x1FF0
<GeDaMo> 199
<GeDaMo> 1 +
<nomagno> scripted: that's NOT how you add numbers when you do it on paper
<nomagno> Draw it in a sheet of paper
<GeDaMo> You add the 1 to the 9 giving 10 but you can't store 10 in a column so you store the 0 and carry the 1 to the next column
<nomagno> 1 1 F
<nomagno> 0 0 1
<nomagno> +
<nomagno> Sorry
<scripted> 0x1FF1
<nomagno> 1 F F
<nomagno> +
<nomagno> 0 0 1
<bslsk05> ​shogun.rm-f.net <no title>
<scripted> 0x20
<geist> wow. i think we are so off the rails now
<heat> scripted, do you not know manual addition?
<nomagno> On a sheet of paper, draw 1 F F on top and 0 0 1 on the bottom
<nomagno> And act like the F is a 9
<scripted> ok let me do that
<scripted> then its
<scripted> 0x2
<zid> that's the number after 1
<scripted> right
<scripted> 0x200
<zid> That's the number after 1FF
<nomagno> Yes.
<scripted> ok
<scripted> got it
<scripted> I think I just forget adding the zeros
<nomagno> You see how the empty positions become zero?
<nomagno> You do that ALWAYS
<scripted> yes
<zid> http://shogun.rm-f.net/~zid/count7.html Click this scripted, see if you can predict the pattern while it runs.
<nomagno> No matter the base
<scripted> zid: thats too fast
<nomagno> scripted: Now what's 1BEF + 1?
<zid> you're just trying to predict, dw about it
<nomagno> Think, and make sure to leave zeroes in place
<zid> pretend it says 1.0 2.0 and that it's going 1/10th the speed but with 10x the precision ;)
elastic_dog has quit [Ping timeout: 260 seconds]
<GeDaMo> scripted: https://ideone.com/4sMdp5
<bslsk05> ​ideone.com: 4sMdp5 - Online C Compiler & Debugging Tool - Ideone.com
<scripted> 0x1BF0
<zid> heat: did you get to the boss yet? You need to wait for 0xFFFF then do the frame perfect shoryuken
<nomagno> Yes. That's it, you did a real hex addition scripted
<nomagno> You ALWAYS leave zeroes in place
<scripted> yeah I think I understand now
<heat> oh no oh fuck I closed it
<nomagno> What's 4FFF + 2?
matrice64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<scripted> 0x5001
<nomagno> And what's 6FFF + F?
<geist> FATALITY
<nomagno> final boss!
elastic_dog has joined #osdev
<mrvn> what's 0xCAFFEBABE + 0xDEADBEEF?
<geist> MULTIBALL
<nomagno> mrvn: DEADBEEF can't be compared with such lowly debug codes such as CAFFEBABE
<scripted> 0x7F30
<scripted> I dont know
<heat> wrong
<zid> I can at least see how it happened
<zid> 15 + 15 is infact 30, but 30 means 48
<zid> not 30
<scripted> what
<nomagno> scripted: ignore that for now
<GeDaMo> What's 0xF + 0xF?
<nomagno> ^
<scripted> 0xF*2
<nomagno> 0xF means 15, remember
<nomagno> But in a single digit, not two
<scripted> 0x10
<scripted> wait
<scripted> no
<nomagno> that has value 16, you did an oopsie
<zid> 15 + 15 is not infact, 16
<GeDaMo> Another way to do it is add 1 to the left 0xF and subtract 1 from the right 0xf so 0xF + 1 = 0x10, 0xF - 1 = 0xE which gives 0x1E
<zid> (Advanced course here would be teaching to reuse the '1 less than the base twice' mental arithmetic trick transposed into a different base :P)
<zid> I typed it but never sent it GeDaMo :P
<GeDaMo> I believe you :P
<scripted> but
<scripted> what do I do if it goes above 0xF?
<zid> pretty sure we covered F + 1
<scripted> right..
<zid> and how it definitely isn't 2, or 1, or 1F or 2A
<scripted> 0xF1
<zid> It's the maximum number you can fit in one column, and needs to be the same as decimal 16
<nomagno> scripted: you know how in base 10 a number with two digits the right digit is the ones and the left digit js the 10s?
<zid> F1 is 16*15 + 15, 249 or something
<nomagno> In hex the left digit is the 16s and the right is the 1s
<scripted> Okay
<scripted> 0x17
<zid> that's 23
<scripted> lmfao
<nomagno> Where do you get that 7?
<nomagno> Genuine question
<scripted> copied it from base 10
<zid> that's not what base 10 does
<zid> 8 9 10
<scripted> after 16 comes 17
<zid> not 8 9 18
<scripted> I should've focused on osdev and not on this, way too tired for math
<scripted> I'm more stupid than a 6th grader rn
<heat> no this is basic math
<gog> it's counting and you're overthinking it
<scripted> aka not using my brain
<scripted> it's currently in sleep mode
<nomagno> scripted: take a paper and recreate this:
<nomagno> 0___F
<nomagno> 0___F
<gog> 0x00f indeed
<nomagno> Then do the addition in columns
<zid> :D
<nomagno> scripted: you know how 0F + 1 = 10? You've 'consumed' 1 from the bottom F
<nomagno> F - 1 is E, you know that much
<scripted> yes
<scripted> I know that
<scripted> but
<nomagno> So F + F becomes 10 + E
<scripted> is 0x000F like a decimal or something?
<nomagno> It's the same method as addition in decimal on paper
<nomagno> But it's not decimal
<gog> no, its just like decimal addition 0xf + 1 = 0x10 so 0xff + 1 = 0xf0 + 0x10 -> 0x100, you carry the ones
<scripted> oh so 0xF is a very big number
<gog> no, 0xf is just the largest possible digit
<nomagno> scripted: it means, in decimal, 15.
<nomagno> ^
<gog> forget about the decimal value of the digit
<scripted> *0xFFFFFFFFFFF
<nomagno> 9 is the largest decimal digit
<nomagno> F is the largest hex digit
* j`ey is worried that person from discord was right
<scripted> 0x2F + 1 = 0x30
<zid> what did discord person say
<zid> I love gossip
<nomagno> scripted: yes, it's 19 bits which I believe is like 256 thousand something
<gog> scripted: YES
<gog> exactly
<nomagno> ^
<scripted> good
<scripted> on weekends, my brain is simply not turned on
<zid> get to biggest digit -> reset units column, increment tens column
<nomagno> scripted: do you have 30 pencils or something? Yes, it has to be at least 30
<zid> works in every base :P
<gog> based
<nomagno> Of the same thing
<heat> j`ey, who=
<heat> ?
<nomagno> You can use pieces of paper, but you NEED thirty of them
<j`ey> well they said that script.. was a troll and I thought they also said they kept asking thesimple questions a lot.. dunno
<scripted> dont have that much
<nomagno> 30 of anything small?
<scripted> 0xF + 0xF = 0x15???
<zid> nope
<zid> 0x15 is one sixteen and one 5
<zid> you're after two fifteens
<nomagno> scripted: Alright, are you on a terminal right now?
<scripted> yes
<scripted> always
<nomagno> With monospace font?
<scripted> sorry what
<zid> can you draw ascii art without it getting smushed
<zid> because your letters are all different widths
<nomagno> Do these two messages look exactly as big?
<nomagno> 129@#
<nomagno> %-';1
<scripted> yes
<scripted> so its monospaced
<geist> i think scripted wants to go to sleep
<scripted> nah I want to stay up all night, its weekend
<nomagno> scripted: hold on one sec
<scripted> even if im tired as fuck
<heat> no
<heat> please
<heat> no
<heat> this is #osdev
<scripted> yes
<GeDaMo> You lot can carry on if you want, I'm going to sleep :P
<heat> not #elementary-maths
GeDaMo has quit [Remote host closed the connection]
<zid> GeDaMo: can I come?
<zid> fuck
<scripted> fuck no
<scripted> I'm not going to do basic math
<zid> too late you already did some
<scripted> I had enough math lectures this week
<scripted> enough geometry
<heat> great
<heat> go to bed
<scripted> wanna know something
<scripted> I have an A in math
<scripted> LOL
<heat> ok
<scripted> ok
<scripted> you really want me to go off this irc
<scripted> dont you
<scripted> Well, what should I parse?
<zid> Is there an F1 race this weekend
<nomagno> scripted: Hold on
<heat> zid, think so
<nomagno> zid: no, Australian GP is next weekend.
<heat> actually no fuck
<zid> makes sense, they do different legs with a week break
<zid> and I imagine they're done in the gulf
<heat> there's footy though
<nomagno> At fucking 7 AM. Happy for Americans and Asians, but like c'mon!!!
<scripted> if I parsed the whole structure, what next?
<zid> I watch it later via piracy anyway
<zid> bbc lost the coverage ages ago
<nomagno> Think of the poor Europeans that only get 95% of GPs at reasonable times :(
<heat> i like f1 but I can't watch it
<heat> most races are just so boring
<zid> watch the hilight vod?
<nomagno> Not been like that in the last year in my experience heat
<nomagno> Races have a lot more going on with what teams and drivers not being in the same order every time anymore
<heat> this year's bahrain was just boring as heck for me
<zid> last race was infact, boring
<heat> and my favourite teams aren't winning so that's even worse
<zid> unless you've got your eye on a certain midfield team
<nomagno> What's your favorite teams?
<heat> mclaren and mercedes, in that order
<zid> I just want guenther to have a good time and not cry
<nomagno> zid: I'm one of the famous unconditional Alonso fanboys, so I'm just kinda sitting there hyped every race until inevitably something unlucky happens
<heat> i also strongly dislike verstappen
<zid> I hate verstappen
<heat> so every time he wins it's a no for me
<zid> he's got an incredibly punchable face
<heat> oh for sure
<nomagno> scripted: open a new terminal and run the following command 'curl https://termbin.com/yj8x'
<heat> and fucking red bull in general
<zid> hamilton's a bit of a sheltered idiot at times but he's not actively twirling his villanous moustache
<nomagno> No, that's not a virus, curls only prints stuff, don't worry
<nomagno> zid: what
<heat> zid, hamilton is nice for an f1 driver
<zid> You hear me sans mango
<heat> does the classic tax avoidance scheme of moving to monaco but
<heat> tbf who wouldn't move to monaco
<nomagno> I'm not a huge fan of Hamilton, again unconditional Alonso fanboy, but what even is that statement about Verstappen's moustache?
<scripted> nomagno: I did
<nomagno> He looks quite dumb most of the time
<nomagno> scripted: you got some text about addition?
<scripted> yeah
<zid> He's just.. incredibly talented at doing exactly the arsehole move
<nomagno> I don't think Verstappen could have an intimidating face if he tried
<zid> like a 1 dimensional bad guy character in an old movie
<nomagno> Scripted: well try to solve the exercise!
<zid> who sits there twirling his moustache saying evil things
<heat> yeah he's an asshole
<heat> + horner, marko
<heat> all grade-A assholes
<zid> horner is also an asshole yeah
<zid> That's why I want guenther steiner to win, as a driver.
<zid> Stick him in the red bull.
<zid> Then he'll finally be able to beat the midfield teams
<nomagno> Horner is literally paid to throw bullshit at the other teams then take advantage of the mess
<zid> horner is like.. hypercapitalist
<zid> "It's just business, filing a petty complaint is just using the rules to our advantage, blah blah"
<nomagno> I don't know where you guys get your coverage, all recent drivers except Mazepin last year have been respectable and fun
<zid> verstappen is literally the opposite of respectable and fun
<zid> He's dangerous and maddening
<zid> He's a very good driver, and what he uses those very good driving skills for is to dive up the inside then protest when he gets hit or hits someone
<scripted> 0x140? nomagno:
<nomagno> Dangerous driving is, like it or not, a common trair in the history of F1.
<scripted> *0x1E40
<zid> He's basically conditioned everybody to get out of his way instead of racing him
<nomagno> scripted: you aren't supposed to use the ones (decimal) column
<zid> so now anyone who races him and crashes gets whined at for being bad
<nomagno> it's just for reference
<scripted> oh..
<heat> yeah he crashed against hamilton a bunch of times last year
<heat> or tried to
<heat> dangerous
<zid> Like how people avoided mazepin under blue flags, they avoid verstappen under racing conditions :P
<zid> hamilton spent 8 months trying to pit around him
<nomagno> zid: That's like, I don't know, literally 50% plus of world championship contender in the history of F1?
<heat> no.
<zid> 2 months trying to race him and turned into some "awful sport who can't win without crashing max out"
<heat> vettel and alonso were crashing against each other in 2012?
<zid> schumacker had one very famous crash, in like.. 12 WCs
<zid> verstappen does it every week he's ahead in the points
<heat> wasn't it in monza last year where he literally got on top of hamilton?
<zid> dove him into T1 and rode up his tire
<nomagno> if you think about it, the gap between dangerous drivers competing for world championship is like, prost all the way to verstappen, you're right
<scripted> 0x1E?
<heat> also kept spinning his wheels
<nomagno> scripted: Take my internet medal
<heat> could've seriously hurt the other driver
<zid> To put it into perspective of how elbowy and un-caring about crashing the other driver is, consider that two random pink cars often do 8 corners side by side multiple laps a race
<nomagno> You did it
<zid> and verstappen's been alongside someone for like 8 frames of video last year
<scripted> nomagno: I did?
<nomagno> You did
<scripted> oh shit
<scripted> thanks a lot
<scripted> but that was just basic counting
<nomagno> I can now disconnect in peace while I make my way to the couch to keep arguing about some random people that mount metal horses
<heat> they're not random people
<heat> they're millionaires, sons of billionaires
<scripted> nomagno: Do that, thanks again for the help!
<zid> except my boy george russell
<scripted> and everyone else
<zid> He's the son of a fraudster
<zid> thai bride
<zid> (he grew up a couple of miles from me)
<nomagno> I like Alpine but I don't like that their sponsor had to be Microsoft of all people
<zid> I know basically nothing about alpine
<heat> this is beautiful and every other opinion is wrong
<zid> oh alpine was renault, til
<zid> I don't like france.
<heat> average englishman
<zid> It's in my blood
<heat> you did get ruled by frenchies for like 500 years
<zid> They were the norman french and normandy is part of the UK
<nomagno> zid: Renault rebranded itself in 2020->2021 transition, got Fernando Alonso onboard, and bet big on improving before 2025 AND being able to compete for WDC and WCC in 2025 when the huge regulation changes arise. They're doing good but most of the hype is essentially Ocon fans waiting for him to shine, the eternal Alonso fanboys waiting for a third WDC, and F2 WDC Oscar Piastri fans waiting for either of the two to get kicked out so he gets a seat
zaquest has joined #osdev
<CompanionCube> zid: all that's left is some islands though
<zid> nomagno: so no reason to care then
<heat> for now
<zid> I'm not french and don't like alonso
<zid> and the cool underdog team is haas
<heat> f1's a fake sport anyway
<zid> last year proved it
<zid> they did the race manipulation out loud
<heat> if your sport's supporters aren't best described by "Gary, 56, from Slough", you're doing things wrong
<mrvn> What's "The smallest positive integer that cannot be described in fewer than fifteen English words"?
<heat> one times one times one times one times one times one times one times one times one
<mrvn> heat: that only needs one word
<gog> negative negative one
<zid> I prefer i^2
<gog> yes
<heat> no you only need one word
vimal has quit [Remote host closed the connection]
<zid> It's the only way to enjoy i imo, people who use it without the squared are weirdos
<gog> anti-complex number gang
<heat> who enjoys i
<zid> omg heat learn to read
<zid> weirdos, we already covered this
<heat> even squared
<heat> there's no enjoyment to be had in complex numbers
* gog eats a complex number
<gog> mmm tasty
<geist> a complex flavor on the palate
* gog recedes into the imaginary plane
* kazinsal does a Q_rsqrt(gog); // what the fuck?
<scripted> oh my FUCKING god
<scripted> git just scared the fuck out of me
<scripted> I thought all of my commits were gone
<zid> is it because the commit IDs are in hex
<scripted> but I accidentally switched branches
<zid> spooooky hexadecimal
MiningMarsh has quit [Ping timeout: 272 seconds]
Ali_A has joined #osdev
MiningMarsh has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Likorn has joined #osdev
<scripted> something went horribly wrong with my git commits
<scripted> now my entire multiboot structure is fucked
<mrvn> don't use force. the force is only for the experienced.
<mjg> well presumably you still have your old commits
<mjg> protip: git reflog
<scripted> my dumbass didn't commit those
<scripted> everything seems to be fine just that multiboot structure isnt working anymore
<scripted> https://github.com/ScriptedDeveloper/CrazeOS/tree/unstable/src can somebody look over it real quick?
<bslsk05> ​github.com: CrazeOS/src at unstable · ScriptedDeveloper/CrazeOS · GitHub
<scripted> something's wrong with the multiboot structure
<zid> where is it
<scripted> kernel/kernel.c
<zid> weird choice but okay
<zid> Nope there isn't one in there
<scripted> there is?
<zid> You have four globals, 3 of which are functions, 1 of which is a pointer to a multiboot_info_t
<zid> no structures
<scripted> no I mean
<scripted> its getting passed
<scripted> by the bootloader
<zid> Then it's perfect
<scripted> but somehow I can only access it in the kmain function
<zid> because grub's code is fine
<scripted> but I want to also access it globally
<scripted> so shell/shell.c can use it too
<scripted> for some reason that doesn't work
<zid> okay so we're 1/3rd of the way to you asking an answerable question then
<zid> what do you expect to happen
<zid> what actually happened
<zid> what steps did you take to verify any of this
<scripted> I want the mbd struct to be accessbible in shell/shell.c
<scripted> shell.c is printing out some values of the struct
<scripted> as well as the amount of memory I have
<scripted> which is 0
<scripted> which is also not possible
<zid> that doesn't answer any of the things I just said
<zid> Let's use cars
<scripted> Why can't I access the mbd struct in shell.c?
<zid> "I wanted to open the sunroof" "I tried pressing the sunroof button" "but instead I just heard a grinding noise"
<scripted> It's literally 0 there
<zid> you said "I wanted to drive to the shop"
<zid> which line?
<scripted> 29-43 shell/shell.c
<zid> where is mdb declared for shell.c?
<mrvn> is your stack overwriting the mbd?
<scripted> not sure
<zid> as far as I can see, it isn't, and this shouldn't even compile
<scripted> it does
<zid> so where is it declared
<scripted> its declared in kernel/kernel.c
<scripted> and its defined as extern in kernel/kernel.h
<zid> you need a declaration where you use it, so that it has a type
<zid> also you swaped declared and defined
<scripted> yeah
<scripted> sorry
<scripted> not enough sleep
<zid> declaration "There is a thing", definition "this is the thing"
<scripted> I know, I just dont have enough sleep
<scripted> I will go offline once I fixed this bug
<zid> oh right, shell.c -> shell.h -> kernel/kernel.h
<scripted> yeah
<scripted> dependency hell
<zid> if I had the time/patience I'd clean it up
<scripted> nah it's all fine I will do it once day
<zid> I don't think you know how
<scripted> Why?
<zid> I don't know why, maybe you never learned
<scripted> It's mostly just keeping track of which function is used where
<zid> It's organized all wrong
<zid> do some test prints in that shell.c with some made up numbers via lltoa
freakazoid12345 has quit [Ping timeout: 256 seconds]
<zid> I don't trust it and I don't wanna read its source
<scripted> the lltoa function works fine
<zid> also lltoa the value of mdb itself
<scripted> weird, it has a value
<zid> ofc it has a value
<zid> it can't not have one
<zid> it's like saying int a; .... "weird, a has a value"
<scripted> no I mean
<scripted> nvm
<scripted> yeah well
<scripted> none of these properties have a value
<zid> They all have a value
<zid> and they're members
<scripted> they have a 0 value
<scripted> that's what I meant
<zid> wht's the value of mdb
<scripted> *a value of 0
<zid> that's the one I cared about
<scripted> 38114
<zid> 94E2 okay
<zid> are you using qemu or anything?
<scripted> yes
<zid> put xp /32bx 0x94e2 into its console
<scripted> how do I do that?
<zid> with your keyboard, probably
<scripted> No, I mean literally how
<scripted> there is no console than my OS
<zid> console than?
<scripted> like
<scripted> there is only the shell
<mrvn> mem_lower / mem_upper is irrelevant.
<scripted> of my OS
<j`ey> scripted: qemu console
<zid> You mean you don't have qemu's console open, okay
<zid> open it then
<geist> qemu has a debug console
<zid> run qemu with erm, -monitor stdio or something
<scripted> ok let me do it
<geist> various ways to get to it, and i fyou have just a gui i think it's ctrl-alt-3, or in the menu
<geist> depending on which OS you're on
<mrvn> scripted: Set MULTIBOOT_INFO_MEM_MAP and parse that properly.
<scripted> I get a bunch 0x000
<zid> then your mdb does infact, point at zeros
<zid> print it from main as well
<scripted> print plain mbd?
<zid> if you get a different value you fucked up
<zid> if not, and you still get zeros, you wrote zeros over it at some point
<scripted> I printed it from main before
<geist> *probably* an incorrect address
<scripted> it was that number
<mrvn> And don't make mbd a global. There is no need for it.
<scripted> I don't even know why it doesn't work anymore
<zid> put a while(1); after the print in kmain and do the xp command again
<scripted> mrvn: I need to pass it to shell.c somehow though
<mrvn> scripted: yes *pass* it to shell.c
<zid> if it's not zeros then, you overwrote that memory with 0s between the while(1); and your shell stuff
<scripted> its not 0
<scripted> literally no code is above
<scripted> just the terminal_clear_screen function that has nothing to do with it
<zid> prove it.
<zid> Do the steps I said
<heat> it's a wrong address
<heat> it's not even 4 byte aligned
<geist> agreed
<mrvn> .oO(There is nothing above it, execpt this something here that clears a big chunk of memory)
<scripted> yeah still 0x0000
<zid> you skipped 3 steps
<scripted> no
<zid> does it have the same value when you print it first in main, and when it later gets printed in shell
<scripted> I put the while loop
<zid> that was the first step
<scripted> yes
<scripted> it has the same value
<scripted> I did that first step
<zid> you have to tell me
<scripted> it has the same exact value
<geist> omg this is... omg
<scripted> I can't scroll up with this fucking irc client
<geist> i keep looking back and its still going on
<j`ey> lol
<zid> where did you do the print, before or after you checked the magic
<geist> honstly can you just share the code?
<scripted> after
<scripted> geist: I did, scroll up
<geist> now i just want to see where this is all going off the rails
<zid> then it's already wrong in kmain
<zid> and nothing to do with shell.c
<geist> not helpful, it's jsut a pointer to the git repo
<scripted> I should do it before I check if it has an invalid magic number?
<geist> i dont know where it is in the repo
<zid> and I seem to recall you being taught how to debug and check this 2 weeks ago
<zid> the magic is completely separate
<zid> the magic was the value in ebx or whatever
<scripted> I learned gdb myself
<zid> you just refuse to use it? :P
<scripted> no, I'm just fucking tired and want to go to sleep
<geist> then go to sleep
<zid> do it then
<scripted> no
<geist> yes please, if you're not making more progress, stop
<geist> there's a point where it's negatively useful to continue
<geist> every time i gets hard you just say 'i'm so tired and not thinking straight'. imagine what that means to folks trying to help you
<scripted> geist: I'm serious
<geist> i move we should stop helping them today so they'll go to bed
<geist> all in favor say aye
<scripted> wait
<scripted> wait
<scripted> its 0
<zid> I already ignored him again
<scripted> according to the debugger
<geist> nein. you're sleepy. nighty nite
<scripted> : (
<geist> sleep is good for brain function
<scripted> what is sleep
<geist> if you keep it up we're going to start officially thinking you're a troll
<scripted> its 0 AM here
<scripted> I slept 7 hours
<scripted> so no
<scripted> im not a troll
<scripted> just an addict
<heat> man 2 sleep on your favourite posix operating system
<geist> but you've been here for 4 hours? you got up at 8pm?
<zid> geist taking the bait again I see
<geist> heh
<geist> i know. i'm fairly convinced they're a troll at this point
<geist> oh wait did i just say that out loud?
<zid> I think they're just at least 2 years too soon to be trying any of this
<zid> maturity and experience wise
dennis95 has quit [Quit: Leaving]
<scripted> geist: what?
<heat> we spent 2 hours trying to count
<scripted> lol
<geist> possibly. frankly the part where they start saying 'omg i'm so tired' every time we try to help them is an insult
<scripted> ok stop
<scripted> ok
<geist> that implies a) i'm not actually listening to you because <sleepy>
<scripted> i will stop
freakazoid333 has joined #osdev
<geist> and b) i dunno, just a sign of disrespect
<zid> It's classic help vampirism, don't actually read the answers and try to digest them
<geist> anyway, if you're not a troll, seriously get some sleep and approach us again when you're not tired
<geist> if you are a troll, please go away
<zid> complain or moan about it being hard, never thank anybody, never internalize anything and just try again tomorrow
<scripted> okay I will go to sleep
<geist> end of line.
<scripted> (in 1 hour)
<scripted> cya everyone and thanks for the help
<scripted> like really a lot
* geist waves
<scripted> I was as dumb as a 6 grader
<geist> bye.
<mrvn> + It doesn't work, lets add random stuff, maybe it works then.
scripted has quit [Quit: WeeChat 3.5]
<geist> *probably* not a troll, but definitely a help vampire
<heat> mrvn, tbf I've done that and I wasn't a troll
<zid> agreed
<heat> i think everyone has done that
<geist> usually worth spending some time on in case they get it, but at some point it's a bail out kinda situation
<zid> They'll learn that other people are people too as they grow up hopefully, and that we're here because we're nice not to bail them out of having a single thought ever
<zid> s/nice/nice,
zaquest has quit [Remote host closed the connection]
<heat> they seemed too dedicated to be a troll, but at the same time, we spent 2 hours counting
<heat> 2 freaking hours
<geist> ah sigh. that was nice. just hate to see that many people spend that much time on it
<geist> yeah
<geist> and this is a case where a whiteboard or whatnot would speak a thousand words
<zid> Too ADHD riddled for that
<geist> or i... guess a vid that happened to be precisely what they need
<zid> literally just need 2 years to calm down
<geist> possibly. certainly much farther ahead than I was at that age
<geist> OTOH at that age there wasn't tutorials or the internet, so if you wanted to do this you had to just... i guess know
<zid> The help vamprisim is probably just what you learn in this era
<geist> or happen on a BBS where some programmer had uploaded some .txt file
<zid> people are everywhere providing videos and help channels and shit all over everywhere constantly
<heat> no high seas with books?
<zid> no reason to sit on a piece of paper in your lunch break trying to figure something out
<geist> probably how the bios call text file got started. i forget the name
<zid> when you can just hop onto irc on your phone
zaquest has joined #osdev
<heat> ralf brown's interrupt list?
<geist> but it was probably born in the era of sending text files around on BBSes or fidonet
<heat> rbil?
<geist> yah
<zid> one of my fondest 'learn to code' memories was on a playstation 2, with no internet or resources at all
<geist> i had done some assembly and whatnot, but was on a 6502
<zid> just using the in-program help file to try figure things out
<zid> (it had built in BASIC in europe as a tax dodge)
<geist> probably if had something like an amiga or whatnot may have been inclined to hack 68k, but x86 and PC architecture seemed like such a piece of crap i was actually uninterested in it until college
<geist> where i discovered linux and properly running things in protected mode
<zid> by the time I was like.. serious enough about it to try getting help from people I was old enough to have real conversations
<geist> yah basically i was too lazy to do serious low level hackery until the internet came along (for me) whcih was 1995
<geist> then i ate it up. started reading the intel manual front to back, etc
<zid> I found basic eventually after a couple of false starts
<zid> some random thing called 'europhoria' and stuff from search engingin'g "how 2 maek program on pooter"
<zid> eup*
Ali_A has quit [Quit: Connection closed]
<geist> yah i think the most graphics stuff i had learned was some book that in retrospect is not very good but i still have it because it was one of the first ones
<geist> something like 'how to write a flight simulator for fun and profit' or something
<heat> https://www.youtube.com/watch?v=Hl-zzrqQoSE&list=PLFE2CE09D83EE3E28 <-- I learned how to program with these
<bslsk05> ​www.youtube.com: Java Programming Tutorial - 1 - Installing the JDK - YouTube
<geist> it's not very good but it straight up had pretty easy to understand chapters on 3D transformations and breshnam's line algorithsm and whatnot
<zid> I found qbasic eventually
<zid> and noodled arounda bunch making pong and stuff
<zid> I eventually did have to ask someone how to do circles, x = cos(a)*r; y = sin(a)*r; but even then I didn't help vampire them I just.. went and made 200 little weird demos with it
<zid> figured out how to range my loop so that the circle outline wouldn't have gaps in, how to draw elispses, etc
<zid> Then I got a PS2 and its built in basic had *really* cool example programs, spinning 3D cubes and stuff
<zid> learned a lot tearing those apart
<heat> huh these vids are substancially worse than I remember
<bslsk05> ​en.wikipedia.org: Ralf Brown's Interrupt List - Wikipedia
<geist> 5.7MiB! i remember at some point it actually being in a bunch of pieces
<geist> precisely so you can open it on your 4MB DOS machine or something
<zid> I had the .CHM version
<zid> which you can't open on windows anymore :(
<geist> oh yeah
<zid> they changed the help subsystem and deprecated the old one
<zid> I also had one for winapi
<heat> god i remember following so many tutorials to build a game engine
<heat> I had no idea what I was doing, I just followed the tutorial and typed
<zid> haha nice
<zid> I never had the experience of not really knowing what I was doing
<zid> I just used to noodle, but I knew there were things I didn't know, like trig
<zid> I knew the things I knew, and knew the things I didn't know, if that makes sense
<heat> my first few months of osdev were also kind of like that
<geist> yah i had to copy that stuff, the trig parts
<heat> copy the wiki and the damn jamesm tutorials
<geist> i think my very first attempt at writing a floppy bootsector was mostly copy/paste
<heat> that's how I can recognise them in other people's code
<geist> or at least look at disasm of an existing one and try to figure out what it was doing
<geist> eventually cobbled together a not quite copy but clearly inspired by, etc
<geist> especially since they were using unreal mode which i couldn't figure out until after the fact
<heat> while true; do true & true; done <-- this only forks once right?
<geist> i do not care to forkbomb my computer to find out
<heat> it's not a fork bomb
<geist> says the fork bomber
<heat> just a while loop of forks and waits
<heat> i'm stress testing my OS with this
<geist> heat the fork unibomber
<heat> xD
<heat> i do not confirm nor deny the accusations
<mrvn> heat: it forks linearly
<heat> ok great
<mrvn> x() { x & x ; } ; x
<mrvn> exponential forks bombs are so much cooler
<heat> i don't want a forkbomb
<heat> that's not the point
<zid> and yet you keep writing them
<heat> trying to find a bug in my forks (I think it's in the COW subsystem)
<zid> it's an affliction
<heat> i find that the shell does enough non trivial work after a fork that it triggers them
orthoplex64 has joined #osdev
<geist> i find it pleasing to properly use exec in a shell
<geist> makes zero difference in general, but it's nice to not have that extra process just sit around waiting for something to stop
<heat> yess
<heat> well it does make a difference
<heat> you have one less shell running
<geist> especially wrapper scripts. that final exec at the end is so pleasing
<mrvn> (POSIX) shell code depends on it's context. If I start with "set -e" then you can't say anymore what a following function will do.
<heat> is it possible to send data on a tcp syn?
<geist> i think so? maybe on the ack one at least
<geist> though you dont know the MTU necessarily though so its probably not generally safe to send it on the first SYN
matrice64 has joined #osdev
<heat> i'm seeing a dude devtooling websites and chrome did a thing where there was no TCP overhead and it was all TLS time on a connection
<geist> random youtube: https://youtu.be/hZL7TqSeDus
<bslsk05> ​'Amish Shed Move' by Grandpa HERE (00:04:17)
<heat> despite creating a brand new connection
<heat> wow haha
<geist> that is a thing i did not expect to see today
<kazinsal> just a bunch of amish dudes lifting a barn
<heat> what happens if you trip
<kazinsal> you become one with the barn
<geist> it's probably no big thing but still, makes sense
<kazinsal> impressive feat of group strength
<geist> i wonder if it's packed all the way inside or they're just around the edge
<heat> looks like it's just around the edge but i'm not sure
Brnocrist has quit [Ping timeout: 260 seconds]
<heat> geist, is lk still using lwip or are you rolling your own?
<zid> look while I pee
Brnocrist has joined #osdev
* moon-child looks while zid pees
<zid> ty
<geist> rolling own
<geist> thoguh there's an old lwip in there
Ali_A has joined #osdev
freakazoid333 has quit [Remote host closed the connection]
<Ali_A> I don't know how to delete what I uploaded please ignore it
* geist eyes suspiciously
<geist> then... why did you paste it?
<geist> or did you accidentally drag a file or something?
<zid> kiwiirc is his client + the domain of that site
<geist> poke around, there might be a way to delete it
<zid> so I assume it's a client auto-feature
<geist> ah, yeah okay. yeah irccloudh as somethign like that too
<geist> but it does have a little delete button next to it, which is nice
<zid> "this message is big, paste instead?" or whatever
<geist> i had looked away and saw these two messages right after each other, whcih was odd
<geist> until i had looked at the time stamps and they were minutes apart
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
Burgundy has quit [Ping timeout: 246 seconds]