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
_xor has joined #osdev
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
gog` has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
jjuran has quit [Ping timeout: 246 seconds]
jjuran has joined #osdev
gog` has quit [Ping timeout: 276 seconds]
<klange> why does OVMF's text console not have a fullscreen mode... my build isn't that old, and there's a commit from 11 years ago in TianoCore that adds one...
<klange> Hm, I do get a 100x31 mode by default... maybe it's building the mode list before it realizes the actual resolution...
<klange> I should 'available 100x31 mode' by default; it doesn't select that
<klange> VirtualBox's build does this all correctly and selects the full screen mode by default, though it has horrendously slow scrolling...
<heat> can you rebuild OVMF?
<klange> I'm afraid that might be my answer.
<heat> let me give you a patch
<klange> I really should just port my own terminal emulator over to EFI, get me some truetype, escape support, more colors, predictable unicode behavior...
<heat> wait it makes no sense
<klange> Now that I have an integer type that can hold 64-bit unsigned values, I can do a lot more to expose EFI APIs in kuroko-efi.
<klange> Might even do some automated codegen.
<heat> i dont understand
<klange> don't understand what?
<heat> why fullscreen doesn't work
<heat> it should?
<heat> it works on setup
<bslsk05> ​gist.github.com: 0001-MdeModulePkg-GraphicsConsoleDxe-Hack-to-make-the-ful.patch · GitHub
<heat> this seems to work
<heat> horrific hack, but I guess it does the job?
<heat> seems to at least
<heat> although now the boot menu doesn't work
<heat> i'll need to take a better look at this
<heat> if you need help building ovmf, clone edk2, cd edk2, make -C BaseTools (DONT -j$(nproc)), . edksetup.sh, build -n 0 -p OvmfPkg/OvmfPkgX64.dsc -a X64
<heat> actually, build -n 0 -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t GCC5
<heat> in Build/OvmfPkg/DEBUG_GCC5/FV/ you'll find your OVMF.fd
<heat> klange, actually, found out the issue
<heat> on modern OVMFs, it should already support what you want. HOWEVER, ConSplitterDxe (which outputs stuff to both video and serial) intersects the video modes
<heat> hence 80x25
<heat> fix: disable serial
<heat> qemu-system-x86_64 -serial none
qubasa has joined #osdev
heat has quit [Ping timeout: 264 seconds]
SpikeHeron has quit [Quit: WeeChat 3.5]
SpikeHeron has joined #osdev
toluene has quit [Ping timeout: 240 seconds]
srjek|home has quit [Ping timeout: 240 seconds]
vin has joined #osdev
toluene has joined #osdev
<vin> I see a weird behavior on ext4. I have a program running that opens, mmaps, reads, unmaps and closes a file and it goes on doing so for other files. However when I delete the opened file while the program has finished with it, I expect it to free up space on device (df -h).
<vin> This isn't the case though, even when I do rm -f file_name; sync; I see df -h reflecting the free space only after the program ends
<vin> Is this expected?
smeso has quit [Quit: smeso]
<vin> Deleting the file because I run out of space for the program if not.
<kingoffrance> "while the program has finished with it" i dont know, but does that mean you close the file descriptor?
<clever> vin: thats entirely normal, and happens on any fs with linux
<clever> a file isnt deleted until all names are deleted AND all open handles to it are closed
<kingoffrance> ^
<vin> yes kingoffrance I unmap and close the fd.
<clever> double check `ls -l /proc/*/fd/* | grep filename`
<clever> does any symlink turn up?
<vin> let me confirm
<clever> and also `grep filename /proc/*/maps`
<clever> there is also a trick to avoiding this problem, that is a bit more aggressive
<clever> use `truncate` instead of `rm`
<clever> that sets the size of the file, and doesnt care if its already open
<clever> if the program attempts to read bytes that you mmap'd, and then truncated, it will get a SIGBUS
smeso has joined #osdev
<vin> ls -l /proc/*/fd/* | grep 200gbUnsorted does not return anything
<clever> check maps as well
<vin> But this does # grep 200gbUnsorted /proc/*/maps /proc/18373/maps:7c1253c00000-7c40e4add000 r--s 00000000 103:01 12 /mnt/tmp/200gbUnsorted (deleted)
<vin> has multiple entries
<clever> then its still mapped inside pid 18373
<clever> 18373 needs to call munmap, or it needs to die
<vin> but I am sure I am unmapped. So I call map on a fd multiple times and assign it to the same pointer and unmap the pointer once, I expect all the maps to be unmapped
<clever> print all of your pointers out, and cross-reference it with /proc/PID/maps
<clever> and see if your leaking something
<vin> Ah okay, but will try the truncate trick as well because I don't care about the data in the file anymore
<clever> and truncate only works if the filename still exists
<clever> creating a new file with the same name doesnt count
<clever> either `kill 18373`, or use gdb to force the process to call munmap
* clever heads off to bed
<vin> I see, the filename exits and can be a hack for now but I better fix the code. Thanks clever
[itchyjunk] has quit [Remote host closed the connection]
Ellenor is now known as Reinhilde
mzxtuelkl has joined #osdev
SGautam has joined #osdev
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
qubasa has quit [Remote host closed the connection]
qubasa has joined #osdev
knusbaum has joined #osdev
jack_rabbit has quit [Ping timeout: 246 seconds]
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
pretty_dumm_guy has joined #osdev
MiningMarsh has joined #osdev
the_lanetly_052 has joined #osdev
daddycated has joined #osdev
fxttr has joined #osdev
toluene has quit [Ping timeout: 276 seconds]
toluene has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
<Mutabah> 4th fireworks?
<klys> yep
terminalpusher has joined #osdev
kingoffrance has quit [Read error: Connection reset by peer]
kingoffrance has joined #osdev
archenoth has joined #osdev
Oshawott has quit [Ping timeout: 246 seconds]
fxttr has quit [Quit: WeeChat 3.5]
the_lanetly_052 has quit [Read error: Connection reset by peer]
the_lanetly_052 has joined #osdev
chartreuse has quit [Quit: Leaving]
GeDaMo has joined #osdev
SGautam has joined #osdev
the_lanetly_052_ has joined #osdev
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 244 seconds]
X-Scale` is now known as X-Scale
terminalpusher has quit [Remote host closed the connection]
terminalpusher has joined #osdev
the_lanetly_052 has quit [Ping timeout: 276 seconds]
gog` has joined #osdev
<daddycated> Mutabah: it's your name
* Mutabah is away (Home)
<daddycated> ?
<daddycated> or just a nick name
daddycated has quit [Read error: Connection reset by peer]
FatAlbert has joined #osdev
<FatAlbert> heyo
heat has joined #osdev
<heat> 03:35 <vin> but I am sure I am unmapped. So I call map on a fd multiple times and assign it to the same pointer and unmap the pointer once, I expect all the maps to be unmapped
<heat> what?
<heat> you leak multiple mmaps and unmap the last one
<heat> how would all the maps be unmapped
<heat> it works like malloc
<FatAlbert> heat: at leat something i cna understadn
<FatAlbert> mmap
<FatAlbert> finalyl
<FatAlbert> finally
gildasio has joined #osdev
<FatAlbert> my english is not the best .. `trailing blanks` means the blanks at the start right ?
<Mutabah> No, trailing is at the end
<Mutabah> leading is at the start (leading meaning at the front, or coming before)
<FatAlbert> Mutabah: ok thank you
<FatAlbert> i did some knr exercise back in the days and my solutions make no sense cause i forgot that trailing is at the end
<FatAlbert> now it makes sense :)
<Mutabah> FatAlbert: wait, you were daddycated?
<Mutabah> "Mutabah" is just a nickname
<FatAlbert> Mutabah: what you mean ? i STILL daddycated
<FatAlbert> yes it's me :(
<FatAlbert> :)
<FatAlbert> i asked
<Mutabah> Different nicknames, hard to tell - had to check the username/hostmask
<FatAlbert> Mutabah is your name or a nickname you made up ?
<Mutabah> It's just a nickname
dennis95 has joined #osdev
<FatAlbert> only thing i can say that can probaly real contribute here .. is that ifi you already know vim, i highly suggest using vscode with the vscodevim extension .. you are getting the best of both worlds both the vscode
<FatAlbert> functions and the vim movement etc .. and without collisions .. both are customazible
SGautam has quit [Quit: Connection closed for inactivity]
xenos1984 has quit [Remote host closed the connection]
mzxtuelkl has quit [Quit: Leaving]
terminalpusher has quit [Remote host closed the connection]
gog` has quit [Ping timeout: 244 seconds]
<FatAlbert> Write a program to remove trailing blanks and tabs from
<FatAlbert> each line of input, and to delete entirely blank lines.
<FatAlbert> can i work in arbitrary length ?
<FatAlbert> it*
<FatAlbert> i guess not
<FatAlbert> Mutabah: you are a seasoned proggrammer .. what do you say ?
xenos1984 has joined #osdev
<Mutabah> On your comment about if that is feasible for arbitary length lines?
<\Test_User> what type of seasoning though
<Mutabah> Should be
<marshmallow> at what time the kernel invokes ld.so?
<Mutabah> Might be memory limited though
<FatAlbert> Mutabah: there is two ways to approach this kind of problems (1 choose a wise buffer per application so you never run out of it) (2 in cases which it's hard to predict, using dynamic whenever i starting to run out of buffer
<kingoffrance> 3) punt let someone else deal with it sed -E -e s/'[[:space:]]+$'//g | grep -v '^$'
<heat> marshmallow, when loading the program
<FatAlbert> kingoffrance: sure :)
<FatAlbert> at last something i can understand in #osdev !!!!
<heat> basically the elf loader loads the program you asked i.e /bin/ls, it sees /bin/ls depends on ld.so, so it loads ld.so and the new entry point becomes ld.so's entry point
<heat> ld.so relocates itself, loads librarie, relocates the main executable, yadda yadda
<heat> eventually it jumps to the executable's main
<heat> the kernel does *no* relocation
<FatAlbert> kingoffrance: the 'g' can be remove
<mrvn> FatAlbert: what kind of input? it only works on seekable files.
<FatAlbert> yeah i just not good at osdev .. i didn't say i don't know computers :_
<FatAlbert> )
<mrvn> marshmallow: someone calls exec(), the kernel sees INTERP in the ELF file and executes that instead.
<clever> pretty much the same as a #! in a script
<heat> that's not totally true
<heat> it's a half truth
<clever> but close enough, you can run an ld.so on a dynamic elf
<clever> just like you can run bash on a .sh file
<heat> exec still loads the original executable for dynamically linked ELFs
<heat> (loads = mmaps)
<mrvn> echo >fun.fun '#!./fun.fun'; chmod a+x fun.fun; fun.fun
<heat> #! doesn't mmap the script
<clever> yeah, that makes sense
<mrvn> heat: does it? Why? shouldn't it just pass the binary as argument to ld.so?
<mrvn> As clever says, you can call "ld.so binary"
<heat> that's because ld.so <binary> is explicitly supported
<heat> it loads the original executable as well
<heat> you look at the main program using AT_PHDR
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
tsraoien has joined #osdev
gog` has joined #osdev
tsraoien has quit [Ping timeout: 244 seconds]
[itchyjunk] has joined #osdev
gog` is now known as gog
k0valski1889 has joined #osdev
gorgonical has joined #osdev
SGautam has joined #osdev
<FatAlbert> mrvn: what only works on seekable files ?
<mrvn> FatAlbert: removing trailing whitespace
<FatAlbert> the problem was to avoid them by design
terminalpusher has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 240 seconds]
k8yun has joined #osdev
terminalpusher has quit [Remote host closed the connection]
dude12312414 has joined #osdev
terminalpusher has joined #osdev
bauen1 has quit [Ping timeout: 240 seconds]
blockhead has joined #osdev
dennis95 has quit [Quit: Leaving]
nyah has joined #osdev
the_lanetly_052_ has joined #osdev
pieguy128 has quit [Ping timeout: 264 seconds]
pieguy128 has joined #osdev
foudfou_ has joined #osdev
foudfou has quit [Ping timeout: 268 seconds]
gorgonical has quit [Quit: Client closed]
<heat> so I just had a "all of computing is fucked" talk
<heat> what do I do
<zid> nap? You already did it
<moon-child> heat: get over it
<heat> alcohol?
<heat> or hardcore drug abuse?
<gog> move to the azores
<gog> get rid of all your technology
<gog> start a cult
<Ermine> heat: is it recorded?
<FatAlbert> heat: it is fucked
<FatAlbert> let's start again :)
beit747 has joined #osdev
<FatAlbert> gog: i don't hear you
* gog coughs
<heat> Ermine, no
<zid> covid alert
<heat> gog, i don't understand people from the azores
<heat> what now
<gog> idk
<heat> they very clearly don't speak my language
<gog> zid: i'm literally waiting for my test results rn
<heat> is iceland better?
<gog> sure
<FatAlbert> never took the test even once
<zid> why wait, go cough on people NOW
<Ermine> heck, my irc client lost messages again. Tech is fucked indeed
<heat> from 1 to 10, how many hellholes would you give iceland?
<gog> 3
<heat> for scale, denmark?
<gog> 7
<heat> oh wow not that bad huh
<gog> jk i've n ever been to denmark
<zid> denmark is like the UK
<zid> so 7 is fair
<zid> (strange island based peoples who used to own several other countries, speak an incomprehensible dialect and have a vague social democracy)
<heat> with UK do you mean peak chav territory?
<heat> or just an average of the whole UK?
<CompanionCube> was it you giving the talk of hearing it
<Ermine> Iceland is empty country beyond Reykjavík afaik
<CompanionCube> also
<FatAlbert> she some kind of wonderful
<heat> iceland doesn't exist iceland doesn't exist jfk jr is coming back
<gog> ísland er ekki til
<CompanionCube> considering the current government denmark is probably a rather better social democracy than the uk
<gog> jfk jfksson er endurkomið
<heat> CompanionCube, my parser doesn't understand "was it you giving the talk of hearing it"
<heat> are you trying to buffer overflow me
<zid> no, you're just dumb heat
<FatAlbert> in island they talk finish ?
<CompanionCube> s/of/r/
<zid> 'have' doesn't specify direction
<CompanionCube> no, they talk finnish in finlnad
<zid> No they talk swedish and russian
<heat> CompanionCube, not a talk, a conversation
<zid> you said a talk
<FatAlbert> i didn't even knew that islandic is a language
<FatAlbert> i just googled
<zid> maybe that's why you didn't understand, you used none of the words you meant to
<heat> fuck u zid
<heat> i fuk u
<heat> bitch
<zid> That explains why you keep telling me you love me
<FatAlbert> :)
<psykose> when are you two getting married
<heat> ♥
<Ermine> invite me to your wedding
<heat> 💞💑
<psykose> so cute
<FatAlbert> i remember the days when gog told me to stop stalking her
<heat> zid can't see unicode
<heat> it's hilarious
<zid> I can see the heart, but not the other two
<psykose> heart is still in the high ascii isn't it
<GeDaMo> Playing card suits
<psykose> yea
<FatAlbert> which for the recordi never stalked her, but she seemed distressed
<zid> I have whatever unicode you can decode into latin-1 or whatever
<heat> psykose, no, it's just not an emoji
<zid> iso-8859-1? cp-1252? no idea
<psykose> heat: yeah, but i mean the space
<FatAlbert> GeDaMo: so nice of you to join us
<heat> U+2665
<FatAlbert> i hope he didn't /ignore me for fuck sake why i get the feeling that it's being done lately
<kingoffrance> what do you mean "had a talk" you were presenting? you were required to attend? unintentionally, someone's talk led you to that conclusion?
<kingoffrance> its something adults sit down and explain when you hit 12 or something?
<heat> FatAlbert, stop randomly tagging them then
dude12312414 has quit [Remote host closed the connection]
foudfou_ has quit [Remote host closed the connection]
<FatAlbert> heat: i don't tag !!
foudfou has joined #osdev
<heat> kingoffrance, no, I simply had a conversation with someone
<heat> and it's not the sex talk, so no
<Ermine> here, talk=conversation, not presentation
<heat> it's the everything in firmware is fucked talk
dude12312414 has joined #osdev
<kingoffrance> like unfixable blackboxes?
<Ermine> I would say, s/in firmware //
<FatAlbert> today i discovered that someone very important in ##C didn't ignore me
<zid> Computers were a mistake
<FatAlbert> you can imagine how relief i felt ... im lost without their help there
<heat> kingoffrance, like fixable security holes no one cares about fixing
<heat> and poor code quality all around
<kingoffrance> thats why there is bofh
<kingoffrance> thats a normal stage
<heat> bofh?
<CompanionCube> isn't this already known lol
<CompanionCube> 'firmware is crap' isn't new information?
<beit747> I am trying to convert my make.sh into a real Makefile. I was able to get my kernel to boot using an elf instead of a binary file thanks to zid. I have constructed a Makefile using a template and things compile ok but the original way I was doing things wont work since I was catting all the files into one binary. Elf works differently and im not to familiar with how it all works together. My question is
<FatAlbert> CompanionCube: that's what i told him
<beit747> how can I convert this make.sh into a normal working Makefile? Here are the relevant files: https://gist.github.com/beit747/fc21657b604ce9ac56b022aa7bdeb2c4
<bslsk05> ​gist.github.com: Files to compile boot loader and compile/link kernel · GitHub
<heat> CompanionCube, maybe?
[itchyjunk] has quit [Remote host closed the connection]
<FatAlbert> i think this is the longest offtopic conversation took place in #osdev for a long time
[itchyjunk] has joined #osdev
<GeDaMo> beit747: the two .asm file use different parameters
<Ermine> kingoffrance: bofh?
<FatAlbert> kingoffrance: bofh?
[itchyjunk] has quit [Remote host closed the connection]
<bslsk05> ​www.theregister.com: BOFH Archive • The Register
<beit747> I understand that the Makefile I am working on compiles all *.asm *.c files and links them all in one shot but I am catting boot.bin and kernel.bin into one binary... but my makefile is trying to link boot.o how can I create it so boot.o links properly and all works fine instead of some inline code that has to be in order?
<FatAlbert> oops .. i have shared clipboard between my PC's
<beit747> GeDaMo: what do you mean?
[itchyjunk] has joined #osdev
<GeDaMo> beit747: lines 4 and 7 of make.sh
<beit747> I'm guessing I can just edit my linker script to make it work
[itchyjunk] has quit [Remote host closed the connection]
<beit747> GeDaMo: yeah, that's what i'm trying to fix..
<beit747> GeDaMo: one is bin other is elf
<GeDaMo> Yes
[itchyjunk] has joined #osdev
<beit747> GeDaMo: can I just add the boot.o to the linker.ld?
<beit747> GeDaMo: I also want to remove the [org 0x7c00] from boot.asm
[itchyjunk] has quit [Remote host closed the connection]
<GeDaMo> Why?
<beit747> GeDaMo: which I dont think I need because it seems to be set in the linker.ld
[itchyjunk] has joined #osdev
<GeDaMo> I know nothing of linker scripts
<beit747> because when I compile it without -fno-stack-protector it errors
<heat> can you just use a normal bootloader please
<heat> most people here have not written a bootloader - myself included - so you're not bound to get much help
<beit747> heat: I am trying to piece things together to make the entire process more understandable to me..if I use some already made stuff many things will be hidden
<heat> a bootloader is hard to write
<heat> please, skip to the kernel
<heat> if you really want to write a bootloader, do it when you have more experience with x86, tooling, etc
<heat> you don't need to understand everything *right now*
<beit747> heat: well your attempt to persuade me is of no avail since my bootloader *works*
<beit747> heat: your right though.. I dont know much at all and was only able to write that thing following some pdf from the 80's
<heat> it reads a sector
<heat> you know you'll need to read more than that
<heat> right?
<GeDaMo> If it's working then stop trying to break it! :P
<beit747> GeDaMo: it works for raw data not elf..
<heat> please. I beg you, for my sake and your sake
<heat> use grub
<heat> or that weird discord bootloader they use
<beit747> heat: then I incorporate 2000 lines of code I have no idea about
<heat> ok
<heat> have you looked at your firmware?
<heat> you don't just spawn at 0x7c00 with 512 bytes of the disk already read
<beit747> heat: what does firmware have to do with the question I asked?
<heat> how does it not?
<heat> you don't want to use a pre-made bootloader because you didn't write it
<beit747> heat: well it is after all the required data is in ram and that is right after so nothing gets clobbered
<heat> but you have a whole boatload of firmware running under you
<heat> if you want to understand the *full* stack, you're not getting done
<heat> so focus on the more important parts
<heat> getting anything done*
<beit747> heat: considering the stack grows downward it may be a problem..
<kingoffrance> :D
<beit747> thanks for that
<kingoffrance> if you can make that pun then you are fine to write a bootloader
<heat> whatever
<heat> you do you
<kingoffrance> i will second though study tooling or trial by fire ...
<kingoffrance> org is explained in nasm manual for example, use the docs!
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
<beit747> kingoffrance: I sort of get what it does, just stops me from having to calculate all the time
<kingoffrance> well i dont have any good source to tell you. i learned toolchains just building toolchains for old game consoles
<beit747> well anyhow I wanted to remove the org because I get an unrecognized directive [org] when using that Makefile
<beit747> things compile fine using my make.sh, all I wanted direction with is how to convert it into a working Makefile
<zid> output: input\n\tcommand
<beit747> I tried some ugly makefile that didnt use any auto commands but that [org] thing complains each try
<beit747> and in the elf it defines the location so not sure why its in both of my linker and boot.asm
<beit747> from osdev it explains that I can just put the elf sections in the main boot.asm file and I dont need a linker script
<beit747> I guess it is explaning the multiboot header not the bootloader..
<beit747> and says to use grub just like i was told
<beit747> I guess its OS dev not bootloader dev I would assume the bootloader is pretty important since it sets up all the permissions
<gog> i only do bootloader dev
<beit747> grub is about 100 million bytes of code I have no idea about
<beit747> why would I just blindly incorporate all that into my own project?
<j`ey> you dont
<j`ey> you use it as a tool
<j`ey> beit747: bootloader doesnt setup the permissions
<beit747> just to get to the next step right?
<beit747> j`ey: I might have it wrong but I remember somewhere you can restrict a lot before it passes control to the kernel
<j`ey> I dont know if thats true or not for x86
<kingoffrance> beit747: the paste should be a start makefile equivalent to the script (remove echo, tabs are important dont mess with those). and what zid said. <target>: <dependency> wget 'https://defuse.ca/b/yWY45t4v?raw=true'; -O - | base64 -d
<kingoffrance> i had to paste into lynx, so you must base64 decode lol
Celelibi has joined #osdev
rorx has quit [Ping timeout: 255 seconds]
<beit747> kingoffrance: thanks for that
<kingoffrance> you can remove that "default: " line , im not sure that does anything, it seems to just do first target if you dont give a target on command line. look up in manual how to set default properly
<beit747> kingoffrance: thats sort of what I had before when tried to make one without all the auto commands but aborted since I was still catting boot.bin kernel.bin > os_image.. I want to understand why I cant use elf for that object
<GeDaMo> ELF has a structure, it's not just raw machine code
<beit747> right, which is why I cant use cat
<beit747> and why I asked why %.o : %.asm line would not work when linking everything together
<beit747> the %.o : %.c generates all the object files one being boot.o which gets created by nasm as bin boot.bin originally but then links boot.o along with main.o and linker.o
<beit747> im sure its because its the bootloader
<beit747> and doesnt link to the kernel
<beit747> and with me catting it first it puts all its code at the top
<gog> meow
<zid> Not that kind of catting, gog
<gog> oh right, the reason you can't do it like that is because you're referring to a symbols in your kernel from boot.asm and they need to be resolved at link time
<gog> i know it seems complicated right now but it's less fragile than the catting together object files way
<gog> although that does give me a new experiment idea
<gog> i really recommend that you look at the bare bones tutorials and really grasp what's happening in them before trying to diy too much'
<zid> I think people are still trying to convince him to use grub at all
<beit747> gog: I have looked over a few things but im not liking grub
<beit747> zid: your right
<beit747> 100 million bytes of code I would have to study just to understand the next step
<zid> https://github.com/zid/bootstrap I should make an x86 only version of this it'd be really simple
<bslsk05> ​zid/bootstrap - AMD64 bootstrap example. Sets up long mode and paging starting from a 32bit ELF booted by grub. (0 forks/0 stargazers)
<gog> grub is not 100 million bytes of code
<zid> I mean that's obviously false because my repo includes grub
<zid> and it's 100kB
<j`ey> beit747: why do you have to study it to use it?
<zid> and that includes filesystem drivers that I don't use
<moon-child> beit747: the c compiler is hundreds of millions of bytes of code. Do you 'blindly include' that?
<beit747> the source is 96M
<gog> source tree and history
<moon-child> and docs
<beit747> moon-child: good argument but its the closest thing I have to binary
<moon-child> not to mention the cpu
<beit747> although assembly would be even closer but I plan on learning both at the same time
<moon-child> beit747: no it's not. You have binary
<zid> My bios is 32MB
<zid> and 99% of what it does is load a signal sector to 7C00 for me
<beit747> right
<moon-child> cpu is hundreds of billions of transistors
<moon-child> embedded management engine
<moon-child> opaque, encrypted ucode
<zid> single*
<moon-child> probably backdoored by the nsa
<beit747> thats the next step to get an oscilloscope
<beit747> after I got assembly and c down pact
<beit747> j`ey: my mission is to learn not actually try to build some OS and market it for some reason
<gog> i don't think you're gonna have an easy time decoding the microcode
<beit747> I did learn to talk from listening to weird sounds and interpreting the relations
<j`ey> beit747: what bit are you interested in learning right now? OS/kernel stuff?
<beit747> j`ey: in the os/kernel stuff will bring me closer to learning c/assembly and thats all im doing at this point as im sure everyone sees im very unlearned
<zid> you have it inside out fwiw
<moon-child> indeed
<moon-child> learn c and assembly first
<moon-child> in a nice, comfy, hosted environment
<zid> If you want to learn C, go write some C, not fail to write a bunch of C in an environment you don't understand
<moon-child> with debugging tools
rorx has joined #osdev
<zid> and by 'go write' I mean 'get comfortable enough with it that the language in the spec makes sense to you'
<beit747> zid: thats where im comfortable
<zid> You are *obviously* not comfortable.
<beit747> the pieces will fit together sooner or later
<beit747> and when they do I dont have to backtrack much
<dzwdz> sorry to interrupt, but i'm trying to understand why unix pipes have separate read/write ends - could anyone point me at some resources?
<zid> because they're unidirectional
<zid> (and in practice, almost all pipes operate this way)
<zid> consider cat blah | grep meow
<beit747> me saying all this to much experienced programmers is pretty stupid im sure since you all know how much is missing even with what you know but if its there it can be figured out
<gog> first in first out
<zid> or any other series of commands formed with pipes
wikan has joined #osdev
<dzwdz> i know, but why bother with returning two fds instead of one?
<gog> because one becomes the stdout of the program on the left and the other becomes the stdin of the program on the right
<dzwdz> i could do the same with a single fd
<moon-child> so that you can send somebody just the read end (for instance), without allowing them the write end
<wikan> hi, quick question... what is difference between arm laptop and rasbery? I mean booting, kernel development, etc...
<zid> about 1kg of plastic
<dzwdz> what if instead i had a syscall for tagging fds as read/write-only?
<moon-child> well, an arm laptop is a type of computer, and a raspberry is a type of fruit
<j`ey> wikan: depends on the board
<j`ey> wikan: and what bootloader you can install etc
<dzwdz> because that sounds kinda sensible to me, but i feel like i'm missing something
<moon-child> an fd is a capability
<zid> I mean the main reason is probably "why not?"
<zid> The syscall is the expensive part, not the fd creation part
<moon-child> there are two separate capabilities you can have wrt a pipe: the capability to read from it and the capability to write to it
<moon-child> it seems only logical to realise this using two separate fds, then
<zid> making it return both (because the semantics of there being 2 is very useful)
<zid> rather than creating two syscalls for grabbing a read and write end seperately etc
<wikan> so arm os would need special release for rasberry, right?
<j`ey> wikan: not necessarily
<dzwdz> my line of thought was that returning a single fd is simpler, because then tracking the pipe's lifetime is dead simple
<wikan> ok, thanks it is enough :)
<j`ey> wikan: if you use u-boot for example, you can use EFI
<dzwdz> if i only had a single fd per pipe, i could free the pipe's stuff as soon as there are no more references to the fd
<wikan> i am not ready for writing my own os yet
<wikan> too many questions :)
<beit747> kingoffrance: thanks for the script but it doesn't seem to work although it compiles and loads qemu I just get Booting from Hard Disk... \n S S and it blinks a ton
<kingoffrance> i just gave you a makefile to match the script ...
<beit747> kingoffrance: yeah, it looks just like my make.sh just no different instead of using ./make.sh I do make && make run
<beit747> kingoffrance: I wont bother with that stuff anymore until I actually understand more than one day reading the makefile and elf docs
<kingoffrance> from what i see: the 512 byte MBR jumps to 0x7E00 whatever. that (before the elf, but linked with it) then jumps to elf entry point. well printf-type debugging is your friend. and there is a "hlt" instruction. see how far it gets ...
<beit747> kingoffrance: what is printf-type debugging?
<kingoffrance> just output "made it to this line" values etc. as opposed to using a real debugger :D
<zid> Ironically I'd say the biggest thing hamping your progress is your desire for progress
<zid> hampering*
<kingoffrance> sometimes thats all you got :D a certain ghost and simple folks we tend to prefer simple things
<zid> Rather than hoovering up all the easy gains you're hyper focused on trying to learn something specific
<beit747> zid: just trying to build the steps to learn not everyone has the *correct* steps layed out to build on
<zid> 'CHALLENGE BUILD: All secrets no rolling'
knusbaum has quit [Ping timeout: 240 seconds]
<zid> You're not trying to build the steps
<zid> That's *precisely* my point
<zid> You're staring at the top of the staircase trying to figure out the final step
<zid> I'd say you've got another 4-5 years of writing C before you're going to be even *remotely* fluent enough to write code worth running
<zid> Much less trying to out-do people in domain specific fields
<zid> and internalizing all their knowledge
knusbaum has joined #osdev
<beit747> I much rather learn to play footbal from a pro than be taught by someone that never made it
<zid> Would be a good analogy if it were at all relevent
<zid> If you wanna do a sports analogy it's like trying to learn to dribble by playing arsenal
<zid> no, you're going to get tackled and never see the ball again
<moon-child> eh, the thing about arsenal is that they always try and walk it in
<zid> :D
<zid> Thanks moon-child I couldn't make that joke myself
<beit747> I didnt say play, I said learn to play
<zid> You *don't even understand the lessons*(
<zid> you've had heat, gog, me etc all telling you things
<zid> and you just *outright ignore them* then *argue*
<beit747> exactly where these questions come from
<zid> You've got the pros, and you're telling them they're wrong
<mats1> tell me what to do daddy
<zid> mats1: 10km run
<zid> until your hair falls out
<beit747> im sure you have a simple real answer for every question I ask but has to be layed out in some cryptic explination and if its not understood its someone elses fault
<zid> You're so far beyond being able to understand the simple explanation that it is not possible, correct.
<j`ey> zid: that's a bit much lol
<zid> True though
<beit747> I guess some people are horrible teachers but I dont judge because I know its difficult
<beit747> there is no reason to search through a million words a day trying to learn and only retain .5 percent of it when I can ask a question and have .50 better understanding
<friedy> beit747: Teachers just facilitate learning. They can't do the learning for you. You may have the best teachers in the world, but you can only get yourself over the wall.
<beit747> friedy: yep, try talking to someone in a different language that doesn't understand it. there is steps to teach you cant just talk and expect the other to understand you have to learn how to teach each individual
<beit747> and thats what makes a good teacher
<beit747> OR you can just read out of a book and keep quoting all the rules to learn
<zid> What beit thinks is happening: There's a small hurdle where his paid tutor has to put some extra effort in to translate some terms. What's actually happening: He's screaming at volunteers for not learning for him
<beit747> no ones screeming
<friedy> zid: yeah
fwg has quit [Quit: so long and thanks for all the fish.]
<beit747> and noones expecting anything especially when I expected people to think their knowledge is so priceless that a few answers need to be 'learned' not explained
<zid> hit me, I will answer *any* question
<beit747> yeah in some sha512 format
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
<friedy> beit if you don't like this stuff go do webdev.
<friedy> Actually never mind I think you would struggle with that too.
<j`ey> ..?
<beit747> im actually enjoying it
<j`ey> beit747: good!
<beit747> dont mistake my words for attitude
<mrvn> wikan: My ARM laptop has a Raspberry
sortie has quit [Quit: Leaving]
<mrvn> dzwdz: Mayb creating a pipe pair is a shortcut for creating a socketpair and shutting down the write and read part of the FDs respectively.
sortie has joined #osdev
[itchyjunk] has quit [Quit: Leaving]
[itchyjunk] has joined #osdev
<gog> aaay it's not covids
<zid> so far!
<gog> true
<gog> it's not covid _this time_
<gog> beit747: in that analogy i'm literally somebody who never made it
<gog> so guess you don't need to learn from me :D
<gog> also there's a big difference between learning a programming language and learning how to program
<gog> you're trying to learn to program using notoriously unforgiving tools in a totally bare environment
<gog> while not impossible, there are better ways
beit747 has quit [Quit: leaving]
<zid> something tells me he didn't actually get the message, he just gave up arguing, sadly
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<sbalmos> doubt he gave up arguing. he just left pissed off because we're clearly holding keys to the kingdom and we're only interested in telling him how utterly inept he is
<friedy> Well he's not even humble enough to be a student. That's on him.
<sbalmos> not disagreeing. just saying.
<PapaFrog> I'm ahead of the game.. I know I'm inept.
<sbalmos> you're so inept you don't even know there is a game
<PapaFrog> Ouch
gorgonical has joined #osdev
<zid> it's a classic
<gorgonical> I think the kiwi webclient just dunked on me
<bslsk05> ​www.reddit.com: Dear internet, I'm a 26 year old lady who's been developing a science-based, 100% dragon MMO for the last two years. I'm finally making my beta-website now, and using my 3D work as a base to create my 50+ concept images. Wish me luck, Reddit; You'll be the first to see the site when it's finished. : gaming
<gorgonical> Did anyone actually see my messages earlier?
<gorgonical> lol
<zid> nop[e
<zid> your last message was
<zid> [23:01] <gorgonical> I also think his take on CHERI is really strange -- I see it as a really interesting way to "revive" segmentation with a modern take
<zid> about 3 days ago
<gorgonical> what in tarnation webclient
<zid> broken socket but your client never found out I assume
<zid> beacuse it's web
<zid> and error codes are illegal
<gorgonical> [12:37:51] <gorgonical> riscv kernel on qemu just mysteriously does nothing
<gorgonical> [12:38:41] <gorgonical> first insn is a jump to _start_kernel, but it doesn't execute it. I notice linux loads -13 as an immediate to a saved register and then the next insn is a jump, but I don't know why
<gorgonical> These were them
<zid> oh those were boring
<zid> can you say better ones next time
<sbalmos> it's web. it's truly asynchronous. as in, you're just now finding out they weren't sent. ;)
<gorgonical> yes yes ill try
<gorgonical> I also can't figure out how to make gcc compile compressed riscv instructions
SGautam has quit [Quit: Connection closed for inactivity]
terminalpusher has quit [Remote host closed the connection]
<mrvn> zid: so it it ready?
zaquest has quit [Remote host closed the connection]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<nullndvoid> no I don't think
<zid> I also don't think
<nullndvoid> ignore that I was scrolled up in my client haha
<zid> sorry you said it now, it's in the public record
zaquest has joined #osdev
<nullndvoid> same for you too
<mrvn> gorgonical: does it load -13 or something PC relative?
bauen1 has joined #osdev
<gorgonical> mrvn: it's the EFI signature I figured out
<gorgonical> The question I have is that my kernel just doesn't start. The bootloader jumps to 0x80200000 and a memory dump shows the j instruction, but it doesn't jump
<j`ey> MZ
<gorgonical> yes
<gorgonical> c.li s4,-13 yields "MZ" for risc-v
<gorgonical> But Linux has a non-efi path that should put the jump first. So it shouldn't matter. I don't even think there are risc-v boards with efi support
<j`ey> gorgonical: if it doesnt jump, what happens?
<j`ey> wheres the PC?
<gorgonical> pc points to 0x80200000, which xp shows has the first insn bytes
<gorgonical> But it just hangs there. Maybe it's an exception loop?
<j`ey> does it support -d?
<gorgonical> The debugging support in the qemu monitor is kind of low, I'm gonna try to hook up emacs
<j`ey> it = qemu
<j`ey> qemu -d int, prints exceptions on aarch64
<gorgonical> yep that's what I thought might be happening
<gorgonical> thanks for reminding me of that flag
<gorgonical> Been a minute since I used qemu
<zid> why are we not just using gdb?
<gorgonical> that's probably what I'm about to do
SpikeHeron has quit [Quit: WeeChat 3.5]
<j`ey> although if it was an exception loops, the PC would probably be elsewhere
<gorgonical> yep it turns out it is an exception loop. just infinite page faults because the handler isn't set up yet
<gorgonical> and apparently that doesn't cause resets
<j`ey> its not x86!
<zid> x86's 'cruft' is just that everything else is underspecified.
<mrvn> why does it segfault on boot?
Affliction has quit [*.net *.split]
duckworld has quit [*.net *.split]
duckworld has joined #osdev
Affliction has joined #osdev
<gorgonical> mrvn: it's segfaulting on the part that I borrowed from linux to determine what paging mode is supported. considering cutting it and hardspeccing it for now
k8yun has quit [Quit: Leaving]
FatAlbert has quit [Ping timeout: 244 seconds]
FatAlbert has joined #osdev
<gorgonical> cutting that means the page faults are on virtual addresses. that's cool
<heat> gorgonical, haha you found out the efi stub
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
gxt_ has quit [Remote host closed the connection]
gxt__ has joined #osdev
SpikeHeron has joined #osdev
<heat> arm64 has that same thing
<heat> a clever instruction that's also 'MZ'
<heat> and thus is a valid efi header
<j`ey> ccmp something
<heat> i wonder what will happen when we get an arch with that same boot protocol but no valid MZ instruction
<mrvn> you sure the instruction wasn't first and they picked te header to match?
<heat> for arm64? possibly, it's quite new. but not for aarch64, aarch64 has been around the block for quite some time
<mrvn> arm64 is aarch64
<bslsk05> ​en.wikipedia.org: DOS MZ executable - Wikipedia
<heat> whats your favourite ia-32e instruction?
<heat> I like aaa
<mrvn> Does it actualy use "MZ" on arm64?
<heat> mrvn, yes, EFI
<mrvn> So how does it know it's not an x86 binary?
<heat> PE header
<klange> aaa isn't valid in long mode...
<heat> the kernel assembles a stub pe header with MZ as the first instruction, then a second instruction that branches to the boot code
<heat> this makes it so the kernel is both a valid EFI pe executable and a valid linux boot protocol/uboot executable
<mrvn> I guess they got very lucky then
<heat> for context, the linux boot protocol jumps to the header
<heat> yeah it's pretty neat
<heat> i wonder if you can get something similar with x86?
<mrvn> Is the DOS header being ignored or is the jump also valid in the header?
<heat> MZ is part of the DOS header
<mrvn> heat: and the jump in byte 2 and 3
<heat> the boot protocol gives you like two UINT32s to work with as instructions
<mrvn> DOS header is 16 byte. 2 for the MZ, 4 for the pointer to PE Header. rest wikipedia doesn't say.
<bslsk05> ​elixir.bootlin.com: head.S - arch/riscv/kernel/head.S - Linux source code (v5.18.9) - Bootlin
nyah has quit [Ping timeout: 276 seconds]
<heat> there's no instruction that assembles to 4d
<heat> :(
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<heat> in x86 I mean
<heat> at least thats what I gathered from a quick SDM search
<gog> is there an instruction that asembles to meow
<heat> meow is not valid hex
<opal> lol
<opal> asking the real questions
<heat> what is down goggers
<kazinsal> 4D is the REX.WRB prefix
wikan has quit [Quit: WeeChat 3.0]
<heat> kazinsal, oooooooh. does 4d 5a assemble though?
<heat> we have 2 more bytes to use for the dummy instruction
<heat> preferrably one that doesn't crash the system