PapaFrog has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
PapaFrog has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
CalculusCat is now known as Calculuscats
Calculuscats is now known as CalculusCats
slidercrank has quit [Ping timeout: 250 seconds]
<mcrod>
hi
<zid>
we've already got one thanks
<heat>
hi
<moon-child>
not much, what's hi with you?
<heat>
updog
<moon-child>
updog deez nuts
<zid>
what's deez updog
<heat>
sugondese
goliath has quit [Quit: SIGSEGV]
nyah has quit [Quit: leaving]
PapaFrog has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
PapaFrog has joined #osdev
josuedhg has quit [Quit: Lost terminal]
gildasio has quit [Remote host closed the connection]
Vercas has quit [Remote host closed the connection]
Vercas3 has joined #osdev
gildasio has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat_ has joined #osdev
dude12312414 has joined #osdev
heat_ has quit [Remote host closed the connection]
heat_ has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Burgundy has joined #osdev
radens has joined #osdev
<radens>
Hello. On an arm64 kernel, if the currently running process exits and there are not enough processes for the current core to be busy, it seems like a bad idea for ttbr0_el1 to point to a freed page table. I think I should disable translation and set ttbr0_el1 to a safe value. What is the recommended way to do this? Is it to set TCR_EL1.T0SZ to something invalid, or is there a better way to accomplish this?
<radens>
Bonus points if someone knows the answer to the same question on x86_64 too
<klange>
Do you have an idle task to schedule? You could allocate a user directory for it and just not treat it any different than a real process.
<Mutabah>
have an idle process with its own paging structure
<radens>
Right now I have a little asm loop in the kernel which enables interrupts, does a wfi, and loops again. Somehow having a whole process with a whole paging structure just for sitting around doing nothing seems wasteful
PapaFrog has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
PapaFrog has joined #osdev
<zid>
so don't
<zid>
either you have the special case and no idle process, or you have no special case and an idle process
Burgundy has quit [Ping timeout: 240 seconds]
<geist>
radens: it's probably a good idea. i did exactly that in zircon
<Mutabah>
an empty paging structure is pretty cheap, just one page really
<geist>
yeah but on arm64 you can just turn it off
<Mutabah>
I use that process for kernel worker threads actually
frkazoid333 has quit [Read error: Connection reset by peer]
<bslsk05>
fuchsia.googlesource.com: zircon/kernel/arch/arm64/mmu.cc - fuchsia - Git at Google
<geist>
basically if switching to a pure kernel thread (idle included) it just turns off the bottom part. even reloads ttbr0_el1 with 0, though that's not strictly needed
<geist>
figured it would be a good idea. also loads ASID 0 which is defined as being unused, and thus cannot alias anything
<geist>
re disabling it there's a enable bit in the TCR for both halves, i forget what it is
<bslsk05>
fuchsia.googlesource.com: zircon/kernel/arch/arm64/include/arch/arm64/mmu.h - fuchsia - Git at Google
<geist>
been a while since it typed all that in, but the difference in flags between TCR_FLAGS_KERNEL and TCR_FLAGS_USER is that it disables user space
<geist>
EPD0 maybe?
<zid>
I need a better cpu, vampire surviors has frame drops
<zid>
or maybe I figure out how the bizzare overclocking works on amd
kof123 has joined #osdev
jeaye has quit [Remote host closed the connection]
heat_ has quit [Remote host closed the connection]
heat has joined #osdev
<zid>
I need more ideas for dumb things to do to my little gameboy program
<moon-child>
mine bitcoins!
<zid>
been done
<zid>
also a lot of work for not a lot of output
<zid>
current program does a lot of work in like.. 8 lines :p
bgs has joined #osdev
<kof123>
you mean the emulator or you wrote a rom? does it support the multi-link thing (there was a racing game that was 4 or maybe 5-player IIRC? may be misremembering)
slidercrank has joined #osdev
<kof123>
TLDR 4-5 bitcoin miners
crankslider has joined #osdev
crankslider has quit [Remote host closed the connection]
jeaye has joined #osdev
danilogondolfo has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
xvmt has quit [Remote host closed the connection]
xvmt has joined #osdev
jeaye has quit [Ping timeout: 256 seconds]
nur has quit [Remote host closed the connection]
nur has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
Burgundy has joined #osdev
nur has quit [Remote host closed the connection]
xenos1984 has joined #osdev
heat_ has quit [Remote host closed the connection]
<bslsk05>
twitter: <stephentyrone> @johnregehr jokes on you, there are no optimized numerical libraries, because that one guy on llvm-dev can find an extra instruction in all of 'em.
<zid>
can't see who that person is rizzing :(
gog has joined #osdev
<moon-child>
'the conditional branch impairs performance' workload dependent you asshat
<kof123>
eh, his license is good. non-commerical current version only. so ...have to marry his website and track updates
<kof123>
i suspect odds someone will actually bump into this code: <crickets> <tumbleweed> <raven crows> <wolf howls> <vulture pecks at corpse> <...>
* gog
appears
<zid>
(99% of those are "I don't understand how -march works")
* moon-child
pets gog
<sham1>
Unsolicited petting detected!
<Clockface>
this kind of reminds me of an experiment i did once
<kof123>
i suspect they may add up, don't know how often such things are called. just...gcc..will never take such code
<Clockface>
for some reason adding 1 to a register until it overflows is like 1 or 2 percent faster than subtracting 1 on 0
<Clockface>
for a loop that does nothing
<Clockface>
on my computer
<Clockface>
*1 until it hits 0
* gog
prr
wootehfoot has joined #osdev
<Clockface>
GCC was doing the style where it was subtracting 1 from a register until it set the 0 flag
<Clockface>
i did the thing where it added to a register until overflow
<Clockface>
and it was slightly faster
<Clockface>
i averaged the results in a spreadsheet
<Clockface>
so that was weird
<Clockface>
the program just looped a billion times, for context
<Clockface>
first program loaded RAX with 1 billion and subtracted until 0, second set all bits in RAX to high, and then add 1 to it until it overflowed
<Clockface>
second was slightly slightly faster
<Clockface>
on average
<Clockface>
i dont know anything about why it would work that way
<gog>
uh
<gog>
you set all bits in rax to high
<gog>
and then add 1
<gog>
once
<gog>
that's overflow
<gog>
wait
<gog>
sorry
<gog>
i'm still drunk
<zid>
typical icelander
<zid>
drunk on a friday morning
<gog>
i made it to work on time
<moon-child>
maybe meant just set the high 34 bits to 1?
<sham1>
Typiskt daydrinking
<gog>
why 34 bits
<moon-child>
cus 2^30 is a billion
<gog>
no it isn't
<zid>
2^30 = 1 billion is good enough for the girls I go out with
<gog>
:(
<moon-child>
10^9 is the poor man's billion
<zid>
what's a few inches between best buddies
<Clockface>
if i remember right i think i had it at 0 first then subtracted 1
<Clockface>
because it was the least typing
<Clockface>
and then it went to the subtract 1 billion and loop bit
<FireFly>
they call it a _bi_llion because it's a binary kind of -illion, y'see,
<gog>
nonbinaryillion
<gog>
genderqueerillion
<moon-child>
panillion
<Clockface>
sexillion
<gog>
y'all i've been here for like an hour and i haven't done any work lmao
<FireFly>
quillion (queer billion)
<FireFly>
gog: time to not do any work until lunch
<sham1>
Get on my level. I've been here since 8 o'clock and I haven't gotten work done (it's 13 o'clock)
<sham1>
The Friday effect
<FireFly>
my old workplace (which was also a webdev kinda place) used to bring out the alcohol fridays at 15
<FireFly>
pity I don't drink I guess
<gog>
most of the office is here today tho, i'm shocked
<gog>
we had a party last night and everybody drank hard
<Clockface>
you have office parties good enough to get hangovers from?
<gog>
hell yeah
dayimproper has quit [Ping timeout: 246 seconds]
<zid>
discord pls stop shitting bed
<Ermine>
gog: may I pet you
<sham1>
zid: having Discord not be shitting the bed is like asking a turtle to not be slow
<Clockface>
my favorite thing it did was convince valorant that TPM diden't exist on my freinds computer
<bslsk05>
redirect -> medium.com: Just a moment...
<GeDaMo>
"RISC vs CISC Microprocessor Philosophy in 2022"
<Ermine>
bslsk05 failed to follow redirects...
<sham1>
Either that or it failed to get the title due to javascript
<sham1>
It's Medium, so that's not even an unfeasible situation
<Ermine>
That said, I'm not uefi lover
<Clockface>
couldn't you just make a BIOS-type interface for ARM
<Clockface>
it couldn't be the same thing but you could just have calls that do the same stuff
<heat_>
gog, most of EFI is not open source
<heat_>
sham1, EFI was created by an ex-nt-kernel guy. explains the ideas and coding style...
heat_ is now known as heat
<Clockface>
NT kernel is cool but i don't think its ideas should extend to firmware
<sham1>
Well that explains the GUIDs and the strange WinAPI
<heat>
and they do not
<Clockface>
UEFI gives off windows vibes tho
<heat>
sure
<sham1>
Yes. Vulkan also does things in a reminiscent way to that
<sham1>
So many weird structs linked together to do a thing
<heat>
if you think SCREAMING_TYPES are a bad bad idea that should be confined to kernels and not our dear precious firmware
<Ermine>
Clockface: then RISC-V comes and everybody would need to reinvent it for RISC-V? And the same goes for any other arch. Also, BIOS is unspecified
<zid>
SCREAMING_TYPES is bad in kernels too.
<sham1>
IHappenToPreferThisOverScreaminf
<zid>
caps is for enums
<zid>
not types
<sham1>
Although I do also snake_case
<zid>
It's like a sign saying "DANGER: Do not evaluate in weird ways"
<Ermine>
heat: fuchsia efi headers use their own style
<Ermine>
(and those headers are also in ddevault's hboot)
<Clockface>
i dont see the problem with reinventing firmware
<Clockface>
for different arch's
<heat>
Ermine, yes
<heat>
Clockface, oh boy
<Clockface>
its not x86, so it probably should be kind of different
<Clockface>
firmware gets ditched after a few milliseconds so dont overthink it
<Clockface>
well i guess maybe a few seconds
<Clockface>
since drive is slow
<heat>
lol
<heat>
drive is slow is BY FAR not the problem in firmware
<heat>
gog, do you have the CEO of gays' email?
<gog>
i am the CEO of gay
<heat>
i tried mikepence@whitehouse.gov but it keeps bouncing
<heat>
wow hi mike
<gog>
you're fired
<heat>
the apprentice gog version
<heat>
anyway there's this guy that's super anti-gay in my gym and I wanted to get something SIIIIIIICK like a rainbow-colored nike swoosh tshirt or some shit
<heat>
just to spite him. sadly, it doesn't exist
<gog>
i was looking at a shirt today, it's a stack of frogs in rainbow color
<gog>
idk if you know the yt channel "internet comment etiquette"
[itchyjunk] has quit [Read error: Connection reset by peer]
<heat>
is there an inline assembly hint for the compiler to re-align the stack?
Brain__ has quit [Read error: Connection reset by peer]
<sham1>
Probably not
goliath has quit [Quit: SIGSEGV]
slidercrank has joined #osdev
<kazinsal>
hmm. I probably shouldn't buy an IBM 5150 sight unseen from ebay with no returns and no display to plug it into
<geist>
correct!
<geist>
i have seen some for sale around seattle/vancouver on craigslist, but usually pretty pricey
<geist>
thought about picking one up but really i have no desire for early PC hardware
<mjg>
loller
<mjg>
you reminded me of a polish practice on polish equivalent of ebay
<kazinsal>
it looks like it's got a fully populated SixPakPlus in it though...
<mjg>
you got a piece of hw which is broken? you claim you have no means to test
<mjg>
;d
<geist>
mjg: yeah ebay the equivaent i've seen is 'no power cable'
<geist>
i assume that's jist code for 'doesn't work'
<geist>
also other problem is frankly with anything old and doubleplus with a CRT in it, i just dont trust the shipper to package it, it'll just get broken in transit
<geist>
but local pickup you at least dont have that problem
<geist>
basically feels like you're doing the world a disservice by getting something fragile shipped by amateurs
<kazinsal>
270 cad + 100 cad shipping from quebec. looks like it has a CGA and two 5.25s but no monitor
<geist>
might not be bad, because shipping monitors...
<kazinsal>
yeah
<kazinsal>
I was hoping to find something like this locally but no dice in vancouver
<kazinsal>
maybe I'll drive down to seattle during my vacation this summer and just hand someone a wad of cash for a whole unit
<bslsk05>
portland.craigslist.org: Original IBM PC Personal Computer restored full setup - computers -...
<geist>
but a) it's pricey, and b) it's in portland
<geist>
3 hour drive from here, but like a days drive for you
<geist>
it's been for sale for a few months, probably because it's too pricey
<kazinsal>
oof, yeah, that's a bit high on the price scale
<kazinsal>
and about six hours yeah
<kazinsal>
plus whatever daily shenanigans happen on I-5
<geist>
they also have a XT clone and a 286 compaq. looks nice though
<geist>
i have a long ass search with craigslist that catches some stuff and some in the vancouver area too, since it's hypothetically worth driving there
<geist>
"historical | historic | vintage | microvax | vaxstation | commodore | atari | tandy | amiga | alpha | dec | terminal" is my search term. seems to work okay
<geist>
though it picks up lots of newer 'vintage' computer listins where someone lists their old laptop from 4 years ago as vintage
<kazinsal>
yeah, that's why I tend to include seattle in my search list. I'll do a weekend trip down there and back for neat gear
<geist>
i had an amiga pop up that i kinda wanted a month or so ago but was about to go on a trip
<bslsk05>
vancouver.craigslist.org: Hard Drives - Jaz - 1 left - computers - by owner
<geist>
but it doesn't mention having any actual disks, which may be hard to get
innegatives has joined #osdev
tomaw_ has joined #osdev
<kazinsal>
ooh, yeah
tomaw_ is now known as tomaw
<kazinsal>
plus it would require navigating richmond by car, and that's something you need to bless your vehicle with a pint of holy water to do successfully
<geist>
of all the things i purged years ago i kinda wish i still had the scsi zip drive + disks
<geist>
was pretty good for interfacing with old hardware with scsi
[_] is now known as [itchyjunk]
dude12312414 has joined #osdev
<geist>
though really with all the scsi 2 sd adaptors nowadays that problem is solved
<geist>
does kinda remind me, i wonder what the actual protocol was for parallel zip drives. wouldn't be surprised if it was just scsi over parallel, since they sold scsi versions of the same drive side by side
<kazinsal>
I'd imagine so
<kazinsal>
probably just a cheap little board waiting for a whole scsi packet's worth of data on the parallel line before blasting it to the actual scsi controller on the drive
<kazinsal>
atapi but for ieee-whatever
<gog>
hi
* kazinsal
pets gog
* gog
prr
<geist>
yah scsi is so flexible like that. the protocol dont care how it gets the data
<innegatives>
what are disadvantages of writing your kernel in C++ except for the things you have to take into account listed in osdev wiki for C++ page?
* geist
pets gog
<geist>
innegatives: that's baout it
<geist>
it works okay, you just have to be more generally aware of what the language is doing uner the hood. i wouldn't recommend it unless you're at least moderately experienced
<geist>
in C++
<kazinsal>
the ghost of linus torvalds will haunt you and call you finnish profanities in the dead of night
<geist>
if you're trying to build a kernel for very small computers, or low end hardware it's a bit more of an ask. C++ *tends* to generate more code to do the same thing
<geist>
maybe not slower, but tends to be more code due to lots of inlining of things, generally more so than C
<geist>
i say tends because there are ways to avoid it, etc etc. but on the average i've generally seen more codegen in C++
<innegatives>
Is there any reason why we haven't seen a serious pure-Rust kernel yet?
<geist>
probably just too soon. i've seen many attempts. mostly in embedded space
<innegatives>
Nothing over 100k lines
<innegatives>
geist: is it just too hard to get right with current state of the lang?
<geist>
kinda the biggest thing i've seen in that space is the starnix project we're working on on fuchsia, but it's not a true kernel per se
<kazinsal>
probably the os hobbyist equivalent of organizational inertia
<kazinsal>
we're all just so used to hacking away at C and/or C++
<geist>
it's a user space server emulating linux
<heat>
rust is garbage rust is garbage rust is garbage rust is garbage
<geist>
yah i've been working on a C++ kernel for the last 7 years and it's generally okay
<kazinsal>
rust looks kinda neat but I haven't really felt the need to learn it
<geist>
it's fairly clear at least in the circles i'm in that rust is going to be more or less The Thing for a while
<bslsk05>
jafarlihi/core86 - [WIP] 8086 IBM PC emulator (0 forks/9 stargazers/MIT)
<geist>
so i'm slowly picking it up
<kazinsal>
I'm still trying to figure out the previous decade's hot newness
<geist>
what is generalyl happening is companies that are into security/safety/etc, like a lot of FAANG are basically flipping their thought process internally to: justify why you can't write <new project> in rust
<geist>
ie, it's starting to become the default
<geist>
old projects have inertia, but thers's also a move to rewrite in rust
<geist>
whethe ror not it's actually earned, or a good idea, etc i dunno
<geist>
but the Cargo Cult is fully engaged now
<geist>
but so far seems to be performing well, etc. so i guess it's sort of sticking
gog has quit [Quit: Konversation terminated!]
<innegatives>
what is the reason for openbsd's lack of reported vulnbs even tho they use C?
<kazinsal>
yeah I get why it's the new standard going forward
<heat>
because no one uses openbsd
<geist>
innegatives: because you can write good code in any language
<geist>
dont get too fixated on the notion that the language is the solution
* Ermine
is Fuchsia UI
<geist>
the language just helps do this or that. you can write good or shitty code in any language
<innegatives>
geist: so how come openbsd coders write better code than linux coders?
* geist
shrugs
<kazinsal>
smaller project, smaller goals
<heat>
<heat> because no one uses openbsd
<geist>
bingo
<kazinsal>
linux needs to run on everything from a literal toaster to a supercomputer
<kazinsal>
and it needs to scale well
<geist>
you can focus on different aspects of the same thing
<kazinsal>
openbsd doesn't because the project isn't meant for that
<heat>
it's easy and rewarding to find vulnerabilities in linux, because it supports a lot of things and it's used EVERYWHERE
<heat>
if you find a vuln in openbsd you... get some routers?
Left_Turn has joined #osdev
<kazinsal>
most of the security errata for openbsd have been in openssh/openbgpd/openospfd/libressl
<geist>
innegatives: also whether or not openbsd is better or not re: vulns is probably debatable, but that's how they market it and they still seem to care. so good for them
<kazinsal>
which are components that are widely used outside of the openbsd OS itself
<geist>
think of it as a marketing thing. they worry about security more, and thus they try to be more aggressive abut fixing them, not writing them in the first plac,e and then they market that they're doing a good job
<geist>
good for them
<kazinsal>
yeah
<innegatives>
can you guys suggest something i can work on to git gud besides an OS?
<geist>
the whole 'rust is a more secure language' thing does not mean other languages are intrinsically not secure
<kazinsal>
really, I consider openbsd a neat unix that serves primarily as a reference distribution for the portable components that the project produces
<geist>
it's just *generally* harder to write certain class of common security vulns in rust because it's much strictr about various things
<geist>
kazinsal: yeah
<kazinsal>
eg. openssh came from openbsd and openbsd is the reference distribution that includes it but you find openssh on practically every linux machine (and windows machines for the past half a decade or more)
Turn_Left has quit [Ping timeout: 240 seconds]
<geist>
way back about 20 years ago i also found openbsd's firewall config and features really nice compared to the other BSDs
<geist>
ran a low end openbsd box for like 5-8 years as my router in the late 90s, early 2000s
<kazinsal>
yeah, pf is a pretty straightforward but flexible firewall
<kazinsal>
I still use it but that's because I'm an incurable dork
<geist>
yeah somewhere in the mid 2000s i switched to m0n0wall (which is freebsd based) and never switched to anything else
<kazinsal>
though I'm thinking about buying a cheap juniper firewall through work since we get a massive discount on not-for-resale products
<geist>
m0n0wall got renamed into pfsense. been happy with it
Left_Turn has quit [Ping timeout: 264 seconds]
Left_Turn has joined #osdev
goliath has joined #osdev
<Ermine>
I wonder why windows bitlocker wants recovery key after my efi hello world was run
<geist>
interesting
<geist>
maybe it sensed a non signed 'bootloader' ran and that forces some sort of re-auth?
<geist>
because it assumes you futzed with the disk?
<geist>
(assuming you actually didn't trash the disk)
<geist>
do you have secure boot on?
<Ermine>
No, it's off
<Ermine>
I only print hello world, should be no disk interaction
<geist>
dunno then
<Ermine>
Anyway, rebooted and it calmed down
<geist>
but yeah aybe there's some sort of handshake your hello is 'supposed' to do
<geist>
so possibly windows sees it as a incomplete boot or something
<kazinsal>
yeah it's probably assuming that whatever other EFI application is running that's not signed by a key in the TPM is a potential security risk
<geist>
so it' being extra careful
<heat>
that could fuck with the TPM
<geist>
that being said i switch between linux and windows on the same machine all the time, and it doesn't have this issue
<geist>
though i use secure boot now, but before i didn't
<Ermine>
My app returns then windows boot proceeded
<geist>
OTOH, efi grub maybe pets things 'properly'
<geist>
ah maybe that's it. windows efi app is maybe seeing that it's not the firt thing that's run so it's being paranoid?
<Ermine>
maybe it didn't like return code
<geist>
or that
<geist>
if you exit boot services and then stop in your hello world, then reboot the machine does windows do the same thing?
<geist>
ie, is it because windows is booting in the same boot instance?
<Ermine>
I don't exit boot services
<geist>
sure. but i'm saying if you *did*
<geist>
ie, instead of exiting the app, try stopping such that you have to physically reboot the machine
<geist>
then see if windows detects that
<Ermine>
Ok, will take a look at that
<geist>
that makes more sense, otherwise the windows app would have to 'remember' across boots that something else ran
<geist>
but if it's in the same instance of efi, may be easy for it to query that something ran before it
<geist>
i'm just making this all up, just trying to guess what's going on, FWIW
innegatives has quit [Ping timeout: 240 seconds]
innegatives has joined #osdev
gog has joined #osdev
<Ermine>
brainstorming is good too
<geist>
yeah. hmm, what were those elephant lookin alien race in Mass Effect
<gog>
hi
<geist>
they always prefix their sentences with the mood, intent, etc
<bslsk05>
vancouver.craigslist.org: TI99/4A Vintage Computer - computers - by owner
<geist>
heh, no power cable
<geist>
thogh this one seems kinda legit, like the guy actually doesn't know if it works because they didn't really want to use it as a computer
<gog>
the ebay post said it was functional
<gog>
the case seems to be in good shape
<gog>
probably fine
<kazinsal>
heh
<kazinsal>
wonder how much of a pain it'd be to find/build a new power supply for it
<kazinsal>
iirc it's an external brick on the 99/4A
<gog>
didn't adrian black have to do exacyl that
<gog>
or was it a different computer
<kazinsal>
oh god this might be one of those crazy 80s computers that needs a bunch of AC voltages
<kazinsal>
yep looks like the external power brick spits out a handful of AC voltages and then the rectifier is internal to the machine
<geist>
not sure, i thought ti/99s had an internal psu
<geist>
ah. yeah okay
<geist>
lots of those did the AC thing, C64 did too
<geist>
since it wasn't a switched supply, i guess that meant they could put the large transformer outside
<geist>
you should read about the internal arcitecture of the ti99, it's a real disaster. actually 16 bit cpu, but can ony access memory via some other chip, etc
<geist>
it's a real disaster. basically running an interpreter
<geist>
the cpu is a microprocessor version of an existing minicomputer they had
<geist>
the main disaster about it is TI tried to control it too tightly and killed the entire software ecosystem for it. so it basically had like 20 carts or whatnot
<kazinsal>
yeah, the tms9900
<kazinsal>
architecturally it's fascinating
<geist>
one of those cautionary tales. back in the day the most open 8 bit computers generally won
<geist>
totally
<geist>
iirc it's the one that has like 3 internal registers andone of them is 'where is the base in memory of the 16 pseudo regs'
<geist>
so context switch is just move the base pointer
<kazinsal>
yeah, their logic was something like since the machine has basically a "zero page" of zero wait state SRAM you might as well just use that for all your register files
<geist>
right. an era when ram was faster than the cpu
<geist>
would be entertaining to get one of the microprocessors from it and breadboard up something that works better than the ti99
<kazinsal>
totally
<kazinsal>
it seems like a pretty competent arch especially for a late 70s VLSI implementation of a minicomputer
<geist>
iirc the ti99's problem is it has somethingl ike 1K or whatnot of actual address space that the cpu can use natively and then Real Memory you have to literally access via pokes and peeks through the video chip, or something
<geist>
presumably because they didnt/couldn't wire up a cheap 16 bit memory bus across the wole machine
<kazinsal>
I can see why it didn't do so hot in the market
<geist>
ah okay, it wasn't as bad as i thought: it's *video* ram that you can't access directly, but main ram is there, it's just 2x8 multiplexed so it's slow
<geist>
basically extra wait states
<geist>
so presumably you kept your register file in the 256 byte area so it'd be fast
<Ermine>
Do I understand correctly that intended way of getting memory map in UEFI is GetMemoryMap(&MapSize, NULL, NULL, NULL, NULL); AllocatePool(EfiLoaderData, MapSize, &Map); GetMemoryMap(&MapSize, &Map, /* whatever */);
<Ermine>
?
<geist>
something like that? there's some case where the map can change out from unerneath you so you have to retry, i think
<geist>
like the map object goes out of scope
<geist>
but i dont remember the details. i think heat has worked in the efi bits more
puck has quit [Excess Flood]
<Ermine>
UEFI requires map to be obtained right before ExitBootServices
puck has joined #osdev
<Ermine>
So they even ask for MapKey in ExitBootServices
goliath_ has joined #osdev
<geist>
i think one of the things that extbootservices guarantees is that the memory map stops changing
<gog>
yes
goliath has quit [Ping timeout: 240 seconds]
goliath_ has quit [Remote host closed the connection]
jeaye has joined #osdev
<gog>
so whatever way you allocate for the memory map also cannot change it. i think what i do is i make one call to get the current size of the memory map and then allocate that plus sizeof memory descriptor
<gog>
or it's what i did at some point
<gog>
i think now though i just allocate that from a bump allocator i use to store boot data
<gog>
i can't be bothered to remember or read my own code
<geist>
priot to exiting boot services isn't there more of a malloc style thing? ie AllocateMemory(bunch of flags)?
<geist>
or is the alloatepool thing Ermine linked it?
<gog>
that can change the memory map
Turn_Left has joined #osdev
<geist>
oh for sure, but do you have to do the get map/allocate/loop dance?
<gog>
or rather, it can cause a region to be split and add a descriptor
<geist>
totes
goliath has joined #osdev
<Ermine>
There's AllocatePool and AllocatePages for malloc thingie
<geist>
i get that the map object is instantly obsolete the instant you allocate or change the map, but do you eed the map to allocate
<gog>
no, if you pass nulls to two of the params it'll tell you the size
<gog>
iirc
<gog>
nulls and a 0 to buffer size
<gog>
and it'll return EFI_BUFFER_TOO_SMALL
<geist>
it's definitely a weird interface, very win32ish (no surprise)
<gog>
yeh
innegatives has quit [Quit: WeeChat 3.8]
<gog>
i don't actually hate it
bgs has joined #osdev
<gog>
but it's definitely not how i'd desgin an api
Left_Turn has quit [Ping timeout: 256 seconds]
<geist>
nah, and you can also always wrap these with more familiar apis
<gog>
too many VERY_LONG_AND_LOUD_TYPE_NAMES
<geist>
i guess it's not win32ish in that a lot of the apis dont just take a pointer to a structure with args init
<gog>
does the spec pre-date stdint?
<geist>
almost certainly. late 90s
<geist>
or at least original EFI was ITANIUM!
<gog>
stdbool too probably then
<gog>
ITANIUMMMMM
<geist>
dunno how much UEFI has diverged, but i think it was more or less just EFI vs 2 or whatnot
<sham1>
IA64 my beloved
goliath has quit [Read error: Connection timed out]
goliath has joined #osdev
goliath has quit [Quit: SIGSEGV]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
Jari-- has quit [Remote host closed the connection]
<mrvn>
does exitbootservice modify the map to include the ram that ending boot services frees?
<mrvn>
gog: M$ didn't implement C99 (stdint) for the longest time
<mrvn>
a bunch of unix APIs also take a size argument for a buffer and return the needed size and then you call them with size 0 to find the right size. Bunch of those though allocate if the buffer is NULL itself.
<puck>
mrvn: boot service memory is separate from runtime service memory in the memory map, iirc
<mrvn>
puck: that doesn't answer my question even if you were sure
<puck>
anyhow
<puck>
> A UEFI OS loader must ensure that it has the system’s current memory map at the time it calls ExitBootServices().
<puck>
> [..] In addition, the UEFI OS loader can treat all memory in the map marked as EfiBootServicesCode and EfiBootServicesData as available free memory
<puck>
mrvn: also, how could it modify the memory map? you have to pass in a buffer yourself
xenos1984 has quit [Ping timeout: 248 seconds]
xenos1984 has joined #osdev
<mrvn>
puck: you pass the map you have to exitbootservices
<mrvn>
20:31 < Ermine> So they even ask for MapKey in ExitBootServices
<bslsk05>
'low poly cat set to low quality funkytown' by murderousroomba (00:02:00)
Brnocrist has joined #osdev
Brnocrist has quit [Read error: Connection reset by peer]
<mrvn>
"So Darwin was right about God but wrong about Evolution?"
danilogondolfo has quit [Quit: Leaving]
Burgundy has quit [Ping timeout: 240 seconds]
Brnocrist has joined #osdev
<heat>
<gog> does the spec pre-date stdint?
Brnocrist has quit [Read error: Connection reset by peer]
<heat>
they avoided standard C like the plague
<heat>
lots of long time firmware engineers know jack shit about standard C
<gog>
i feel like it was a huge mistake
<heat>
does this pre-date stdint? yes, slightly
<heat>
does it matter? no, they took a crap on everything else too
<heat>
e.g the tianocore DEBUG (()) macros take format-ish strings that REALLY do not represent reality
<heat>
you'll notice %x is UINT32, %lx is UINT64. how do you print UINTN? you cast to UINT64 and use %lx obviously!
<heat>
also note: %lx is UINT64 even on platforms where it isn't
<heat>
it's brilliant!
antranigv has quit [Ping timeout: 240 seconds]
<gog>
cute
<gog>
efi is really great
<gog>
i hate standards
xenos1984 has quit [Ping timeout: 240 seconds]
Brnocrist has joined #osdev
<heat>
<geist> dunno how much UEFI has diverged, but i think it was more or less just EFI vs 2 or whatnot <-- UEFI is EFI but with a different spec version yeah
<heat>
most firmware people still call it EFI, internally it's still "EFI"
<heat>
UEFI is just a plot to get more people onboard (see, it's UNIFIED!)
<zid>
uefi is the i586 of x86s
<zid>
and by x86s I mean x86, not x86s which would be x86ss
<zid>
simples
<heat>
i love x86s's
Brnocrist has quit [Read error: Connection reset by peer]
<heat>
this is seriously unpronounceable wtf
<heat>
thank fuck no one is using this until 2080
Brnocrist has joined #osdev
<heat>
geist, i actually had an older intel uefi big hat tell me something like there's a distinct advantage in developing a new solution. like for fairness or "inclusiveness". it ends up working better than telling people "use my thing, it's better than yours"
<heat>
in which case the U in UEFI makes a lot of sense
<heat>
EFI, but this time, it's US. where its basically the same thing but slightly changed and has a different name
<gog>
youeefi
<heat>
and you'll implicitly trust it a lot more than if its entirely my thing
<heat>
because WE designed it
<heat>
even if effectively nothing changed
<gog>
it's unified and extensible
Brnocrist has quit [Read error: Connection reset by peer]