<heat>
a *lot* of waiting, and i'm pretty sure a good bit of it is just waiting for the vterm ://
<heat>
(can't be arsed to make an off-cpu one atm)
edr has quit [Quit: Leaving]
<mjg>
do the test i dpasted
<mjg>
i'm bailin'
<heat>
no i'm busy doing more fun stuff
<heat>
important to note that my system sucks harder in some will-it-scales cuz i didn't actually batch LRU yet
PublicWiFi has quit [Server closed connection]
PublicWiFi has joined #osdev
eddof13 has joined #osdev
eddof13 has quit [Ping timeout: 246 seconds]
FreeFull has quit [Server closed connection]
FreeFull has joined #osdev
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
sprock has quit [Ping timeout: 256 seconds]
xvmt has quit [Server closed connection]
xvmt has joined #osdev
sprock has joined #osdev
X-Scale has joined #osdev
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale has joined #osdev
Arthuria has joined #osdev
frkazoid333 has quit [Server closed connection]
foudfou_ has joined #osdev
foudfou has quit [Ping timeout: 260 seconds]
vinleod has joined #osdev
vdamewood has quit [Ping timeout: 260 seconds]
khimaros has quit [Server closed connection]
khimaros has joined #osdev
heat has quit [Ping timeout: 246 seconds]
netbsduser has joined #osdev
Arthuria has quit [Ping timeout: 272 seconds]
vinleod is now known as vdamewood
netbsduser has quit [Ping timeout: 246 seconds]
goliath has joined #osdev
navi has joined #osdev
navi has quit [Ping timeout: 272 seconds]
GeDaMo has joined #osdev
ZipCPU has quit [Server closed connection]
ZipCPU has joined #osdev
<geist>
yes.
smeso has quit [Server closed connection]
smeso has joined #osdev
X-Scale86 has joined #osdev
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale86 has quit [Quit: Client closed]
<kazinsal>
someone on the internet challenged me to write an amd64 emulator that runs on an 8088 and I'm having a very VERY hard time not rising to the obvious nerd sniping bait
<bslsk05>
news.ycombinator.com: Things I learned while writing an x86 emulator (2013) | Hacker News
<GeDaMo>
The link is actually from 2023
<mjg>
oh no
<mjg>
> Most of it totally useless unless you want to write an emulator (which I highly recommend if you ever get the chance).
<mjg>
i get you have a kink mate, but don't recommend it to people ffs :P
<kazinsal>
the idea of emulating an x64 system at like, 30 instructions per second on a 4.77 MHz 8088 intrigues me in the "purely theoretical dumb idea" sense
<vdamewood>
kazinsal: Don't forget working around memory lim its
<vdamewood>
limits
<kazinsal>
but it's up there with "actually make a serious attempt at my hypothetical osdev project" and "quit my job and reinvent space combat MMORPGs"
<mjg>
despite what the osdev wiki used to say there are jobs doing kernel stuff
<kazinsal>
my degree's in the wrong field
<mjg>
and chances are you can get both the weird shit you want *and* get paid to do it
<kazinsal>
but thankfully I'm in a wonderful unionized position with a few people above me who are planning on retiring soon and thus giving me fat promotion tracks
* kazinsal
I will never need to argue for raises ever again and can write off many thousands of dollars on my taxes until I retire
<kazinsal>
so I can just eventually go back to doing weird kernel shit for fun
<bslsk05>
'Flea86 PC board running Windows 3.0' by dosgamer74 (00:03:33)
vdamewood has quit [Quit: Life beckons]
<kazinsal>
my longstanding april fools osdev joke idea was to reimplement one of the early C versions of research unix for the 5150, as a pastiche of the dozens of early partial reimplementations of unix that were posted to the osdev forums over the years and then immediately abandoned
<kazinsal>
but it feels kind of pointless now that nobody seems to have any sort of control or ownership of the forums and wiki
Left_Turn has joined #osdev
<Mondenkind>
'30 instructions per second' nahhh i bet you can do more than that
<Mondenkind>
only one way to find out though~
<kazinsal>
someone uploaded a new forums theme a while back but apart from that the forums are basically abandoned
<kazinsal>
chase used to check in a couple times a year but now no one has sudo perms on the server
<kazinsal>
so I expect osdev dot org will disappear when his credit card expires
<Mondenkind>
:\
<adder>
I'm trying to iterate over multiboot mmap and map those ranges before going long, but I'm getting these pretty pics instead of output: https://imgur.com/uZN7xty.png
<bslsk05>
imgur.com <no title>
<kazinsal>
I logged into the forums to check and apparently a month ago chase just gave everyone with a higher post count than him moderator permissions.
<kazinsal>
I believe the kids would call this a big yikes
<adder>
I'd guess somehow VGA buffer ends up fucked up but how?
<adder>
I even have a check if address is lower than 1MB then not map it
<zid>
and where did you write those mappings to?
<zid>
Looks like you picked b8000 to have a page table on it, visually :P
<adder>
hey zid
<adder>
hope ya don't mind, I'm using your bootstrap example as a reference
<adder>
I'm pretty much following along, I have code up on github if you wanna look?
<bslsk05>
github.com: rpi-open-firmware/firmware/linker.ld at master · librerpi/rpi-open-firmware · GitHub
<ddevault>
anyone happen to have the ARMv7 ABI specification handy
<clever>
adder: one example, where its using math in the linker script, to just put it at the top of ram
<clever>
ah, the other examples i had, do the same thing
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 268 seconds]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
navi has joined #osdev
navi has quit [Ping timeout: 246 seconds]
navi has joined #osdev
gsekulski has quit [Remote host closed the connection]
rustyy has quit [Ping timeout: 272 seconds]
exit70 has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
exit70 has joined #osdev
rustyy has joined #osdev
<adder>
I'm not sure how to align what goes into CR3
<Mutabah>
In what way?
<Mutabah>
Just allocate a 4KB aligned piece of memory (e.g. at link time, or with your page frame allocator)
<adder>
Mutabah, can you show me how? no matter what I do, it ends up something like CR3=00105868
<adder>
wait, that's aligned?
<Mutabah>
It's worth noting that there are flag bits in there - although, I think most are writable
<Mutabah>
How are you setting it? and how is that value generated?
<adder>
so I have struct page_table *pml4; as a global variable, and then when I call asm routine to transition into long mode, I pass (uintptr_t)pml4
<Mutabah>
and how is `pml4` set?
<adder>
minor correction... I realized I was passing a pointer-to-pointer, now when I just pass a pointer directly I'm seeing CR3=00004000
<Mutabah>
(also, that's a logical/linear address - not a physical one, that's only correct _before_ paging is enabled)
<adder>
pml4 is alloc'd
<Mutabah>
I assume you've found your bug?, now that you have an aligned value
<adder>
well, almost, still getting a page fault
<Mutabah>
is the contents of PML4 valid?
<adder>
wait... need to debug
<Mutabah>
And you need to ensure that the code you're currently running is still mapped in this new address space
frkazoid333 has joined #osdev
navi has quit [Quit: WeeChat 4.2.1]
goliath has quit [Quit: SIGSEGV]
hwpplayer1 has joined #osdev
navi has joined #osdev
heat has joined #osdev
Terlisimo has quit [Quit: Connection reset by beer]
navi has quit [Ping timeout: 260 seconds]
Terlisimo has joined #osdev
qubasa has joined #osdev
Arthuria has joined #osdev
nur has joined #osdev
joe9 has joined #osdev
<kof673>
> for the 5150 i notice openwatcom says it can generate i86 code, but seems to be missing library functions (unless this is just the way linux binaries were built, or maybe was never "fixed" when it went "open") :/ so possibly it still can, but is perhaps "freestanding"
<kof673>
i also notice it needs target specified for both compiling and linking...else like smallerc, it will just output elf even if you specified the compiling target otherwise lol the latter only, unrecognized objects lol
X-Scale has quit [Ping timeout: 250 seconds]
josuedhg has joined #osdev
netbsduser has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
goliath has joined #osdev
[Kalisto]8 has joined #osdev
[Kalisto]8 is now known as [Kalisto]
[Kalisto] has quit [Ping timeout: 246 seconds]
Gooberpatrol66 has quit [Ping timeout: 268 seconds]
hwpplayer1 has quit [Quit: I'll be back later]
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
navi has joined #osdev
Gooberpatrol66 has joined #osdev
qubasa has quit [Remote host closed the connection]
xenos1984 has quit [Ping timeout: 268 seconds]
<nikolapdp>
KERNAL
<heat>
kern
<mjg>
uts
<nikolapdp>
krnl
SGautam has joined #osdev
<SGautam>
So I've a problem, for some reason INT 1Ah, AH=00h seems to misbehave in both BOCHS and QEMU
<SGautam>
Sometimes I get the value of ticks in DX, but other times, I simply get 0.
<SGautam>
I'm not sure what could cause it.
<Ermine>
k
<heat>
korn
<SGautam>
kornography?
<Ermine>
SGautam: I think it's seabios issue
<SGautam>
hmm
<SGautam>
BOCHS uses SeaBIOS as well?
<heat>
probably yeah
<Ermine>
idk about bochs, but qemu definitely uses it
<netbsduser>
i would've thought bochs would've invented their own
<netbsduser>
seabios seems to be very new
<netbsduser>
only invented in 2008
xenos1984 has joined #osdev
<heat>
who the heck uses bochs anyway
<netbsduser>
it's everywhere in old posts on the osdev forums
<netbsduser>
i think it was once regarded as excellent in debuggability
<netbsduser>
now QEMU has that really useful GDB remote server built in
<SGautam>
Yep, even in 2016 it was the standard go to. QEMU was looked down upon.
<heat>
no it wasn't?
<heat>
some randos thought bochs was great, but the vast majority of people used qemu
<SGautam>
if u used bochs u were part of the cool kids club or something
<SGautam>
i guess it was a small community
<heat>
the only thing bochs gives you is more info if basic x86 stuff goes wrong
<heat>
like, you get a bad segment GPF and it tells you why, exactly, in a log
<SGautam>
Yep the console really helps in debugging GDT/IDT faults
<heat>
but this is the sort of hello world exceptions that go away quickly
<SGautam>
not if you're starting out sir
<heat>
>that go away quickly
<SGautam>
I recall debugging GDT faults for days at one point
<SGautam>
more often than not
<SGautam>
a basic course in boolean mathematics and bitwise manipulations is required before osdeving tbh.
<heat>
no?
<SGautam>
i sort of realised this when x86 docs started making more sense when I understood bitwise math
<heat>
bit goes 1, bit goes 0. or, and, xor
<heat>
no need for any course in mathematics lol
<SGautam>
boolean mathematics is that lol
<SGautam>
heat: I used to be that guy reading MUL docs when I wanted to multiply a number by 2 in asm
<heat>
thats ok i don't know how to multiply numbers in x86 asm either
<heat>
you have mul and imul i think? one of those is good, the other is bad
<heat>
might be imul
<SGautam>
nah bruh
<SGautam>
shl ax, 2
<SGautam>
*shl ax, 1 -- actually
<SGautam>
that blew my mind when I first realised it
<heat>
wonderful obfuscation
<heat>
so wonderful you fucked it up
<GeDaMo>
Uh, you can use add to multiply by 2 :|
gog has joined #osdev
<SGautam>
ah yea
<heat>
shl will be faster
<Ermine>
maybe bochs is MINIMAL?
<SGautam>
no way
<heat>
bochs is definitely MINIMAL
<Ermine>
hah
<SGautam>
its a bit of pain to set up
<SGautam>
you need a bochsrc
<heat>
so MINIMAL it's garbage, as the s6 fans would like it
<SGautam>
than just firing up qemu with args
<heat>
ideally bochs would have PIPES
<Ermine>
R you trying to trigger me?
<heat>
yes
<Ermine>
mofo
<heat>
mofer*
<Ermine>
ok mofer
<heat>
think about it, an x86 emulator but every instruction spawns a separate process and pipes the result back
<heat>
i love it
<heat>
but now the separate process is a POSIX sh script running on busybox ash
<Ermine>
s6 fans use execline you know
navi has quit [Ping timeout: 246 seconds]
spare has quit [Remote host closed the connection]
op has joined #osdev
<heat>
gog
<gog>
heat
<kof673>
bochs i thought was c++...qemu ...i don't recall
<kof673>
this is not a criticism, just what is needed to build...
xvmt has quit [Ping timeout: 252 seconds]
xvmt has joined #osdev
<heat>
gog, do you have that dawg in you
<gog>
can i pet that dawg
<gog>
can i pet that daaaaaaawwwg
navi has joined #osdev
<mjg>
you ok fellaz
<heat>
do you have that dawg in you
<nikolapdp>
> an x86 emulator but every instruction spawns a separate process
<nikolapdp>
there was a guy who wrote a cloud native gameboy emulator
<bslsk05>
blog.davetcode.co.uk: Bringing emulation into the 21st century - David Tyler's Blog
<heat>
every instruction is a file
<heat>
registers are files
<nikolapdp>
wasn't a gameboy actually
X-Scale has joined #osdev
JerryXia1 has quit [Server closed connection]
JerryXiao has joined #osdev
Bonstra_ has quit [Server closed connection]
Bonstra has joined #osdev
navi has quit [Ping timeout: 260 seconds]
<kof673>
well minus the cloud part it was inevitable, it is just unix shell/pipeline model, each process does "one thing." conversely, bash/etc. added more built-ins, i.e. part of the same process.
<kof673>
juts different levels of granularity lol
navi has joined #osdev
joe9 has quit [Quit: leaving]
Jari-- has joined #osdev
<Jari-->
Hi, which OSDEV book to buy if wanting to do application module for the kernel, and trim the memory management?
<Jari-->
I had an application module before, but I am rewriting it
X-Scale has quit [Ping timeout: 250 seconds]
<Jari-->
Operating System Design and Implementation (3rd Edition) by Andrew S. Tanenbaum? good?
X-Scale has joined #osdev
gbowne1 has joined #osdev
op has quit [Remote host closed the connection]
<Ermine>
Jari--: so you need to implement a linux kernel module? You can look at LDD3 book, though it's outdated. And you'll need to study kernel documentation
<Ermine>
Tanenbaum's book is about development of operating systems with minix 3 as an example. It won't teach you writing kernel modules
<Jari-->
Ermine I missed DJGPP, so I wrote lots of DOS compatibility, too, BTW
<heat>
it's about minix 3?? i'm afraid it won't teach you anything :(
<Ermine>
it will
<Ermine>
it contains some generic stuff
<heat>
the author of minix writing a book about operating systems is like theo deraadt writing a book about social norms
<heat>
change my mind
<Ermine>
you can discuss paging in os-independent way for example
<Ermine>
that there are pages, there's how processor translates virtual addresses into physical, there is a TLB
<Ermine>
that sort of things
<heat>
does it ramble about pessimality and crapper code for 300 pages
<heat>
if not, pessimal bok
<heat>
book
<mjg>
the only sensible book describes a shit idea
<mjg>
then a less shit idea and claims genius
<Ermine>
and theo can write that it is social norm to be cisgender, but many, including me, will disagree
<mjg>
anything short of that is not worh reading
<netbsduser>
Ermine: de Raadt doesn't write anything about cisgenderism
<Ermine>
netbsduser: it's nice, isn't it?
<netbsduser>
Ermine: yes, i don't think there is any evidence to suggest de Raadt is bigoted about anything other than anything that isn't under the BSD licence
<heat>
theo is bigoted about other people in general
<Ermine>
netbsduser: I've got a feeling that he can spew bigotry while reading some mails from openbsd ml. But, indeed, these's no hard evidence
<heat>
'ate the freebsd, 'ate the netbsd, 'ate the linox, luv me openbsd, simple 'as
<heat>
Ermine, also worth noting that you'd probably get the same vibe from linus but he's clearly not a bigot
<Ermine>
heat: yeah, as far as pre-2018 linus is concerned
qookie has quit [Server closed connection]
<gimli>
that guys doug16k is not here anymore right?
<gimli>
s/guys/guy
<GeDaMo>
Haven't seen him for a while
<kof673>
he was sort of in other channels ....within the past year or two maybe...
SGautam has quit [Quit: Connection closed for inactivity]
<chiselfuse>
i am trying to understand segments and ldt but i can't find a way to experiment with them on linux. i thought i could step through a process in gdb and print the ldt. i also looked in ida and didn't find anything. do i patch the program memory with a sequence of instructions that syscall modify_ldt(2) in order to check it? is there a simpler way to examine this structure for a running process?
qookie has joined #osdev
<Ermine>
better write some assembly which tweaks ldt and run it in qemu
goliath has quit [Quit: SIGSEGV]
<netbsduser>
i'm still stunned openbsd has an rcu-ish thing now
<Ermine>
And nowadays it's not really a useful knowledge, since everyone uses paging
<netbsduser>
quite
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
<zid>
you can mess with the ldt with syscalls in linux userspace
<chiselfuse>
i can't figure how FS and ldt is used in threads in linux. does each thread have a different ldt? i checked FS and it seems like it's the same for each thread so i assume each must have a different ldt
<zid>
idk why you'd want to, but you can!
<Ermine>
ldt is unused
<chiselfuse>
zid: yea i found modify_ldt(2)
<zid>
Linux allows processes to configure
<zid>
a per-process (actually per-mm) LDT.
<zid>
it's not per thread
<chiselfuse>
zid: what's 'mm'?
<zid>
no idea, but it isn't a thread
<blockhead>
mickey mouse
<chiselfuse>
Ermine: but i read that FS must point to a different point for each thread so that they can use it to access local variables at different offsets
<bslsk05>
docs.kernel.org: 29.8. Using FS and GS segments in user space applications — The Linux Kernel documentation
<chiselfuse>
Ermine: 29.8.1 specifically
<zid>
are fsbase and gsbase in x86
<zid>
I never did much x86, only amd64
<zid>
anyway, WRFSBASE
<chiselfuse>
zid: yea they're the only ones allowed to have non-zero base address in their descriptors. all other segment registers are forced to zero AFAIU
<zid>
is how you do it, fs just needs to contain a valid *descriptor*, it doesn't actually hold the real base address that [fs:...] uses
<chiselfuse>
zid: okay but this doesn't answer my question. i want to know whether each thread has a different value of FS (apparently not after i checked in debugger), and that since they're the same value, whether that implies that each thread has a different LDT so that they may provide a different base for each thread so that they don't write over each others' local variables
<zid>
no, they all use the same fs value
vdamewood has joined #osdev
<zid>
the base is *independent* to the selector, as I mentioned
<Ermine>
chiselfuse: you can use arch_prctl call as described in that page
<zid>
the base just has to not be invalid wrt to the selector, I think. And most people just.. set the selectors up for 0-4GB range anyway
<chiselfuse>
zid: so you say that they have the same FS but that the base address is different in the selector for each thread, ie that each thread has a different segment selector pointed to by the same FS, and since that selector is part of the LDT, that each thread has its own LDT
<chiselfuse>
oh wait you said the base is independent to the *selector*
<zid>
same segement selector
<zid>
different *completely seperate*, weirdly set with a special opcode, base
<chiselfuse>
i thought the segment selector contained the base address
<zid>
it does, for what addresses are valid
<zid>
but not the actual base address used by the *addressing*
<gimli>
kof673: which channles?
<zid>
do you know the 16bit segmentation scheme? it's kind of a weird mix of that, and pmode segmentation
<zid>
fs and gs act like 16bit segmentation, where they contain a base address which is added to the pointers that use that selector, but it also has a pmode style selector which does range checking
<gcoakes>
Could someone help me to understand the available options for pivoting execution from physical memory to virtual memory for a kernel? I've been reading up on some of the different methods used, and I'm either misunderstanding it or dissatisfied with the status quo. As I understand it, you can either:
<gcoakes>
- Write your pre-MMU code in architecture specific assembly and your kernel is linked as if it runs from virtual memory. (Linux, I think)
<gcoakes>
- Compile two different artifacts which are linked for (1) physical memory and (2) virtual memory. Then, you embed #2 within #1. (seL4 elfloader)
<zid>
not sure what assembly has to do with it
<zid>
but either way you need a page you know the address of, which contains the 'switch the mmu on' code, which is identity mapped, and another, virtual map of everything
<gcoakes>
Well, I guess you write the pre-MMU code in such a way that no pointers leak past the MMU enable barrier.
<zid>
You need that identity mapped page, else the instruction that switches virtual memory on will stop having a valid instruction pointer underneath it at the moment you switch
<zid>
you can unmap it after
<zid>
(and you will want to, lest you have a small hole in the low addresses)
<chiselfuse>
zid: [this](https://wiki.osdev.org/Segment_Selector) structure is one of the entries in the LDT, right? if FS is 3, then it refers to LDTR+(16*3). the base address [3-15] in this entry is the base address. so if i see an instruction `mov rax [fs:0xA]` that gets executed by multiple threads, they'll be adding 0xA to the same base address (specified in that entry). so how is it that they end up with
<bslsk05>
wiki.osdev.org: Just a moment...
<chiselfuse>
separate local variables?
<zid>
am I reddit now
<zid>
chiselfuse: again, that is for the *range checking*
<zid>
the address calculation is fsbase+offset
<zid>
checked against selector.base - selector.base+selector.limit
<chiselfuse>
and what's fsbase? a completely different register than FS or what?
<zid>
yes!
<zid>
21:46] <zid> different *completely seperate*, weirdly set with a special opcode, base
<chiselfuse>
hmm i'm reading that they're originially supposed to be caches for the base,limit in the ldt
<kof673>
gimli, i think there is a #dos, i say "sort of" because other side of bridge, may be named differently here :D doesn't irc have whois or something? maybe people can be "invisible" to hide though (and hide channels)
<kof673>
IIRC he has github, should not be impossible to find
<kof673>
some "old" channel anyways, whatever it was :D
<heat>
chiselfuse, an 'mm' = address space
<heat>
gcoakes, linux's pre-mmu code is not written in assembly but generally careful C
<heat>
it's a risky business to write position-independent C, but it usually works fine if you know what you're doing
<kof673>
maybe an asm or hw channel, i don't keep logs :D
<netbsduser>
i love that linux terminology
<heat>
it comes from mm_struct fwiw
<netbsduser>
address spaces are mms and vm objects are address spaces
<heat>
to be fair, vm objects are also a garbage name
<netbsduser>
what's wrong with them?
<heat>
it's a horrendously vague undescriptive name
<netbsduser>
it seems to be descriptive to me
<heat>
what's a "vm object"? object in the vm system? what does this object do?
<netbsduser>
in any case it's traditional and accepted
<heat>
it really is a terrible name. alas mach came up with it and now we're stuck with that in a bunch of systems
<netbsduser>
in mach it has a subtly different purpose and the combination of memory objects and vm objects match more closely how vm objects are understood today, but it's close enough
<netbsduser>
i would accept segment as well
<netbsduser>
though i might prefer segment to denote the map entry rather than the object mapped
<gcoakes>
@heat, I think I was incorrectly generalizing RISC-V to all of Linux's bootstrap. I was reading through `arch/riscv/kernel/head.S` which seems to be where the initial switch happens.
<heat>
vm_mappable? or maybe just struct pagecache :^)
<gcoakes>
I really just grep'ed for satp register. I don't even really know how head.S fits into the overall build.
xenos1984 has quit [Read error: Connection reset by peer]
<netbsduser>
gcoakes: to your question about transitioning from physical to virtual addressing, i see it as a bootloader duty
<netbsduser>
on amd64 limine does it for me and on m68k (qemu virt and amiga) i do it myself in a minimal loader
Gooberpatrol66 has quit [Ping timeout: 256 seconds]
<netbsduser>
since i only deal with it on the m68k i just enable a transparent translation region for the lower half of the address space and in the kernel i make away with that
<gcoakes>
I've used it for years but never quite understood the purpose of the bootloader to this level. So, when GRUB or similar hands over control to Linux, is the MMU typically enabled?
<heat>
this is where linux does early page table init for riscv
<heat>
gcoakes, no, that's not how bootloaders usually work
<heat>
at least on the UNIX/linux side
<netbsduser>
grub doesn't do it, multiboot is a more basic protocol
op has joined #osdev
xenos1984 has joined #osdev
heat has quit [Remote host closed the connection]
heat_ has joined #osdev
<Jari-->
ppl apparently have problems with grub, it has bugs
<heat_>
grub has never had bugs no sir never nuh uh
<chiselfuse>
what does segment_selector.rpl=3 do?
<heat_>
changes your ring level
<chiselfuse>
isn't it only valid from 0-2? what's 3?
<heat_>
ring 3...?
<mjg>
let me tell what's not going to have bugs: the in-kernel grub replacfement
<Jari-->
chiselfuse RPL is the field you're specifically asking about. It is a 2-bit field representing the privilege level of the code that is using the segment selector. The possible values are: 0: Ring 0 (highest privilege), 1: Ring 1, 2: Ring 2, 3: Ring 3 (lowest privilege)
<chiselfuse>
oh nvm i thought there were only 3 rings not 4
<zid>
What *is* 3?
<zid>
you thought ring3 was ring numerical 2?
<zid>
good thing about binary is that you get a fourth for FREE
<zid>
because otherwise you're just wasting the 0b11 encoding
<chiselfuse>
zid> you thought ring3 was ring numerical 2?
<chiselfuse>
yea lol
<Jari-->
just run the shit in root level
<Jari-->
add features later :)
<heat_>
linus torvalds vs andrew tannenbaum, colorized
<zid>
Everybody asks what is three, but nobody ever asks HOW is three? :(
<chiselfuse>
king terry
* kof673
inserts terrance howard joke
<Jari-->
and the order matters? I think not. You can have Ring0 as an application mode processes, if you want? not?
<Jari-->
chiselfuse so basically it is just an order number, it can be set as anything you want it to be
<chiselfuse>
huh?
netbsduser has quit [Ping timeout: 246 seconds]
Pixi has quit [Quit: Leaving]
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Gooberpatrol66 has joined #osdev
<adder>
I need help figuring out why I'm getting a page fault. when I grep for exceptions, I see (old, new) = {(0xffffffff, 0xe), (0xe, 0xd), (0x8, 0xd)} (which kind of doesn't make sense to me). these are my control registers `CR0=80010011 CR2=0000000000000024 CR3=0000000000111000 CR4=000000a0` I tried disassembling address in CR2 to see what is causing the fault but no luck, out of bounds / no function contains that address
<adder>
thoughts?
<heat_>
you're trying to access 0x24 but it's unmapped
<adder>
just one sec... I am compiling the whole thing in a really weird way
<heat_>
and then what looks like subsequently faulting for related/unrelated corruption
<adder>
how am I supposed to compile this?
<heat_>
this = what?
<adder>
like I have a sprinkle of .code64
<adder>
and then I have a x86_64 kernel
<adder>
and using my 32-bit cross compiler gets me in all kinds of issues
<adder>
so I'm using -fPIC
<adder>
(no idea what that is)
<heat_>
obviously if its a x86_64 kernel you can't use your 32-bit cross compiler
<adder>
do I need two compilers?
<heat_>
you need a single x86_64-elf compiler
<adder>
yeah but one for the bootloader?
<heat_>
why do you have a bootloader?
<heat_>
and in any case x86_64-elf with -m32 should probably work
<adder>
wdym why do I have a bootloader? genuine question
<heat_>
are you not using grub?
<adder>
yeah I am
<heat_>
or limite or whatever
<heat_>
well, then that's the bootloader
<adder>
by bootloader I meant the part the inits idt,gdt,remaps pic, transitions into long, and transfers control to kernel
<heat_>
that's not how things are usually done
<heat_>
usually it's all a single kernel, a very very minimal bit in 32-bit that bootstraps you up to long mode. idt, gdt, pic, whatever are all post-long-mode