<heat>
you're not going to read even half of it anyway
<parrott>
Well, I wouldn't if it were in digital
<heat>
the UEFI spec is available in pdf
<parrott>
Yeah I'm gonna print and bind it
<heat>
you could just use the pdf
<geist>
clearly they dont want to
<heat>
but the trees :(
<parrott>
Mail me a kindle
<parrott>
Anyway
<parrott>
I figure that's where it all starts these days. UEFI
<geist>
yah
<heat>
it starts in the SEC phase
<heat>
exactly like the BIOS
<heat>
16-bit
<heat>
the SEC phase hands off to the PEI phase, the PEI phase is either 32-bit or 64-bit (depends on the cpu really), which initialises ram and basic board stuff, pci, etc
<heat>
then it executes DXE which initialises all drivers
<heat>
eventually it finds your bootloader and executes it
<parrott>
Does that have to do with ACPI?
<heat>
no
<parrott>
Is it in the hardware/firmware?
<heat>
what is?
<parrott>
All that you said
<heat>
yes, in flash
<parrott>
Sec,pei,etc
<parrott>
I'm just looking at software
<heat>
SEC, PEI, DXE are mostly in flash (you can add UEFI drivers to your ESP which is not in flash)
<heat>
this is all software
<heat>
the 3 main phases of your UEFI firmware
<parrott>
Oh
<heat>
it's stored in flash in your mobo but it's all software
<parrott>
Ok but just the OS is where I'm going
<parrott>
The boot, etc
<heat>
you don't need to know UEFI to write just the OS
<heat>
you can just get booted by grub/some other bootloader and that's it
<parrott>
Seems like I want to understand it for the boot
<heat>
if you're curious, sure.
<parrott>
Rolling from scratch...
<heat>
but it's not important
<parrott>
Disagree
<parrott>
It's the boot
<klange>
I recommend starting with another bootloader just because bootloader stuff is immensely boring and x86-specific
<klange>
then come back to it later
<parrott>
Seems like there's more in there, too
<parrott>
Well I'm focusing on x64
<heat>
you don't really need the UEFI spec
<heat>
in fact, you can write a UEFI bootloader without looking at it pretty much
<parrott>
Pretty sure I want to understand it
<heat>
why?
<parrott>
Oh, u
<klange>
Bootloaders are a pitfall of issues as a starting point. You don't really know what you want out of one early on, they're a unique set of weird platform-specific things, hard to get right, easy to get wrong...
<geist>
because understanding it is maybe interesting
<geist>
wouldn't recommending writing, but understanding may be worth while
<heat>
yes but you can't read these specs front to back
<parrott>
Can't you just fully implement the spec?
<klange>
Fully implement what spec?
<parrott>
UEFI
<klange>
UEFI is not something you implement, it's something that is handed to you.
<heat>
that's been done, github.com/tianocore/edk2 and github.com/tianocore/edk2-platforms
<bslsk05>
tianocore/edk2 - EDK II (1664 forks/2845 stargazers/NOASSERTION)
<bslsk05>
tianocore/edk2-platforms - EDK II sample platform branches and tags (291 forks/349 stargazers/NOASSERTION)
<heat>
that's *most* of your firmware's code right there
<heat>
it implements all of UEFI
<heat>
you as an osdever just use the interfaces
<parrott>
I'll have to read it to understand
<heat>
ok do it
<parrott>
I have questions that I know are answered in it
freakazoid12345 has joined #osdev
<klange>
For building a loader, the UEFI spec is better read as an ad hoc reference for the APIs you want at the moment.
<parrott>
Seems like UEFI may have something to do with interfacing with hardware
<parrott>
Also^
<heat>
depends on what you're doing
<parrott>
Implementing on modern hardware, is what I want to do
<heat>
implementing what?
<klange>
UEFI is basically a fancier DOS. It provides you a standardized API for doing things like reading filesystems, getting user input, presenting output.
<parrott>
Well I'm going to do UEFI and ACPI and go from there
<geist>
when you say 'doing' what do you mean?
<parrott>
Read
<geist>
ah okay
<parrott>
Reading them
<heat>
i suggest you start with the intel manuals first
<heat>
else you might be a bit lost
<parrott>
I'm interested in rolling an os from scratch, basically
<heat>
that's literally the first thing in boot, the cpu
<klange>
Well, you're in #osdev, so that's kinda the assumption.
<parrott>
Sure, ok
<parrott>
New here
<heat>
i know you want to read all that but understand that UEFI and ACPI are not things you implement
<heat>
that's not osdev, that's firmware dev
<parrott>
I fat fingered a "P" and here we are
<heat>
in fact, you can't implement those since that's all provided by your OEM and signed so you can't flash your own
<parrott>
Stuff I need to know is in that spec
<heat>
*sigh* you do you mang
<klange>
Eh, well, that's complicated. You probably can't directly replace the ones provided, but you can always chain load into your own EFI, and build ACPI tables yourself :)
<geist>
i dunno why everyone is being so harsh on them
<parrott>
Like I've already started to read it, but I can't look at a GUI
<geist>
it's a spec, read it. it may or may not be fun. i do that sort of stuff all the time for lulz
<parrott>
Word
<geist>
just dont expect there to be any real eternal truths in there. it's highly specific to what UEFI sets out to do
<heat>
yes, but they're new, not someone with 20+ years of expertise under their belt. I'm trying to let them know that they don't *need* to read that (and IMO it's best not to if you're starting out)
<parrott>
It's gonna be a long process
<parrott>
Much reading to do
<geist>
very read, much process
<parrott>
Word
<klange>
I recommend using a PDF viewer instead ;)
<klange>
[crickets]
<parrott>
I'll pm my address
<parrott>
;)
<kazinsal>
reading specs can be fun but you've really gotta have been in this particular can of worms for a while before you get to the point where it is
<parrott>
It won't be fun.
<parrott>
I'll kill it in a month and then have the print for reference
<klange>
1627 pages, lot of paper
<parrott>
Word
<parrott>
Save some paper for me
<parrott>
Also, front and back
<kazinsal>
yeah I don't have too many technical manuals in hardcopy for that reason
<kazinsal>
pretty much just windows internals and a bunch of oddball cisco manuals
<klange>
I think that's the main reason Intel stopped offering their manuals in dead tree. They just got too thick.
<kazinsal>
yeah, it'd be nice to have them as like, a bookshelf piece
<kazinsal>
for actual regular use though, you can't ctrl+F a hardcopy ;)
<parrott>
Table of Contents :)
<klange>
Really you want the index for that, not the ToC.
<kazinsal>
I would definitely not want to try to go through, say, one of the Intel ethernet controller manuals without a find function
<kazinsal>
the programmer's guide for the 710 series is 1719 pages long
<heat>
that's baby shit compared to the intel gpu manuals
<CompanionCube>
ARM is ~5k pages, imagine that in dead tree
<parrott>
Put it in ASCII and I'd be down for digital
<parrott>
I'm sure I'll go pdf reader eventually
<CompanionCube>
someone's probably written pdf-to-text, how good it works on the actual PDF is anyone's guess.
<heat>
the tigerlake reference manuals are 7800 pages long
<klange>
It's a massive pain, really, PDF to text, because of how print-layout-oriented the format is.
parrott has left #osdev [Leaving]
<kazinsal>
yeah
<klange>
Either you've got a PDF that someone put the effort into making accessible, and it has properly annotated continuous text, or you've got the output of most authoring tools where you're lucky if a single sentence is a contiguous chunk...
Matt|home has joined #osdev
Matt|home has quit [Read error: Connection reset by peer]
Coldberg has joined #osdev
C-Man has quit [Ping timeout: 260 seconds]
pretty_dumm_guy has quit [Ping timeout: 246 seconds]
JanC has quit [Ping timeout: 260 seconds]
parrott has joined #osdev
CyberneticRev has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
m3a has joined #osdev
troseman has quit [Ping timeout: 246 seconds]
freakazoid12345 has quit [Ping timeout: 256 seconds]
parrott has quit [Read error: Connection reset by peer]
CyberneticRev has quit [Ping timeout: 260 seconds]
the_lanetly_052 has joined #osdev
sonny has joined #osdev
heat has quit [Ping timeout: 260 seconds]
sonny has quit [Quit: Ping timeout (120 seconds)]
sonny has joined #osdev
sortie has quit [Ping timeout: 272 seconds]
seds has quit [*.net *.split]
jimbzy has quit [*.net *.split]
rorx has quit [*.net *.split]
air has quit [*.net *.split]
j00ru has quit [*.net *.split]
hegz4 has quit [*.net *.split]
Raito_Bezarius has quit [*.net *.split]
moon-child has quit [*.net *.split]
eschaton has quit [*.net *.split]
wgrant has quit [*.net *.split]
warlock has quit [*.net *.split]
koolazer has quit [*.net *.split]
sham1 has quit [*.net *.split]
night has quit [*.net *.split]
basil has quit [*.net *.split]
moon-child has joined #osdev
air has joined #osdev
night has joined #osdev
jimbzy has joined #osdev
basil has joined #osdev
sham1 has joined #osdev
sortie has joined #osdev
hegz6 has joined #osdev
eschaton has joined #osdev
divine has quit [*.net *.split]
MrBonkers has quit [*.net *.split]
ecs has quit [*.net *.split]
remexre has quit [*.net *.split]
cheapie has quit [*.net *.split]
Celelibi has quit [*.net *.split]
sahibatko has quit [*.net *.split]
cln has quit [*.net *.split]
stux|away has quit [*.net *.split]
j`ey has quit [*.net *.split]
cb has quit [*.net *.split]
mcfrdy has quit [*.net *.split]
nickster has quit [*.net *.split]
Emil has quit [*.net *.split]
ecs has joined #osdev
j`ey has joined #osdev
Emil has joined #osdev
remexre has joined #osdev
cln has joined #osdev
mcfrdy has joined #osdev
nickster has joined #osdev
MrBonkers has joined #osdev
koolazer has joined #osdev
j00ru has joined #osdev
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
Celelibi has joined #osdev
cheapie has joined #osdev
rorx has joined #osdev
atrapa has joined #osdev
sonny has quit [Quit: Client closed]
the_lanetly_052 has quit [Ping timeout: 246 seconds]
fwg has joined #osdev
the_lanetly_052 has joined #osdev
the_lanetly_052 has quit [Ping timeout: 268 seconds]
eroux has joined #osdev
fwg has quit [Quit: .oO( zzZzZzz ...]
fwg has joined #osdev
Burgundy has joined #osdev
Coldberg has quit [Ping timeout: 260 seconds]
_xor has quit [Quit: bbl]
jjuran has quit [Quit: Killing Colloquy first, before it kills me…]
jjuran has joined #osdev
dennis95 has joined #osdev
fwg has quit [Quit: .oO( zzZzZzz ...]
GeDaMo has joined #osdev
fwg has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
pretty_dumm_guy has joined #osdev
pretty_dumm_guy has quit [Client Quit]
pretty_dumm_guy has joined #osdev
C-Man has joined #osdev
fwg has quit [Quit: .oO( zzZzZzz ...]
fwg has joined #osdev
fwg has quit [Quit: so long and thanks for all the fish.]
fwg has joined #osdev
Jmabsd has joined #osdev
m3a has quit [Ping timeout: 260 seconds]
xenos1984 has joined #osdev
parrott has joined #osdev
<parrott>
Think I'm gonna go with a PDF reader
atrapa has quit [Quit: atrapa]
nyah has joined #osdev
stux|away has joined #osdev
Ali_A has joined #osdev
srjek has joined #osdev
JanC has joined #osdev
Likorn has joined #osdev
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
Ali_A has quit [Quit: Connection closed]
freakazoid12345 has joined #osdev
heat has joined #osdev
mahmutov has joined #osdev
Ali_A has joined #osdev
FatalNIX has joined #osdev
<FatalNIX>
As somebody who likes traditional FASM, how is the general appreciation of FASM g here (I haven't even used it yet)
<FatalNIX>
From what I understand it's pretty nice with its new macro system that can be used for pretty much any architecture.
<heat>
it's an assembler that goes brrrr and gives you bytes :P
<heat>
I've used NASM before but I personally prefer the gnu/llvm assemblers since they're already included in the toolchain anyway and are really powerful
<FatalNIX>
You know it's funny. I use clang for my projects and I have yet to use llvm's assembler
<FatalNIX>
directly anyways
<heat>
few projects require an assembler :P
<FatalNIX>
I mean
<FatalNIX>
My MSP430 :D
<heat>
but yeah, I strongly suggest you use the one included with your toolchain unless you really want to build your stuff on windows or something
<FatalNIX>
But I don't use C on that anyways
<FatalNIX>
Who would run a C compiler for a chip that only has 128 bytes of RAM
<heat>
depends
<heat>
how much flash?
<FatalNIX>
I think mine -might- have 4KB. I haven't used the thing for a couple years now XD
<FatalNIX>
I've been looking to improve my gameboy / gameboy color usb serial adapter thing I made. perhaps I might look into one of these instead of using an AVR next time for it.
<zid>
usb serial as in the com port, or as in you have a cool cart port usb?
<FatalNIX>
the link com port. It's kinda janky
<FatalNIX>
basically it converts the SPI mode 3 of the gameboy to TTL serial and then a TTL serial adapter does the rest
<zid>
what are you using it for?
<zid>
other than team rocketing some free pokemon
<FatalNIX>
playing around. The first thing I did was make the gameboy joypad send its data over the cable
<FatalNIX>
I almost wrote a simple joypad driver for it on Linux but I was like meh
<FatalNIX>
it would have been a bit interesting
sonny has joined #osdev
<zid>
could make a gameboy player, like a player piano
<zid>
with a small stub
<FatalNIX>
heh
<zid>
injected into a random game
<FatalNIX>
There were multiple issues.. the AVR chip was constantly getting clock skew issues even wit SPI with the gameboy as the master
<zid>
It'd be pretty useful for creating test roms
<FatalNIX>
so I ended up making a little 4b5b codec thing
<FatalNIX>
yeah maybe. I wish I could use it as a debug port but I can't see how that'd be possible really
<zid>
You write a debug stub
<zid>
and shove it in the irq handler
<FatalNIX>
I thought of that, but then I thought of the issue where register data etc may not be preserved perfectly.
<zid>
You'd just need to reserve some memory for regsave
<FatalNIX>
May be something to look into. I have a flash cart that uses an SD card
<zid>
sick
<zid>
I always wanted a gb flash cart
<zid>
I ended up with gba later on at least
<FatalNIX>
currently I have an emulator that has a vscode plugin for full debugger on gameboy and gameboy color / sgb
<FatalNIX>
it's kinda cool
<FatalNIX>
If I could get that to work on real hardware...
<zid>
I wrote my own emulator, I don't really care about writing actual gb software
<zid>
but I love emulating it
<FatalNIX>
Even with the strangeness of intel and zilog having a baby?
<zid>
it's also a lovely cpu
Burgundy has quit [Remote host closed the connection]
<FatalNIX>
Yeah I like writing for it when i have the time
<zid>
the only actual weirdness is daa
<FatalNIX>
oh the BCD fix instruction?
<zid>
yea
<zid>
it's not the same as z80 or intel's
<FatalNIX>
I see a lot of people ask about it on forums etc confused.
<FatalNIX>
I have avoided any BCD so far
<zid>
you just to daa adc
<FatalNIX>
but from what I gather, it should just add / subtract 6 and 9 right?
<FatalNIX>
like you'd do on paper
<zid>
or 60
<zid>
or subtract them
<zid>
depending on direction flag
<FatalNIX>
It's interesting to me because, I don't think the Ricoh 2A03 even had BCD at all
<FatalNIX>
for the NES
<zid>
that's the 6502 in th -
<zid>
yea
<zid>
one of these cpus lacks direction but I forget which
<FatalNIX>
all of the BCD stuff was ripped out afaik, yet the gameboy has an instruction for it
<zid>
the adding 6 is to turn A back into 1, btw
<zid>
5 + 5 should be 10, not A
<FatalNIX>
Sounds about right
<FatalNIX>
I avoid BCD like the plague
<FatalNIX>
:)
<zid>
It saves a bunch of cycles for printing your score
<FatalNIX>
I would have been the asshole that just printed hex digits or something
JerryXiao has quit [Ping timeout: 240 seconds]
* gog
prints "mew"
freakazoid12345 has quit [Ping timeout: 260 seconds]
Matt|home has joined #osdev
atrapa has joined #osdev
freakazoid343 has joined #osdev
sonny has quit [Ping timeout: 250 seconds]
* moon-child
pets a picture of god
<zid>
I've nver sent you a picture of me or matsuri though
<heat>
petting god is kinda patronizing though
<zid>
what if god is fluffy though
<zid>
or has an itchy head
<zid>
then it's basically a ritualistic offering
<gog>
incidentally i do have an itchy head
* heat
scratches gog's head
* gog
prrrs
<heat>
uhhh, uhh, i shouldn't do this, i'm not a cheater
<heat>
i must admit I have another cat
<heat>
you're just a sidecat
<gog>
i knew what this was and i'm ok with it
<moon-child>
I have no cat, and can't get one
<moon-child>
must settle for digital simulacra
<moon-child>
:/
<gog>
we have neighborhood cats that visit us
<papaya>
I have a cat too but she'll get over it
xenos1984 has quit [Read error: Connection reset by peer]
* papaya
pets gog.
xenos1984 has joined #osdev
JanC has quit [Remote host closed the connection]
JanC has joined #osdev
rustyy has quit [Quit: leaving]
scripted has joined #osdev
<zid>
gog: what do they eat, it's not like they have trees for birds to live in
<scripted>
Can somebody tell me what's wrong with this (not finished) printf function? It seems to print out the value, but also some gibberish
<GeDaMo>
Have a function to output a single char which could be called from either your print or printf functions
<scripted>
that's what I thought
<scripted>
like a putchar function
<moon-child>
alternately: print((char[]){*x, 0})
<moon-child>
(don't actually do this, putchar is better)
<moon-child>
(or, I should rather say, more suitable)
<zid>
thanks I hate it
<scripted>
moon-child: Why though? It seems to save a lot of space
<scripted>
instead of writing a separate function
<moon-child>
why are you interested in saving space?
<scripted>
I mean less lines of code
<moon-child>
why are you interested in saving space?
<scripted>
why would you write a separate function if you can do the same thing in a 1 line which doesn't take much space?
<GeDaMo>
If you do the same thing at different points in the program, putting them in one place makes it easier to modify
<moon-child>
scripted: separation of concern
<scripted>
GeDaMo: yeah that's where printf comes in
<gog>
writing lots of functions is good actually
<gog>
the more functions something has the better it is
<moon-child>
for i in {1..1000000}; do echo "void f$i() {}"; done > t.c
<gog>
but also printf is responsible for formatting the output and should be agnostic of what it's outputting to more or less
<gog>
because it might be a stream, it might be a string buffer
<moon-child>
yep
<moon-child>
but, baby steps :P
<scripted>
great
<scripted>
putchar function is working
<FatalNIX>
Oh hey it's scripted
<scripted>
yeah
<scripted>
oh great
<zid>
I don't think he's *actually* a bot FatalNIX
<scripted>
I'm a bot?
<gog>
i'm a not
<gog>
a bot
<scripted>
that would be cool actually
<zid>
I'm a pot
<FatalNIX>
I'm a cop
<zid>
I'm a sign not a cop
<gog>
i want a lawyer
<FatalNIX>
hahaha
<scripted>
show me the money
<FatalNIX>
I'm no cop
<moon-child>
i anal
<FatalNIX>
is that a movie like i robot?
<zid>
pics?
<scripted>
everyone shooting at lawyers but suddenly they need one
<FatalNIX>
except that you get it from the back section
<scripted>
iRobot?
<FatalNIX>
ok after using fasmg for the first time
<FatalNIX>
it's insane.
<scripted>
You mean this movie where some teen got like a 30$ android movie into his brain and it somehow plugged into his brain without him dying realistically?
<FatalNIX>
I found it. This is what I have for the center monitor: amazon.com/GIGABYTE-G27QC-Monitor-Display-Response/dp/B0927BQT33/ref=asc_df_B0927BQT33
<bslsk05>
www.amazon.co.uk: ASUS TUF Gaming VG32VQ Gaming Monitor, 32 Inch (31.5 Inch) WQHD (2560x1440), Curved VA, up to 144Hz, DP, HDMI, ELMB Sync, FreeSync : Amazon.co.uk: Computers & Accessories
<papaya>
this is actually what I have its been a good monitor for me
<zid>
papaya: I'll take either, I'll add it to my wishlist and you can grab it
<FatalNIX>
I have had no complaints and honestly for someone like me who is a single monitor at a time person the curved monitor is fantastic
<zid>
I'm not fussed about curved monitors
<FatalNIX>
I'm not sure how well it'd go for people who like more than one
<papaya>
even if you use multiple monitors its good, its not excessively curved its just right
<FatalNIX>
they make a non-curved version
<zid>
I don't need the inch of desk space it saves
ZipCPU_ has joined #osdev
sonny has left #osdev [#osdev]
<FatalNIX>
well theoretically given average viewing distance with a curved monitor all parts of the screen will be the same distance from your face
<FatalNIX>
that's not always true
<FatalNIX>
but it's neat
<zid>
yea and you'd need to change the curvature if you're using multiple monitors from farther away etc
<zid>
it's kinda silly overall
<zid>
I'm fine with 3 flat ones with a beveled setup or whatever, not that I use multiple monitors atm
<FatalNIX>
I still really like the boldness of a CRT though
<zid>
I changed to a 1050 ti and 10xx+ series cards don't have analogue out
<zid>
so my crt's been off
<FatalNIX>
having that pitch black background is nice
<FatalNIX>
also, these gigabyte monitors are heavy af
<FatalNIX>
they are solid and rugged
<FatalNIX>
vesa mountable
<zid>
I'll make whatever monitor you want very solid and heavy
<zid>
just need a couple of sand bags and some lead shot
<FatalNIX>
some people like really light monitors
<FatalNIX>
but I uh
<FatalNIX>
I've knocked them over before :D
<FatalNIX>
I've knocked CRTs over too but that's a different cause
<zid>
either of you two happen to have 32GB of ddr3 ecc udimms
<zid>
might as well ask, seeing as you're paying attention
<FatalNIX>
when it's "Time to build a new desk because your 50 pound CRT fell off the desk and the VGA cable was one of those heavy duty ones that you actually screwed into the monitor instead of just plugging it in"
ZipCPU has quit [Ping timeout: 260 seconds]
ZipCPU_ is now known as ZipCPU
<FatalNIX>
and the desk was what went flying
<papaya>
That's wild
<FatalNIX>
But as you can see I build my desks like workbenches now
<zid>
quick, check your desk draws for udimms
<FatalNIX>
you could drop a bowling ball on them
<zid>
It's life or death
<papaya>
my desk surface is glass I wouldn't dare
<FatalNIX>
I reinforce my legs with triangles using 2x4s so the desk is stronger
<FatalNIX>
and use good plywood
<zid>
I have like
<zid>
a coffee table
<papaya>
do you have
<zid>
It's cheap but the desktop is like 1.5" thick
<FatalNIX>
My oscilloscope in action when I was working on the gameboy serial adapter project
<FatalNIX>
it's an 88 Tektronics 2440
<scripted>
it can't print out multiple data types at a row
<scripted>
but that's fine with me
<GeDaMo>
It's calling print with the contents of the string, not an address
<zid>
I like a cheap tektronics
<heat>
btw putchar is faster than fwrite
<moon-child>
oh, I just noticed, your width/height are backwards
<heat>
it's a simpler code path if you need to write a single byte
<scripted>
moon-child: the putchar function is based off the print function
<moon-child>
scripted: print() should _call_ putchar() instead of doing the logic itself
<scripted>
Ah
<scripted>
thanks for pointing that out
<FatalNIX>
Looking at fasmg and realizing that the ELF output format is literally just assembly macros that generate an ELF file...
<GeDaMo>
scripted: line 59 should be calling putchar, not print
<FatalNIX>
I wonder how I can abuse this :D
<heat>
FatalNIX, that's horrific lol
<FatalNIX>
heat: there's an example shipped with it that will even assemble JVM bytecode..
<gog>
FatalNIX: there's a few tutorials online about how to use NASM to make really tiny ELF files by abusing the phdrs
<FatalNIX>
I might use it with my homemade cpu arch
<zid>
I do a lot of object format headers with db
<zid>
just needs the linker to be able to do the right relocations
<scripted>
yeah I see
* geist
yawns
<geist>
good morning folks
<scripted>
fuck
<zid>
uh-oh
* moon-child
hands geist a cuppa
<scripted>
making line 20 to putchar makes my print function break
<zid>
it's dr pepper today, we upgraded
<geist>
yah brewing some coffee right now
<GeDaMo>
Why did you change line 20?
kkd has joined #osdev
<scripted>
wait not line 20
<scripted>
I meant the logic
<scripted>
23-25
<zid>
GeDaMo: you can check your drawers too
<scripted>
to : "putchar(string[i]);"
<scripted>
wait I might know why
<scripted>
yup
<FatalNIX>
I actually usually never have to think about object formats too much since I don't mix them with embedded projects anyways but fasmg was able to generate an elf64 using 16 bit x86 assembly... are there any real complications with things like word alignment doing that?
<GeDaMo>
zid: what am I checking for?
<scripted>
it was the term_height increment
<scripted>
in the print function
<scripted>
now it works
<zid>
GeDaMo: 4x8GB ecc 933Mhz udimms
<scripted>
I'm committing to github now
<heat>
FatalNIX, alignment of what?
<scripted>
gotta do homework now smh
<FatalNIX>
well my thought would be that elf64 is really meant to handle linking for 64 bit address space, right? Or does it actually not care at all. Obviously if everything is linked and packed into a file just right the machine doesn't care at all
<zid>
it's just an elf where the vaddr and paddr fields are 8 bytes
<geist>
it's meant to handle architectures that are 64bit
<geist>
ie, arm64, x86-64, power, etc
<geist>
right
dennis95 has quit [Quit: Leaving]
<moon-child>
zid: some of the bits get shuffled around for alignment reasons
<moon-child>
but yeah that's the main meaningful change
<scripted>
Ok, pushed to github (this time correctly I checked 3x times)
<scripted>
time to do homework I guess
<scripted>
cya everyone
scripted has quit [Quit: WeeChat 3.5]
<FatalNIX>
So I guess, what I am curious about since the steps were always done for me before- I just want to make sure that if I am mixing 16 bit and 32 bit x86 code in the same binary, that using say elf32 for both wouldn't cause problems.
<FatalNIX>
usually I'd just say output and elf and voila it's done
<FatalNIX>
but with fasmg I have to include the proper elf format
<zid>
you can load whatever data you want to whatever address you want with elf
<zid>
ld will get annoyed if you don't lie to it in the correct ways about the contents of the executable sections though
<FatalNIX>
That's good. See what I was afraid of for example, was, what if I used elf64 like a weirdo, would shit start getting alligned to 64 bit offsets everywhere because it assumed things, just as an example
<zid>
"i386 input incompatible with x86_64 output" or whatever
<FatalNIX>
aha
<zid>
so as long as you lie consistently you're fine
<FatalNIX>
:>
mahmutov has joined #osdev
parrott has left #osdev [Leaving]
<heat>
if you're mixing bitness you better have a way of switching processor modes
<zid>
I am leaving that as an exercise to the reader
<heat>
having an elf32 with 64-bit code or an elf64 with 32-bit code is pretty common
<heat>
in os land
vdamewood has joined #osdev
<FatalNIX>
What I was thinking of trying for a fun little fasmg project this time isn't anything special, but I was thinking of making a pluggable module interface for bootstrapping. For example, I could throw a DPMI module and if you compiled the kernel into a COM for dos or something with dpmi compiled in it would check for 32 bit dpmi services and then make the jump using DPMI's assistance, instead of doing what
<FatalNIX>
I normally do and just compiling a DPMI aware executable that does it for me.
<FatalNIX>
It's a stupid project really
<FatalNIX>
But I never initiated a dPMI client on my own, I always used an stdlib that did it for me :)
<FatalNIX>
I have obviously jumped to projected mode the regular way before obviously
<FatalNIX>
but DPMI gives me free shit
<FatalNIX>
and I figured it'd be a good test for the new fasmg assembler I'm playing with
<zid>
dos4gw
<FatalNIX>
I never actually got dos4gw to work right
<FatalNIX>
I've been using cwsdpmi
<zid>
I've never used any fancy dos stuff
<zid>
things just came with dos4gw that I ran
<FatalNIX>
heh
<zid>
my dos mode programming never went past 256 byte demos
<FatalNIX>
I have made 32 bit programs and 16 bit programs for DOS separately, and with 32 bit DPMI services it's not honestly any different half the time with an actual stdlib anyways
Burgundy has joined #osdev
<FatalNIX>
but at that point it just feels like using glibc with some DOS limitations
<FatalNIX>
and cool interrupts you can call
<heat>
isn't DOS with modules just UEFI with extra steps? :P
<FatalNIX>
hahaha
<zid>
64bit linux is just dos4gw but with an optional syscall interface
<FatalNIX>
I was sad to hear that freedos plus plus, a 64 bit C++ fork of freedos doesn't work on real hardware :(
srjek has quit [Ping timeout: 268 seconds]
<FatalNIX>
I could use some DLMI
<FatalNIX>
heh
<zid>
just do some osdev and dump yourself into a naked 64bit env
<FatalNIX>
I spend most of my time working with small systems though
<heat>
not naked you pervs
<moon-child>
prove it
<zid>
prove you're naked, for moon-child
<FatalNIX>
Like, a systems developer, yes, but I am by far not your every day x86/x86_64.. that processor family scares me to the shits
<moon-child>
pretty sure thats's illegal
<FatalNIX>
I've been meaning to invest my next adventures with RISC-V
<zid>
well you do seem to like toy computers
<FatalNIX>
I just feel that computers could be simpler sometimes.
<FatalNIX>
:)
<zid>
risc-v isn't even simple
<FatalNIX>
It didn't look too bad when I glanced at it a year ago
<zid>
and any machine anybody makes with it in will just be a PC anyway
<zid>
pci-e, dram, etc
<zid>
nobody's going to connect it to 33MHz sodimms
<zid>
and isa
<FatalNIX>
But I want VLB
<zid>
Is that a disease
<FatalNIX>
My 486 has VLB
<zid>
ah, vesa local bus
<FatalNIX>
it was very short lived
<FatalNIX>
in fact until I had this I never once had a machine with it even in the 90s
<FatalNIX>
We went from 16 bit ISA directly to 32 bit PCI
<zid>
not sure risc-v is going to revive that for you, sorry
<FatalNIX>
ha
<FatalNIX>
BUT
<FatalNIX>
RISC-V + virtio.. not real hardware but, hey
<zid>
I was AGP when I was computering
<FatalNIX>
might be kinda sexy
<zid>
I have a 6800 Ultra still
<FatalNIX>
My TRS-80s have a 6809E
<FatalNIX>
Dual Stack deliciousness
<FatalNIX>
They kinda suck though. The serial ports don't have any interrupts
<FatalNIX>
I've been thinking, maybe I should use an AVR or something to make like a serial comm thing for it, connect it to IRC somehow
<bslsk05>
'DEF CON 26 - Eyal Itkin, Yaniv Balmas - What the Fax?!' by DEFCONConference (00:44:15)
<FatalNIX>
daxes are just printers with a dialup modem though really
<FatalNIX>
I mean what's the big deal
<kazinsal>
the way faxes communicate gets really complicated and janky when digital phone trunking gets involved
<FatalNIX>
That's normal though
<FatalNIX>
they should have just done postscript
<FatalNIX>
postscript over dialup would have been fine
<zid>
in 1966?
<FatalNIX>
welllll
<FatalNIX>
I mean, once postscript became a thing
<kazinsal>
telephony is the ultimate example of needing incredible amounts of backwards compatibility
<zid>
we did do that
<zid>
we switched to email
<FatalNIX>
ha
<zid>
the moment pdf/ps/etc were a thing
<zid>
fax was a legacy technology in the 80s
<kazinsal>
still required by a lot of medical information statutes
<FatalNIX>
I have a fax machine
<zid>
I mean.. I *had* a fax machine, assuming you mean fax modem :p
<FatalNIX>
it's handy when I have a company like insurrance that needs documents only over fax
<FatalNIX>
I can just slam something into my hopper and send it away
<kazinsal>
for real though there's incredible effort made to ensure backwards compatibility in telephony. you can shove a rotary telephone into a FXS port on a cisco gateway and it'll automatically detect pulse dialing just fine
<FatalNIX>
yeah my ATA supports pulse dial I was like wtf
<FatalNIX>
lol
Ali_A has quit [Quit: Connection closed]
Likorn has quit [Quit: WeeChat 3.4.1]
<geist>
FatalNIX: re mixing 16 and 32bit code, i'd recommend always compiling and linking as 32, but if you have some 16 bit code, write it in asm and link it directly in, faking out the linker
<geist>
and avoid doing it as much as possible. any external references from 16bit code is flaky, etc
<geist>
even better, avoid using 16bit code altogether
<zid>
yup
<zid>
Keep your lie consistent
<geist>
yah avoid trying to use the linker to jam 16bit .o files with 32bit .o files. at best it's a huge mess, at worst it just doesn't work
<gog>
you could put all 16 bit code into its own section with a NOCROSSREFS
<kazinsal>
section .hicsuntdracones
<zid>
hi cunt dracones?
<zid>
oh here's an s, hic sunt dracones, latin?
<gog>
here be dragons
<zid>
ah
<zid>
that makes sense, gog is clever
<gog>
hérna er drekkur
<zid>
ryuu wa koko ni arimasu
<gog>
weeb
<zid>
I need a word for iceland fanaticism.. sans-tree-aboo?
<gog>
lol
* FireFly
is randomly reminded of the carta marina from the 'hic sunt dracones'.. also because iceland :p
<zid>
old maps are the best
<FireFly>
yeah, they're fun
<FireFly>
I should get some blutack so I can put up the facsimile of it I picked up recently..
mahmutov has quit [Ping timeout: 248 seconds]
GeDaMo has quit [Remote host closed the connection]
PapaFrog has quit [Ping timeout: 252 seconds]
PapaFrog has joined #osdev
<gog>
they call it iceland because there are no trees here
<gog>
ísland á engin tré
archenoth has quit [Ping timeout: 260 seconds]
V has quit [Changing host]
V has joined #osdev
atrapa has quit [Quit: atrapa]
<Griwes>
elf linkers pack segments together, ostensibly to "save space", but I don't think I care about this (; I'd like all LOAD segments to have their virtual address page aligned. I tried to find an option for doing this, but I've failed so far - is there something I missed that'd allow me to force a different layout, or am I left with patching the linker I'm using? (I'm using lld if that makes a difference)
<Griwes>
...that open ( was supposed to be followed by "with 5 load segments worst case is you waste 12KiB-4 if I'm counting right)"
<gog>
in your linker script just ALIGN(4K) the section
<FatalNIX>
geist: you know I didn't think about that. the more the 16 bit stuff is hidden from the rest of the linking process probably the better.
<Griwes>
Hmm, I guess I could have the compiler always use a custom linker script after spending a while making it do what I want
<zid>
had to scroll backwards a lot through my image dump discord
<FatalNIX>
forget links, make it pixel by pixel mesh, you bisect the model in half like a BSP would, and you have an greyscale with two halves, and the value of the greyscale pixels are a number between 0 and 1 where 0 is the origin of the BSP.
<FatalNIX>
no scaling though
<FatalNIX>
and no wireframes
<FatalNIX>
but it's horrifying and I love it
<zid>
sounds like you just invented voxels and oct trees
<kingoffrance>
FatalNIX "when you say the word "processes" and they say, "you mean, Apps?"" there's a ms paint-like steve jobs meme, with him grinning vindictively, bearing braces, as the side columns read x -> app y -> app z -> app im not sure that is accurate that he is responsible, but i believe that is the most appropriate response known
<kingoffrance>
at this time
<vin>
What was the channel for asking build tools related question? I can't find it in the search list
<zid>
workingset
<zid>
That'll be $4
<vin>
Thanks!
<heat>
#toolchain-nerds
<zid>
failing that, ##binutils and ask boru in your worst irish accent
<bslsk05>
'Portugal. The Man - Feel It Still (Official Music Video)' by Portugal. The Man (00:02:50)
Likorn has quit [Quit: WeeChat 3.4.1]
Likorn has joined #osdev
<vin>
Okay, since I didn't get help anywhere. I will post it here hoping for some help :)
<vin>
I am trying to compile c++ code using gcc because I wanted to use a custom glibc (I want __memmove_chk_avx512_no_vzeroupper) however I get an underfined reference error. I have tested this with c code and it works fine. Here is the command and ouput https://pastebin.com/raw/EgtV6Xtb
<mrvn>
Maybe if you take the train to fly to hawaii because you wanted apples instead of oranges your luggage may be lost? wait, what?
<heat>
vin, what's your c++ code?
<heat>
__memmove_chk_avx512_no_vzeroupper(void*, void*, unsigned long) is mangled, which means you forgot the extern "C"
<mrvn>
vin: you shlould really start to compile compilation units on their own and then link them.
<vin>
Ah my bad I had forgotten to add extern C, it works now thanks heat!
<heat>
plot twist: I am the toolchain nerd
<vin>
haha
<mrvn>
don't forget the #ifdef __cpp__
<vin>
yes mrvn and yes this is a prototype, I will clean it up soon by seperating it!
dra has quit [Quit: Leaving]
matrice64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kingoffrance has quit [Ping timeout: 246 seconds]
Jmabsd has quit [Quit: Leaving]
<sortie>
I PUT A CLOUD VM OF MY OS ON THE INTERNET WITH AN ACTUAL IPV4!
<zid>
neat
<sortie>
omg omg omg
<zid>
Mine sorta.. connects to the internet, but all it does is respond to pings
<zid>
so less connecting and more.. babbling
C-Man has quit [Ping timeout: 268 seconds]
<sortie>
oh hey it responds to ping too
<zid>
go on then, give the ip so we cn root it
<heat>
you don't need root, sortix doesn't have permission checking
<heat>
sortix 1 - 0 zid
<sortie>
I ssh'd into it!!
<zid>
so we can control it remotely without your permission*
<Bitweasil>
Yeah, how are you not giving us the IP? :D
<sortie>
Yeah maybe let's not give an angry herd of osdevers the IP address :)
<sortie>
But soon enough I'll migrate irc.sortix.org to it
<sortie>
So what I'm doing is really cool. I got an extra IPv4 for my dedicated server and my host assigned a MAC address that would be get the IPv4 if it asked over DHCP
<sortie>
Bridge networking is super scary because I don't wanna fuck up my remote server, since it seems that I need to basically migrate to a secondary virtual interface for normal operations, and turn the real interface into a switch
<sortie>
But I learned about this super cool thing called macvtap which is a lot more like what I want. Basically I use the ip(8) command to make such a device associated with my primary network interface and give it a MAC address, and then it creates a /dev/tapN device
<zid>
yea I constantly fuck up the internet in my VM messing with a bridge for my OS
<sortie>
That /dev/tap device is then associated with that MAC and transparently is connected to the LAN
<sortie>
I then spawn a qemu using that tap device, in a bit obscure way, and tell it to use the MAC address assigned by my host
<sortie>
The qemu boots my OS, my OS sees a network interface with a MAC, it brings the interface up with is connected via the tunnel through the macvtap directly to and from the real network interface to the gateway, the DHCP broadcast is sent from the right MAC, and my hosting provider responds with the secondary IPv4 I got assigned, and then my OS uses that MAC+IPv4
<sortie>
And boom my VM is directly connected to the public internet, receiving raw ethernet frames with raw IP packets
<sortie>
I.e. you're literally talking to my IP stack
<zid>
mine's simpler
<klange>
I just turn on my ThinkPad.
<zid>
brctl addif br0 eth0; brctl addif tap0 eth0
<zid>
brctl addif br0 eth0; brctl addif br0 tap0*
<sortie>
Previously people were technically talking to a Linux IP stack that was then port forwarded by qemu
<sortie>
I tried that bridge stuff but it took my desktop offline since the eth0 interface was now sent to the bridge..
<klange>
you can also just... run vmware
<klange>
no slirp, only tuntap ;-;
<sortie>
VirtualBox also takes care of stuff yea
<zid>
yea vmware also has a bridge mode, works fine
<zid>
I tested my code in it
<sortie>
The macvtap stuff is semantically a lot closer to what I want tho
<zid>
I suck at setting up linux bridges and routing tables and stuff :P
<zid>
so I just made vmware do the setup
<sortie>
It's how I thought bridges worked since virtualbox made it seem that easy
<kazinsal>
when I eventually do my core rewrite (yeah, I know, I've been talking about this for months and haven't written a line of code) I need to actually make sure that it works right in virtualbox
<heat>
kazinsal, why wouldn't it? you just need to be careful at early boot with how you do your memory allocation
<heat>
that's the only issue I've ran into
<kazinsal>
something about the way I handle interrupts in my current x86 core makes vbox have a sad
<sortie>
(It will allocate a MAC for you by default which you can see in /sys/class/net/macvtap0/address, I just override it manually since that's what my host expects to assign the right IPv4)
<heat>
my bootmem allocator was poorly thought out and not reserving things like it should so it overwrote stuff
<kazinsal>
vmware, hyper-v, real hardware, all fine. vbox? nope
<heat>
that's weird
<heat>
like irqs?
<kazinsal>
yeah
<sortie>
I dare say this stuff is actually simpler than bridged networking :)
freakazoid12345 has joined #osdev
<kazinsal>
lots of weird little bugs like that in my kernel core so I'm eventually going to just throw it out and write a new x86-64 kernel core and then bolt my network stack back onto it
<sortie>
Woo just logged into my OS via 'ssh $ip' with ssh public/private keys and it just worked \o/
<klange>
now if only I had the give-a-shit to actually implement listening sockets
<sortie>
Oh hey it's the eve of shitsgiving
<heat>
i also don't have listening sockets
<kazinsal>
same
<heat>
i am proud to announce I have reached feature parity with toaruos
<heat>
please use my os
<heat>
thanks
<sortie>
Hello clientele I will be your host tonight
<kazinsal>
it's high on the to-do list primarily because a router that you need to console into is a shitty router
<bslsk05>
'"Shia LaBeouf" Live - Rob Cantor' by robcantor (00:03:28)
<sortie>
I just need a port of let's encrypt and maybe nginx and then I can probably connect my sortix.org VM directly to the internet via an IPv4
<sortie>
I guess I kinda also need let's encrypt for irc.sortix.org but I can probably just cheat and take it offline whenever I need to renew the cert
<heat>
weren't you using openbsd's httpd?
<sortie>
Yup
<sortie>
It's missing a couple features, so the nginx proxying fixes a couple headers and redirects
<sortie>
One missing feature is the ability to set headers, which somehow they didn't implement (maybe added recently?), which I need in order to e.g. force HTTPS
<heat>
i want an exclusively http2/3 pub.sortix.org running on sortix
<heat>
http1.1 is for old people
* sortie
beard
<klange>
i would just like to have my old http server ported
<sortie>
It's a pretty surreal feeling though to boot VM and have it be assigned an official IPv4
<sortie>
Next up I should assign it like an official fully qualified hostname
<klange>
Reasonably certain I have no way to do this.
<klange>
I can't just go and get another global IPv4 address from anything right now.
<sortie>
Like then, you know, it OFFICIALLY ***IS** foo.sortix.org
<sortie>
IPv4 allocation, DNS assignment, hostname, all that official stuff
<klange>
Couldn't even hook the ThinkPad up to the outside world directly, we don't do IPoE here... would need a PPPoE stack...
* sortie
blinks
<sortie>
MY HOSTING PROVIDER HAS IPV6
<sortie>
I need to implement ipv6..
<sortie>
Network like it's 1995
<klange>
I could get a global IPv6 address...
<klange>
I could get several.
<sortie>
I think they gave me a /64
<klange>
We _do_ do IPv6 via IPoE.
<sortie>
Alas I still don't have consumer IPv6 >:(
<klange>
I currently have 9 global IPv6 addresses on this box.
<sortie>
That's like a primary reason I haven't cared about IPv6.. but now that I can put a VM online on the internet (both 4 and 6) I actually have a reason to implement it
<heat>
no ipv6 in denmark?
<heat>
that's kinda sus
<sortie>
heat, depends on provider
<sortie>
But mostly they just suck
nyah has quit [Quit: leaving]
<sortie>
The coolest thing about this setup is that it's completely transparent to users that it's a VM, it's a legit IP that works
<sortie>
All the packets routed perfectly
<sortie>
Much like real cloud providers anyway
<klange>
I could put my thinkpad in the DMZ
<klange>
and it could host a UDP service
<sortie>
You know you want to sef-host nyancatd
heat has quit [Remote host closed the connection]
<sortie>
niht :)
<sortie>
It's 1 AM but some cool osdev stuff really cheered me up after a pretty down day :)
srjek has quit [Ping timeout: 260 seconds]
immibis has quit [Remote host closed the connection]