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
<kof673> i mean you can work a portugoose in there too > Mad Mallards “swim” around in the Kakara Desert. They summon Pumpkin Bombs to fight with them. Their main attack is laying an exploding egg
<Mondenkind> the_oz: rofl
ChloroticIssy has joined #osdev
ChloroticIssy has quit [Client Quit]
ChloroticIssy has joined #osdev
goliath has quit [Quit: SIGSEGV]
aethlas has joined #osdev
aethlas_ has quit [Ping timeout: 244 seconds]
Burgundy has quit [Ping timeout: 245 seconds]
Dead_Bush_Sanpa1 has joined #osdev
Dead_Bush_Sanpai has quit [Ping timeout: 260 seconds]
Dead_Bush_Sanpa1 is now known as Dead_Bush_Sanpai
citrons has quit [Ping timeout: 255 seconds]
beto has quit [Ping timeout: 255 seconds]
ChloroticIssy has quit [Quit: Client closed]
beto has joined #osdev
citrons has joined #osdev
heat has quit [Ping timeout: 246 seconds]
fkrauthan has quit [Ping timeout: 252 seconds]
fkrauthan has joined #osdev
orccoin has joined #osdev
<karenw> Is there an easy way to get the tickrate of the lapic timer other than setting up some other timer first?
Gooberpatrol_66 has quit [Quit: Konversation terminated!]
Gooberpatrol_66 has joined #osdev
vdamewood has joined #osdev
vdamewood is now known as vampiredamewood
<Mutabah> Might be in the ACPI tables
Artea has quit [Read error: Connection reset by peer]
ghoulg has quit [Quit: byee]
Gooberpatrol66 has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
Gooberpatrol_66 has quit [Ping timeout: 252 seconds]
craigo has joined #osdev
xenos1984 has joined #osdev
youcai has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jedesa has quit [Quit: jedesa]
guideX has quit [Read error: Connection reset by peer]
guideX has joined #osdev
<vai> hello
<klys> yes hello
GeDaMo has joined #osdev
karenw has quit [Ping timeout: 265 seconds]
<geist> it depends is the answer
<geist> some of the cpus have it in cpuid, but a lot dont, and some of them are implicit
<geist> but the fallback way is to time the lapic against the PIT
<geist> which is always running at a fixed rate
<geist> but they left. so...
Fingel has quit [Quit: Fingel]
alexander has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
npc has joined #osdev
alexander has joined #osdev
netbsduser` has joined #osdev
Artea has joined #osdev
vampiredamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
d5k has joined #osdev
d5k has quit [Quit: leaving]
d5k has joined #osdev
<netbsduser`> i have been thinking about that article heat posted, where Wilcox condemns linked list based page replacement scanning (https://www.infradead.org/~willy/linux/scan.c)
<bslsk05> ​lore.kernel.org: Virtual Scanning Considered Harmful - Matthew Wilcox
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
<netbsduser`> i do segmented fifo at present (ringbuffer-like structure tracks pages on a per-process basis, replacement locally is by fifo.) for some time i have wanted to move to a more sophisticated local level of replacement, probably a wsclock style approach
<netbsduser`> and it strikes me if i adopt aging of pages, it's almost certainly going to be better to scan the page tables sequentially rather than follow the previous ringbuffer-like structure. that even though tables will often be sparse and there will be swap PTEs and such in the way, it means i don't go jumping around between the replacement ring and the PTEs (whose accessed bit i need to look at)
klys has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
kfv has joined #osdev
xenos1984 has joined #osdev
fedaykin has quit [Read error: Connection reset by peer]
hwpplayer1 has joined #osdev
fedaykin has joined #osdev
<zid`> shrimp is bugs
jedesa has joined #osdev
goliath has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
npc has quit [Remote host closed the connection]
zetef has joined #osdev
zetef has quit [Client Quit]
kfv has joined #osdev
kfv has quit [Client Quit]
ghoulg has joined #osdev
leon has quit [Quit: see you later, alligator]
sortie has quit [Quit: Leaving]
sortie has joined #osdev
Burgundy has joined #osdev
leon has joined #osdev
aethlas has quit [Ping timeout: 252 seconds]
aethlas has joined #osdev
kfv has joined #osdev
xvmt has quit [Read error: Connection reset by peer]
xvmt has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raphaelsc has joined #osdev
kfv has joined #osdev
Left_Turn has joined #osdev
Burgundy has quit [Ping timeout: 246 seconds]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 252 seconds]
Left_Turn has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Turn_Left has quit [Ping timeout: 248 seconds]
kfv has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d5k has quit [Remote host closed the connection]
EmanueleDavalli has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
kfv has joined #osdev
kfv has quit [Remote host closed the connection]
kfv has joined #osdev
<EmanueleDavalli> Hello, I'm the guy with the triple fault caused by the global bit of PML4E being set on AMD cpu
<EmanueleDavalli> I think I solved the mistery of why it triple faulted on KVM also on an Intel cpu, turns out the cpu is so old it does not have mmu virtualization, and KVM was emulating an AMD cpu
spare has joined #osdev
youcai has joined #osdev
Turn_Left has joined #osdev
hwpplayer1 has quit [Read error: Connection reset by peer]
Left_Turn has quit [Ping timeout: 264 seconds]
Left_Turn has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hwpplayer1 has joined #osdev
<zid`> forgor to -host native?
Turn_Left has quit [Ping timeout: 244 seconds]
Artea has quit [Remote host closed the connection]
kfv has joined #osdev
heat has joined #osdev
jedesa has quit [Remote host closed the connection]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 248 seconds]
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jedesa has joined #osdev
hwpplayer1 has quit [Remote host closed the connection]
<ghoulg> forgor skull emoji
Turn_Left has joined #osdev
Burgundy has joined #osdev
Turn_Left has quit [Write error: Connection reset by peer]
<heat> ghoulg bazonga
Left_Turn has quit [Ping timeout: 248 seconds]
Turn_Left has joined #osdev
Burgundy has left #osdev [#osdev]
hwpplayer1 has joined #osdev
kfv has joined #osdev
kof673 has quit [Quit: q]
emntn has quit [Quit: WeeChat 4.4.2]
jedesa has quit [Remote host closed the connection]
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orccoin has quit [Ping timeout: 252 seconds]
Left_Turn has joined #osdev
kfv has joined #osdev
Turn_Left has quit [Ping timeout: 265 seconds]
Gooberpatrol66 has quit [Quit: Konversation terminated!]
Gooberpatrol66 has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kfv has joined #osdev
Gooberpatrol_66 has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 246 seconds]
kfv has quit [Remote host closed the connection]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 265 seconds]
Left_Turn has joined #osdev
kfv has joined #osdev
Turn_Left has quit [Ping timeout: 244 seconds]
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emntn has joined #osdev
Fingel has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
kfv has joined #osdev
hwpplayer1 has quit [Quit: bbl]
EmanueleDavalli has quit [Quit: Leaving]
Leftas has joined #osdev
spare has quit [Remote host closed the connection]
hwpplayer1 has joined #osdev
kfv has quit [Ping timeout: 245 seconds]
emntn has quit [Quit: WeeChat 4.4.2]
hwpplayer1 has quit [Remote host closed the connection]
emntn has joined #osdev
aethlas_ has joined #osdev
aethlas has quit [Ping timeout: 252 seconds]
kfv has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 265 seconds]
kfv has quit [Ping timeout: 246 seconds]
<hbag> alright, ive been following the meaty skeleton guide on the wiki, copying manually so it forces me to actually pay attention to what im copying. i've had to fix a few mistakes i made, which is fine, but this one error i got no idea about
<hbag> arch/i386/tty.c:64:13: error: assignment to 'int *' from 'long unsigned int' makes pointer from integer without a cast [-Wint-conversion]
<hbag> 64 | ptr = 0xB8000 + (VGA_WIDTH * 2) * (VGA_HEIGHT - 1) + x;
Arthuria has joined #osdev
<zid`> Thankfully it comes with a helpful error message :P
<zid`> 0xB8000 + .. is an integer
<zid`> ptr is a pointer
Turn_Left has joined #osdev
<zid`> and C doesn't allow you to assign one to the other
<hbag> right, but im doing it exactly as the guide says, which is throwing me off
<nortti> static uint16_t* const VGA_MEMORY = (uint16_t*) 0xB8000; ← this?
<nortti> the (uint16_t*) is a cast
<hbag> yep
<hbag> also seems to be complaining about 'c = *loop;' inside terminal_scroll
Left_Turn has quit [Ping timeout: 260 seconds]
<nortti> what is the complaint?
<hbag> arch/i386/tty.c:53:13: error: invalid type argument of unary '*' (have 'int')
<nortti> how do you define `loop`?
<hbag> int loop;, like it says in the guide
<zid`> link this guide?
<bslsk05> ​wiki.osdev.org: Meaty Skeleton - OSDev Wiki
<hbag> my first thought was that it was outdated, but... it's C, can't have changed *that* much
<zid`> no it's just bad
<zid`> all tutorials are bad
<zid`> and you don't know enough C
<nortti> yeah that appears to be buggy
<hbag> so whoever wrote this didn't bother to make sure it actually built?
<zid`> It's not semantically valid C and doesn't compile
<zid`> treat this as pseudocode at best
<zid`> It's also apparently C++
<zid`> not C at all
<zid`> (it also isn't valid C++ either though)
<nortti> yeah this seems to be confused about whether loop is meant to be an index or a pointer
Arthuria has quit [Ping timeout: 272 seconds]
<heat> int loop is probably one of the worst variable names ever
<zid`> Indeed
<zid`> Compared to the best variable name, class.
<heat> lol
<heat> fwiw the int loop wasn't in sortie's original meaty skeleton
<heat> scrolling was a homework assignment
<hbag> yeah im looking at the gitlab repo now. it appears someone has just thrown that in there
<zid`> so this is a *pirated* guide, with bonus mistakes? rofl
<zid`> The chinese star wars subtitles edition
<hbag> yeah i just finished the basic skeleton guide and moved onto this one, since it was linked in there
<bslsk05> ​redirect -> www.reddit.com <no title>
<bslsk05> ​wiki.osdev.org: Meaty Skeleton: Difference between revisions - OSDev Wiki
<heat> peterx does not know C
<zid`> The Third Gathers: Backstroke of the West
<zid`> heat: Especially because this is C++
<hbag> it would be nice if peterx made sure his shit compiled before he put it in a guide for people lmao
<zid`> this should be under a user:
<hbag> it is, peterx, unless im misunderstanding you
<heat> it's not C++
<zid`> It's C++.
<heat> int loop = 0; *loop has _never_ been C++
<zid`> unless extern "C" is suddenly C
<zid`> wat
<zid`> it's invalid in *every* language
<zid`> the code is still C++
<heat> what extern "C"?
<zid`> ctrl-f
<heat> you mean the extern "C" in the libc headers?
<heat> is glibc C++?
<hbag> yeah those are just in the headers
<zid`> That means it's designed to be compiled with a C++ compiler
<zid`> ergo it is C++
<heat> uhhhh no
<hbag> well tbf its wrapped in #ifdef __cplusplus
<zid`> unless it's #ifdef __cplusplus #error
<zid`> it's C++
* zid` might start doing that
<heat> glibc is a great C++ library
<heat> if you ever call musl C++ i'm pretty sure you'll get bomb threats
<zid`> sounds fun
<zid`> is this genuinely making a .so and runtime linking it
<zid`> or is it just catting all the files together in a big elf
<heat> what is?
<zid`> this meaty bullshit
<heat> just a static library
<zid`> or are they just setting it up so that people can use C++ and it's designed to be built "mostly" with a C compiler, then linked together with C++?
<heat> it's a continuation of bare bones
<zid`> also all the pointers are written C++ style, so a C++ programmer wrote it
<heat> it's designed to be set up so you can share most of the libc bits with the kernel, and obviously the libc headers need to have the #ifdef __cplusplus extern "C"
<zid`> obviously if you intend to link with C++
<heat> no, all libcs have it
<zid`> nothing I've ever written has done it, cus I'm not a weirdo, why is the ffi part of *my* responsibility lol
<zid`> you should extern C around your includes
<zid`> not force your lang's ffi into my project
<bslsk05> ​elixir.bootlin.com: cdefs.h - misc/sys/cdefs.h - Glibc source code glibc-2.40.9000 - Bootlin
<zid`> yup
<zid`> glibc is very designed to work with C++
<Ermine> hence it's written in c++
<zid`> If you compile it witha C++ compiler, it is, but it turns out that meaty build skeleton is just set up to allow it, rather than actually doing it
<zid`> so it can be C
<zid`> I asked
<Ermine> Oh wow, asahi lina does something x11-related
<zid`> is that a beer
<heat> the only thing that should be done with x11 is delet
<zid`> and use dwm.exe
<Ermine> that's why I'm surprised
<Ermine> asahi people are of the same opinion of x11
<hbag> ...wait, i wrote a terminal scroll function as part of the "homework" for the basic skeleton, why dont i just rip that out and replace peterx's function with it
<heat> good idea
<heat> i mean, do check if its correct
<heat> if you want to submit it to the wiki you should post the code for a quick war crimes code review
<hbag> well, there's still errors in tty.c that need fixing, but i can put my scroll function in a pastebin real quick
<Ermine> now the q: why did linux remove terminal scrolling
<heat> linux has terminal scrolling
<bslsk05> ​pastebin.com: TTY terminal scroll function - Pastebin.com
<heat> it deleted the scrollback function, that's all
<zid`> it didn't really belong in the kernel
<heat> >void terminal_scroll()
<zid`> and you can still have a scrolly console if you want
<heat> void terminal_scroll(void)
<zid`> just change your agetty to launch tmux or something instead
<heat> the loop isn't correct
<hbag> probably showing that i dont know enough C, but what's the difference between no arguments and 'void' as an argument?
<Ermine> iirc it worked on ctrl-pgup before
<zid`> () technically means unspecified arguments
<hbag> oh i see
<zid`> it's a dead feature that does nothing, but it does affect codegen on amd64
<zid`> It should have been removed in 1993 but wasn't
<heat> new C23-knowing compilers should warn or error on ()
<zid`> I thought they just converted it to (void)
<hbag> you said the loop wasn't correct, too?
<heat> yeah
<Ermine> it does affect one thing: you can declare void lol() and then call lol(kek, cheburek) and compiler will eat it
<zid`> hbag: Why is it walking forwards until it seems a non-character?
<Ermine> (and then define lol with correct arguments)
<zid`> sees*
<Ermine> qmail code does that
<hbag> it was the best way i could think of to shift each character up a line
<zid`> ?
<zid`> it's walking forwards looking for a blank character from the top left corner, because "it was the best way I could think of to shift each character up a line"?
<heat> easiest way: for every line+1 in height-1, shift it up a line. then clear the last line
<zid`> I just memcpy the entire buffer backwards 80 bytes starting at byte 80
<zid`> for scroll
<Ermine> reading from video memory is pessimal though
<zid`> yea I have an offscreen buffer
<hbag> yeah i just copied this direct from my basic skeleton so i didnt have a memcpy
<heat> memcpy works but it won't scale once you need a decent vt emulator
<zid`> for VT I'd just spit out the damn codes to the VT
<zid`> fuck emulators
<zid`> DEMAND a terminal being connected
<hbag> i guess since im already calculating the size of the buffer in there i can just use a for loop. maybe not the best way of doing it though
<heat> because then with non-shitty resolutions you need to do stuff like dirty tracking for non-horrible performance
<zid`> Required hardware: 2GHz+ CPU, 16GB ram, 1050 Ti, datapoint 2200
<Ermine> iirc onyx now has fast vt?
<heat> decently fast yeah, i did some work on it a few weeks ago
<heat> it's still slower than linux but linux i think pulls shit off with the GPU
<zid`> does VGA not have hw scroll
<heat> possibly but no one has VGA
<zid`> I mean, that's what this code is written against?
<zid`> VGA adapters
<Ermine> vesa framebuffers
<zid`> This will do precisely nothing on a framebuffer
<zid`> it's all writes to B8000
<Ermine> but, don't gpus have vga compat?
<heat> efi gpus don't do vga i'm pretty sure
<zid`> my gpu does vga fine
<Ermine> bios ones obv, since it uses a bunch of bios functions
<heat> it doesn't
<zid`> nvidia's customers would all shit a nut if they stopped supplying a vbios
<zid`> all those lovely CAD machines running w95
<zid`> with a GT750 in
<heat> hmm yes i'm starting to recall the details, EFI still touches some bits in the PCI config space that enables VGA access decoding
<heat> so you probably _can_ do VGA. i don't know how that interacts with the GOP for sure
<zid`> heat, I have bios booted a zen3, are you feeling ill
<heat> not particularly
<zid`> you love efi though
<heat> do i?
<zid`> You said it was way better for security and bios was trash
<heat> bios _is_ trash
<heat> efi is also trash
<zid`> ..then the efi jpeg decoder exploit hit every single mobo :D
<zid`> like, 3 days later
<heat> have you never heard one of my "efi sucks and i hate everyone that has ever worked on it" rants?
<zid`> see, you love it
<heat> (including myself)
<zid`> It's all you think about when you close your eyes
<zid`> That's called love
<hbag> god i suck with makefiles
<hbag> i think the makefiles in the meaty skeleton guide are fucked up too. it's looking for "kernel/kernel.o", which doesn't exist, as it's actually in "kernel/kernel/kernel.o"
<heat> the meaty skeleton guide used to be good
<Ermine> sharing code between kernel and libc is bad
kof673 has joined #osdev
<heat> uhh that makefile looks good to me?
<hbag> yeah im trying to figure out where i can tell it where the kernel object's *actually* located. if i change kernel/kernel.o to kernel/kernel/kernel.o it complains about there being no build target for that, but i don't see one for kernel/kernel.o either
<hbag> heat: i mean
<hbag> collect2: error: ld returned 1 exit status
<hbag> /home/hbag/opt/cross/lib/gcc/i686-elf/14.2.0/../../../../i686-elf/bin/ld: cannot find kernel/kernel.o: No such file or directory
<hbag> collect2: error: ld returned 1 exit status
<heat> how are you building the thing?
<zid`> left side tells it what to build, right side says what files changing will cause it to happen
<heat> considering you're in "kernel", kernel/kernel.o is kernel/kernel/kernel.o
<hbag> i'm running the ./iso.sh script
<zid`> sounds like you want `. .. kernel/ Makefile`
<zid`> and you type make
<zid`> there shouldn't be a kernel/kernel unless you made like, a 'project' folder called 'kernel' and then put the makefile outside of it, for some reason
<heat> nah, iso.sh is how it's supposed to be built
<hbag> i just followed the directory structure of the gitlab repo
<heat> i don't see any obvious mistakes
<hbag> well, for whatever reason, it can't find the object file for the kernel
<hbag> ...or kernel/arch/i386/boot.o
<hbag> it seems like this makefile should be running in the root directory rather than the kernel directory
<heat> it should not
<hbag> for the boot object at least
<heat> do those object files exist?
<hbag> yeah. i think i see the problem though
<hbag> i went into config.sh and modified the AR, AS and CC variables as my toolchain isnt in my PATH, and i think it's trying to find them relative to those directories
<heat> no
<heat> unless you screwed up config.sh big time
<heat> are those .o's valid?
<hbag> as far as i can tell
<hbag> well, here's what it tries to run before the linker complains it cant find the kernel object:
<hbag> /home/hbag/opt/cross/bin/i686-elf-gcc --sysroot=/home/hbag/hilbos/sysroot -isystem=/usr/include -T arch/i386/linker.ld -o myos.kernel -O2 -g -ffreestanding -Wall -Wextra arch/i386/crti.o arch/i386/crtbegin.o arch/i386/boot.o arch/i386/tty.o \ kernel/kernel.o -nostdlib -lk -lgcc arch/i386/crtend.o arch/i386/crtn.o
<heat> do file arch/i386/boot.o
<heat> and post the output
<hbag> from the project root or the directory the makefile's in
<hbag> from the kernel directory, where the makefile is:
<hbag> arch/i386/boot.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), with debug_info, not stripped
<heat> add -Wl,--verbose to the link and post the output
<bslsk05> ​pastebin.com: GNU ld (GNU Binutils) 2.43.1 Supported emulations: elf_i386 elf_iamcu - Pastebin.com
<hbag> kernel.o *does* exist, im looking right at it
<heat> file kernel/kernel.o
<hbag> kernel/kernel.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), with debug_info, not stripped
<heat> i'm so confused
<heat> so, in the toplevel/kernel/ directory, you have an arch/ and a kernel/. kernel/ has a kernel.o in it.
<heat> the linker cannot find kernel/kernel.o from toplevel/kernel
<hbag> apparently
<heat> but it can find arch/i386/whatever
<hbag> yep
<heat> stat kernel/kernel.o
<bslsk05> ​pastebin.com: File: kernel/kernel.o Size: 2552 Blocks: 8 IO Block: 40 - Pastebin.com
<heat> oh no i think i see it
<heat> you fucked the makefile up (or maybe it was fucked from the start)
<heat> attempt to open kernel/kernel.o failed
<heat> it's trying to open " kernel/kernel.o"
<heat> note the leading space
<hbag> hmm
<hbag> well there isn't a leading space anywhere in KERNEL_OBJS
<hbag> KERNEL_OBJS=\
<hbag> $(KERNEL_ARCH_OBJS) \
<hbag> kernel/kernel.o \
<hbag> (yes, i checked after the \ after $(KERNEL_ARCH_OBJS))
<heat> can you post the makefile and the build output for the clean build?
<hbag> yeah sure
<hbag> kernel makefile: https://pastebin.com/F271SAga
<bslsk05> ​pastebin.com: DEFAULT_HOST!=../default-host.shHOST?=DEFAULT_HOSTHOSTARCH!=../target-triple - Pastebin.com
<hbag> clean build: https://pastebin.com/vyY2tz0P
<bslsk05> ​pastebin.com: mkdir -p /home/hbag/hilbos/sysroot/usr/includecp -R --preserve=timestamps incl - Pastebin.com
<heat> post the arch/i386/make.config please
<heat> i think i know what's going on
Fingel has quit [Ping timeout: 260 seconds]
<bslsk05> ​pastebin.com: KERNEL_ARCH_CFLAGS=KERNEL_ARCH_CPPFLAGS=KERNEL_ARCH_LDFLAGS=KERNEL_ARCH_LI - Pastebin.com
<heat> haha
<hbag> i dont see it
<heat> your make.config is missing the trailing newline, so VAR=line \ will be expanded with a literal \
<hbag> oh motherfucker
<heat> $(KERNEL_ARCH_OBJS) \ will expand as stuff \\
<heat> which in the command line is coming out as some sort of a newline
<hbag> yep. it builds now. jesus christ
<heat> makefile tip
<heat> don't have trailing slashes in variables
<heat> makefile tip 2: when in doubt, do :=
<heat> VAR= is horrible, it does lazy expansion
<hbag> lol that the meaty skeleton has a scroll function but no support for newline characters
<hbag> although actually wasnt the scroll function just thrown in by peterx randomly
<hbag> yeah makes sense then nvm
raphaelsc has quit [Ping timeout: 255 seconds]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
<heat> what a horrible problem
<heat> fyi all unix files should end with a trailing newline
<Matt|home> alright well, yet again the novelty of looking at coding new things is swiftly wearing off and yet again i am looking at 20 million ways to do one thing with no clear direction on which one to pick
<Matt|home> sigh. ah well, maybe i'll get lucky and this is just a small bump
<Matt|home> perhaps making a very simple UEFI kernel will be fun, who knows
<the_oz> you have to try out new ideas to get a taste for what your design is gonna be'
<the_oz> like, make a clone? sure if you want to be yet another
<hbag> im pretty sure im severely underqualified (i.e, just got my BSc in july and been working in gamedev for like three months) but im still enjoying trying to figure shit out
<heat> make a clone if you want to be yet another, don't make a clone if you want to be a yet another project in the graveyard list of "interesting OS projects"
<heat> you literally cannot win
<the_oz> that is over the whole spectrum
<Matt|home> oh no, i will win
<Matt|home> im just a little annoyed is all
<Matt|home> i mean, lol there's no question that i'll win it's kinda hilarious you even brought it up :D
<the_oz> you already have to be crazy to even start if your goal is making a big name OS. End picture kinda thing that even big name OSes didn't aim for that at the start
xenos1984 has quit [Read error: Connection reset by peer]
<heat> not just big name OSes
<heat> even winning at a small scale
<Matt|home> yeah, but realistically it's more about marketing and graphics drivers than it is about anything else
<Matt|home> plus it's me, so by default that makes it not crazy
<Matt|home> obviously
<heat> your hobby OS is either interesting enough that it doesn't do anything of note (because of various compatibility issues, maybe you've spent WAYYYYYY too long designing the thing, maybe teh design sucks, etc), or it's so uninteresting there's almost no reason why one should use it instead of linux or freebsd or windows or whatever
* Matt|home packs a bowl and hands it to heat
<Matt|home> there's no such thing as an unsellable product
<heat> sure there is
<heat> "this is linux but worse"
<Matt|home> the fucking pet rock proved that
<Matt|home> also, i mean, you're missing literally the most obvious point anyway
<Matt|home> im the one working on it, therefore it will succeed. this is like saying the fckin sun is gonna rise tomorrow
netbsduser` has quit [Ping timeout: 248 seconds]
<heat> reactos's only point over windows is that it's free and open source, and it's still fucking sucks, and it's still pretty useless
<heat> s/it's/it/
<bslsk05> ​<heat*> reactos's only point over windows is that it free and open source, and it still fucking sucks, and it still pretty useless
<heat> eh not correct but close enough
<Matt|home> anyway i need about 7 ish months and i'll have a working prototype to show off, should be enough to get customers
<heat> what crack have you been smoking
<Matt|home> i usually don't, more of a weed/morphine/vicodin kinda guy
<Matt|home> but iirc the last one i tried was called some bullshit modern name, like "candy jack" or cotton candy jack or something
raphaelsc has joined #osdev
<Matt|home> idk, fuckin weird names for shit now :/
<Matt|home> that was... 4ish years ago
<the_oz> heat is a terrible marketer
<Matt|home> i know
<the_oz> he might be right but shit, what you're gonna need to do is create a simple idea of a niche where you excel at
<Matt|home> i mean i said it a bunch of times already but i'll say it again: your product doesn't need to be good to sell, it just needs to be cheap addictive and marketed correctly
<the_oz> "bitcoin is gold but my litecoin is silver!"
<heat> i'm not a good marketer but big corps have lots of marketing people and all of their OSes failed
<Matt|home> example: oh sure you guys like what you see? the pretty start menu i made with fancy graphics? yeah you can unlock that with the subscription fee if we meet our goal, otherwise all proceeds go to finishing the file system" etc etc
<heat> why would anyone use IBM AIX apart from "my program from 1991 was written for the IBM AIX and I need it to keep running without a rewrite"
<Matt|home> i mean you just said it
<Matt|home> cuz they need it to keep running without interruption
<heat> and this would be assuming a fantasy world where a hobby os can ever be sold or marketable
<Matt|home> lol, don't worry i'll make that "fantasy" come true you don't have to do nothin i promise
<heat> like, no buddy, i've been doing this for almost 9 years, others have been doing it for longer
<Matt|home> in no way shape or form am i discounting your abilities or experience as a developer
<Matt|home> that i promise
<the_oz> use your position to its strengths, you aren't selling an OS, you're selling access to hardware+software
<Matt|home> but i also know my own abilities better than anyone else :p
<the_oz> the position being unfettered by the existent
<Matt|home> speaking of: heat have you used reactOS before? i haven't looked at it yet
<heat> i have, it sucks
<Matt|home> what are the issues with it primarily?
<heat> it's a bad and old version of windows
<Matt|home> i at least dig the retro UI, looks fine
ngn has quit [Ping timeout: 260 seconds]
<Ermine> why bad though
<heat> it's a version of windows where most things do not work
<heat> if i want things to just not work, i use linux
<Ermine> I guess it's fine given reactos team's limited resources, closedness of windows and legal constraints?
<heat> oh, it's a fine effort, don't get me wrong
<heat> but it's still unusable for people not named russian government
Burgundy has joined #osdev
<Ermine> they don't use it
<heat> even worse
karenw has joined #osdev
<heat> even geopolitics can't justify using reactos
<Ermine> But I guess someone made a tidy sum of money by promoting it as "import replacement"
<Matt|home> heat , let me ask you a series of questions unrelated to what we're talking about now, because i legit need to make a decision tonight about a potentially large project and i want your input
<Matt|home> just 3-4, yes /no
xenos1984 has joined #osdev
<Ermine> but... hobbyist OSes are mostly unusable, no?
<Matt|home> 1) have you worked with any graphics APIs for desktop applications ?
<heat> Ermine, correct
<heat> Matt|home, yes
<Matt|home> 2) as a developer have you ever had frustrations when deciding which APIs/platforms/etc you wanted/needed to use?
<heat> yes
_ngn has joined #osdev
<Matt|home> 3) at the end of the day would you say that you have a good or bad understanding of what modern APIs strengths and weaknesses are for a lot of different things
<Matt|home> e.g. vulkan vs opengl etc
<heat> i'd say i have a good understand of lots of APIs, I don't have a good understanding for graphics APIs though
hwpplayer1 has joined #osdev
<Ermine> inb4 heat gets an offer
<Matt|home> copy that. i've been second guessing myself all freaking day long over which API i want to use for this stupid graphics project, and almost all of them have pissed me off in some way
<Matt|home> is this normal or am i being too picky
<heat> i accept donations (5000 euro min)
<Matt|home> yeah for that much i'd want my own personal slave
<heat> if it's a stupid graphics project, any stupid graphics API will work, hth
<Ermine> glide!
<Matt|home> well as an example i was trying to stick to win32 but the damn docs had conflicting info, then i looked into qt but that has it's own quirks, MFC is dead etc etc etc etc
<Ermine> well, those questions did sound like some interview stuff
<Matt|home> sigh, i wish i didn't have this stupid problem with literally every project
<Ermine> you're too picky
<Ermine> just like me
<heat> select vs poll vs epoll vs kqueue vs literally dying
<heat> i think i'm picking literally dying
<Matt|home> hilarious
<Matt|home> i spent all that time reading up on win32 stuff and now im not even sure im gonna use it :/ i need a break..
<hbag> how should i go about implementing outb? i tried just pulling it from the existing io.h on my machine but im assuming im not doing it right. the header file itself defined the function rather than just its signature, do i still need to define it in a c file?
<kof673> its all marketing: "city on a shining hill" -- this does not exist anywhere except in alchemy land when your earth rises out of the water. 10s if not 100s of places on earth claimed to be this.
<heat> hbag, that's an inline
<kof673> its marketing even when you think its not
<heat> you don't need to define inlines in .c
<hbag> right, thats what i thought
Artea has joined #osdev
<hbag> so im fucking up somewhere else
<the_oz> The smallest use/license of opengl is gl3w https://github.com/skaslev/gl3w and GLFW https://www.glfw.org/docs/latest/ but this is old (but it's still working) and assuming C and OpenGL
<bslsk05> ​skaslev/gl3w - Simple OpenGL core profile loading (158 forks/707 stargazers/Unlicense)
<bslsk05> ​www.glfw.org: GLFW: Introduction
hwpplayer1 has quit [Remote host closed the connection]
<the_oz> I mean if you're looking to make a game, get the api bullshit out of the way, right?
<hbag> right now this is my entire sys/io.h file: https://pastebin.com/xmwNcYat
<bslsk05> ​pastebin.com: #ifndef _SYS_IO_H#define _SYS_IO_H 1static __inline voidoutb (unsigned c - Pastebin.com
<hbag> im trying to use outb to move the VGA cursor but i guess im doing it wrong
<heat> your header's outb is backwards wrt the wiki
<heat> this isn't a bug, it's just how sys/io.h works
<hbag> it is?
<heat> yes
<heat> wiki assumes outb(port, val), normal people assume outb(port, val), sys/io.h has outb(val, port)
<hbag> ...mine is doing val, port though?
<heat> right
<heat> the wiki port will do port, val
<heat> the wiki code*
<hbag> riiight
<heat> the wiki also has its own outb/w/l code
<heat> what you just did is, uhh, a copyright violation
<hbag> well its not like im gonna be sharing this anywhere but thanks for the heads up
<hbag> even after swapping them the cursor's still not moving so i guess its something else
<bslsk05> ​wiki.osdev.org: Text Mode Cursor - OSDev Wiki
<hbag> that is the code i am using
<hbag> thats how i found out i needed to implement outb lmao
<hbag> ...it might be because im telling it to move the cursor inside terminal_writestring, and i dont think printf ever calls that
<hbag> yep that was it
<hbag> heat: so the implementations of outb, inb, etc on the wiki are fine to use?
<heat> sure
<nikolar> aren't those just oneliners of asm(..)
<heat> afaik everything in the wiki is CC0
_ngn has quit [Ping timeout: 260 seconds]
<karenw> So. I ran `sti`, unmasked the lapic, have timer interrupts workking (but uncalibrated). What do I do net, my goal is to get interrupts from the keyboard.
<karenw> Parse the ACPI stuff to find the IOAPIC and unmask that?
<heat> yes
alexander has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
<karenw> Also is it still relevant to remap then disable the legacy pic(s)?
<heat> yes
alexander has joined #osdev
<karenw> Looks like limine disabled it, but didn't remap it. So if I understand right that means I could (at least on real hardware) get spurious interrupts from the legacy pic. Which would be mapped to a reserved exception, and probabally result in stack corruption. All bad.
<clever> but if its disabled, shouldnt it ... not interupt things?
<karenw> Should, yes
<karenw> Hence the word 'spurious'
<karenw> `pic1: irr=00 imr=00 isr=00 hprio=0 irq_base=28 rr_sel=0 elcr=0c fnm=0` I have no idea what qemu is saying here other than irq_base is where I expect it to be
goliath has quit [Quit: SIGSEGV]
<geist> you can easily rebase it though, usually folks rebase it to 0x20 and then put the second pic right behind it
<geist> you dont *need* the bring up the ioapic at all to just do keyboard stuff
<geist> that's just sort of second level stuff
<heat> i think limine enables the ioapic
<heat> because of course it does
<karenw> limine: does everything you don't expect, and nothing you would like. (I say that like grub isn't worse)
<heat> limine is genuinely the worst bootloader i've ever seen, but just because it's discordware and takes care of basic shit newbs don't want to do, it's worshipped
<heat> i bet if you go on the discord and speak unfavourably about limine mint will ban you
<karenw> :D
<karenw> It worksgreat for getting me from a host commandline to _start. The less I need it's requests, the better.
raphaelsc has quit [Remote host closed the connection]
<karenw> TBH, that seems to be the way mint is taking it, used to have a bunch of stupid features like a full non-textmode terminal.
<heat> the most basic observation about low level development is that the least you need from the previous layer, the better
<karenw> Limine might have enabled the ioapic but everything is masked off atm
<heat> which is why generally when dealing with this kind of software, each layer _fully_ reinitializes everything
<heat> always think the people that came before you were idiots, and the people that come after you are also idiots
<heat> and you are also an idiot, but never think that, that's not the kernel way
<kof673> .......something something be "conservative" in what you output, 'liberal' in what you accept, rfc something something.......
<heat> yep
<kof673> murphy's law too, anything that can go wrong will lol
<karenw> Well, for non hobby code "Always code like the future maintainer will be an axe murderer who knows where you like"
<karenw> Hopefully for hobby code, I won't turn into an axe muderer
<karenw> *where you live
<geist> huh seemsl ike it should at least pass you the address of the ioapic(s)
<geist> since presumably it also parsed ACPI to find it
<geist> on that note, for all practical purposes the first ioapic (which is most of the time the only one on consumer hardware) is always at the same location for backwards compat purposes
<geist> ssame with the lapic. it could be somewhere else but then old stuff wouldn't boot on it
<geist> so it's always in the same place
<heat> you can move it if you're weird
<heat> there was an old SMM exploit that worked by moving the lapic registers over SMRAM
<karenw> Or you want to break into SMM on old processors.
<karenw> snap
<karenw> God the legacy 8259 pic manual is hard to read. I just want to know what all these registers are in qemu.
<karenw> It's half written for software devs and half for hardware devs
<heat> the 8259 is delightfully old
<heat> you don't actually need to understand it for all intents and purposes
<heat> the PIIX3 or PIIX4 chipset manuals will tell you what values you need to jam in there
<karenw> Wiki just says "Jam these values in" and it seems to make sense
<bslsk05> ​github.com: hsd/usr/sys/stand/pic.c at master · heatd/hsd · GitHub
<SystemPrompt> the way chips from that era works also depends strongly on how they're wired up
<heat> most of those bits are just hardcoded
<SystemPrompt> fun fact: I think I have a tube of 8259 or similar interrupt controllers that were clearance from a local electronics store
<nikolar> nice
<nikolar> send me one or two :P
<SystemPrompt> maybe it was dma controllers or uarts but I remember interrupt controllers
<karenw> `pic0: irr=01 imr=0f isr=00 hprio=0 irq_base=20 rr_sel=1 elcr=00 fnm=0` Why is there an interrupt pending (irr), ah, fugedaboutit.
kfv has joined #osdev
<heat> because you pressed a key
<karenw> I didn't, but I assume that's what the first irq is hooked up to then?
<karenw> No, it's the timer.
<karenw> Which makes sense why I can't clear it then
<SystemPrompt> oh found the invoice in my email, apparently I have just 3 8214 (interrupt controller) not 8259, and 5 8254 timer, and some tubes of something else (possibly shift registers)
<heat> oh right, 1 will be bit 0, i'm dumb
<karenw> Cool, I think that's sucessfully disabled, and I handle any spurious interrupts in the 0x20-0x2F range by sending EOI to either legacy pic if they need it.
kfv has quit [Ping timeout: 264 seconds]
<karenw> If I clear the masks it I seem to be correctly handling the timer interrupt at 0x20, so I think I understand enough to commit and erase the knowledge from my memory ever again.
<heat> of fucking course limine also does SMP
<karenw> Kek
<Ermine> omg
<karenw> Yeah, that seems the least useful request in there. Just like make a kernel already
<nikolar> i mean, initializing smp is hardly something that qualifies you as a kernel
<nikolar> but sure lol
<heat> you definitely want to control SMP
<heat> as a kernel
<nikolar> sure
<nikolar> but initializing is only a small portion of that
<heat> example: linux is parallelizing SMP bringup on x86 because you get big wins on machines with lots of cpus
<karenw> Oh I didn't mean that "initing SMP is all a kernel does", I'm saying it's the responsibility of the kernel, not the bootloader.
<ghoulg> i'm a kernel
heat has quit [Ping timeout: 248 seconds]