<Mutabah>
Once you're in protected mode, assume the firmware is unusable
<Mutabah>
Although, you _can_ use vm8086 mode (or an emulator) to call back into the BIOS...
<Mutabah>
But best option is to ask grub to set a sensible graphics mode and use that
agent314 has joined #osdev
<pm123123123>
is it 32bit or 32bit protected when kernel takes over?
<Mutabah>
32-bit mode is protected mode
<Mutabah>
(but not all protected modes are 32-bit)
<pm123123123>
the back story is this: i'm reading a book which has assembly code for bootloader in the first few chapters. (one of the code repo is this: https://github.com/imangoa/os)
<bslsk05>
www.gnu.org: Multiboot2 Specification version 2.0
<GreaseMonkey>
welp, that was fun, managed to make a filesystem and a bootloader for it in a single day, it is not fast by any means but it's simple enough for making a bootloader and you can get free deduplication with it
dodoma has joined #osdev
* kof123
.oO( beetlejuiceos that just consists of grub modules )
<GreaseMonkey>
if you're looking for mode 13h you can either set up a V8086 monitor or you can look up how one fills in the registers, there's some cheeky stuff you can do with some mode-setting tables provided by the BIOS
xenos1984 has quit [Read error: Connection reset by peer]
<geistvax>
oh woot, sounds great
<GreaseMonkey>
or maybe jumping out of pmode and back in
<GreaseMonkey>
also if you're wondering where those tables are, look up M004000A8 (0040:00A8) in Ralf Brown's Interrupt List, file MEMORY.LST
<pm123123123>
i add the frambuffer tag https://pastebin.com/j8xdy2Lv but now get this error "need to load kernel first. unknown tag 8"
<GreaseMonkey>
the Video Parameter Table is the main thing you'd want to use, just be aware that in order to write most of the bits in CRTC registers 0x00 through 0x07 both inclusive, you need to clear i think the msbit of CRTC register 0x11
<pm123123123>
i follow that tutorial and use grub-mkrescue than qemu -kernel to boot. multiboot2 is fine.
<zid>
grats?
stolen has joined #osdev
<pm123123123>
qemu -kernel boot does not work it gives me 'error loading uncompressed kernel without PVH ELF note'
gog has quit [Quit: Konversation terminated!]
<zid>
yea, qemu doesn't support multiboot2
<zid>
the error message is weird, it's because it checks for multiboot, and if it doesn't find it it checks for pvh, then errors
bauen1 has quit [Ping timeout: 264 seconds]
bauen1 has joined #osdev
xenos1984 has quit [Ping timeout: 264 seconds]
xenos1984 has joined #osdev
<pm123123123>
i followed this: an iso made by grub-mkrescue of multiboot2 kernel and grub.cfg. qemu has no trouble booting it. https://os.phil-opp.com/multiboot-kernel/
<bslsk05>
os.phil-opp.com: A minimal Multiboot Kernel | Writing an OS in Rust (First Edition)
mahk has quit [Ping timeout: 260 seconds]
mantahydra1 has joined #osdev
gog has joined #osdev
zxrom has quit [Quit: Leaving]
bauen1 has quit [Ping timeout: 260 seconds]
goliath has joined #osdev
xenos1984 has quit [Ping timeout: 264 seconds]
xenos1984 has joined #osdev
zxrom has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
yoo has joined #osdev
netbsduser has joined #osdev
stolen has quit [Quit: Connection closed for inactivity]
<Ermine>
what's the difference between arm-none-eabi and arm-arm-none-eabi ?
<GeDaMo>
arm / aarch64?
<clever>
GeDaMo: both appear to be 32bit
<Ermine>
no, both are 32bit arms
<Ermine>
first is also apparently known as arm-none-unknown-eabi
<bslsk05>
web.archive.org: What's the difference between arm-linux- / arm-... | NXP Community
solaare has joined #osdev
<Ermine>
so, arm-arm- is for cores made by arm (cortex), and arm- is for everyone else?
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
<gog>
hi
<gog>
arm-arm-arm-
aejsmith has quit [Remote host closed the connection]
aejsmith has joined #osdev
stolen has joined #osdev
gbowne1 has joined #osdev
gog has quit [Ping timeout: 252 seconds]
solaare has quit [Remote host closed the connection]
solaare has joined #osdev
<sbalmos>
arm-leg-none-abba
bauen1 has joined #osdev
rpnx has joined #osdev
yoo has quit [Ping timeout: 252 seconds]
rpnx has quit [Ping timeout: 245 seconds]
<epony>
the floppy head arm will break in minutes if you use 3D printed weak plastic designed to model grandma dentures
<epony>
get realistic
<epony>
you can forget about 3D printed floppytron and you're never going to achieve the floppinator either that way
<epony>
the special kids corner of computing ;-)
<epony>
what you can do is, use the printed plastic as a crude prototype to cast ceramics around it, and evaporate your fake plastic then, so you can pour malten metal into it and see how far you go
<epony>
into milling it later with precision high RPM drill bits
* epony
throughs your 3D printer in the garbage
<epony>
this is the magnetopic head, and this is the programming manual for the drive
<bslsk05>
queue.acm.org: How to Design an ISA - ACM Queue
<Ermine>
nortti: time for leg architecture?
* epony
facepalms nortti "well done", now bring me a reconfigurable computing FPGA lattice
* geist
yawns
* sham1
pitches
gog has joined #osdev
* Mondenkind
rolls
senku has quit [Quit: leaving]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
gabi-250_ has quit [Remote host closed the connection]
gabi-250_ has joined #osdev
<GreaseMonkey>
"'error loading uncompressed kernel without PVH ELF note" <-- this is a known problem, you basically have to tell QEMU to use a machine type where it doesn't make that complaint
<GreaseMonkey>
...wait, for some reason the default's working on my multiboot 1 kernel
<heat_>
"'error loading uncompressed kernel without PVH ELF note"
<heat_>
this means your kernel isn't a valid multiboot image
<GreaseMonkey>
i was getting that error mixed up with a different error
<GreaseMonkey>
and yeah usually it means that you're using multiboot 2 instead of using multiboot 1
<heat_>
also I vaguely recall qemu got multiboot2 support
<GreaseMonkey>
huh, when abouts?
<heat_>
i don't know, i could be wrong though
<gog>
hi
<klange>
qemu does not have multiboot2 support
<heat_>
GOG
<gog>
heat
<heat_>
thanks klange
<heat_>
i am a dirty liar
<heat_>
funnily enough kexec has multiboot 1 and 2 support
<klange>
I had a partially working demo, but it would not have been suitable for upstreaming
<heat_>
partially working is around as much QA GRUB gets
<heat_>
so ship it
<heat_>
i need to implement the linux x86 boot protocol one of these days
<heat_>
partly because i don't trust multiboot 2, partly because i don't trust GRUB, and partly because linux's x86 boot protocol has more features (and cruft)
<pm123123123>
qemu supports multiboot2 just fine per the tutorial and my testing
<bslsk05>
os.phil-opp.com: A minimal Multiboot Kernel | Writing an OS in Rust (First Edition)
<heat_>
oh, to be clear, we're talking about doing stuff like "qemu-system-x86_64 -kernel <multiboot2 img>"
<heat_>
anything else is /mostly/ irrelevant
<klange>
that is not at all qemu supporting multiboot 2, that is grub supporting multiboot 2
<pm123123123>
yeah i gotcha now
<epony>
clean lies are still incorrect
<pm123123123>
any advice on how to change diisplay to 320x200x8 when kernel loads?
<geist>
oh speaking of partially working qemu, if any of you is doing work with riscv on qemu you'll want to upgrade to 8.2.0
<epony>
machine independent separation with machne dependet allows for more efficent programming
<geist>
it fixes a fairly major bug that we were seeing on fuchsia a lot
<geist>
and ended up being some subtle coherency issue
<geist>
i dont have the fix link, but was some sort of memory barrier like issue
<geist>
between the TCG threads i think
<epony>
applies to compilers and language / libraries, architectures and machine programming, boot and initialisation in general, and emulators and simulations in general
<heat_>
pm123123123, why that specific resolution?
<epony>
clean machine and boot programming separation is replicating the machine physics, not "what I want to mix and match"
<Ermine>
heat_: funnily enough kexec has multiboot 1 and 2 support <-- kexec("vmonyx")
<heat_>
320x200x8 is a horrible tiny res
<heat_>
anyway don't bother with changing resolutions for now
<Ermine>
320x240 was one of my pre-android phones
<heat_>
Ermine, yeah it's possible that works, IIRC I tried it and it crashed on my end (but maybe PEBKAC)
<pm123123123>
just need to know how to change. which api/interrupt call to use etc....
<heat_>
you don't have one
<klange>
Mode setting is a ridiculously complicated subject.
<heat_>
the best bet is to ask whatever is loading you to do it first
<Ermine>
multiboot bootloader gets you to the protected mode iirc
<pm123123123>
in this case grub. i try adding a framebuffer tag to multiboot2. didnt help
<epony>
it should have been simplified but graphics proprieatary chipsets are a punishment to all
<heat_>
then you did it wrong
<pm123123123>
qemu's gpu should be open, right?
<heat_>
because it certainly works here
<heat_>
yeah that'll work
<Ermine>
Protected mode disables the easiest way to set mode, namely VESA interrupts
<heat_>
see bochsvga
<klange>
qemu does not emulate a gpu by default, but that's a pedantic note
<Ermine>
-graphics qxl
<heat_>
aktshually it's called a display adapter🤓
<pm123123123>
ok.. display adapter...
<pm123123123>
right way to change resolution, how? multiboot2 tag?
<Ermine>
yes
<klange>
modesetting the bochs virtual display adapter is fairly straightforward, but relying on the ability to modeset yourself at runtime (after boot) will lead to issues
<bslsk05>
github.com: Onyx/scripts/iso.sh at master · heatd/Onyx · GitHub
<heat_>
(ignore insmod xzio, that's unrelated)
<pm123123123>
so i up the resolution to 1024x768x32 as the one heat_ points
<pm123123123>
got error "unsupported tag: 0x8"
<klange>
Your tags are misaligned.
<klange>
Note how heat_'s link a few minutes ago has those ".align 8" directives before each multiboot tag.
<geist>
hmm, i dont see on the qemu 8.2 release page the fix
<geist>
though there are lots of little riscv bugfixes
yoo has joined #osdev
<pm123123123>
klange: so i combine two dw into one dd and still same error. note if i take out the framebuffer tag then it's fine
<pm123123123>
can this still be an alignment issue?
<pm123123123>
i tried grub.cfg as well. no luck.
<pm123123123>
let me try again. perhaps it's the order of statements
<klange>
every tag needs to start on an 8 byte alignment; the framebuffer tag is not a multiple of 8 bytes long, so when you have it there without forcing alignment of your end tag, grub skips right past the 4 bytes of zeros in the end tag and arrives at the 8 from its size and thinks that's the type of a new tag
<heat_>
combining two dw into one dd makes no difference
<pm123123123>
i read somewhere it's gfxmode not gfxpayload
<zid>
I like how heat, 20 mins after I said it, repeated everything I said, but wrong :P
<Ermine>
btw, as we are speaking of assembly
<klange>
> 20 mins
<klange>
you mean 4 hours?
<Ermine>
gas doesn't like ".section .stack, " wa", @nobits
<klange>
gfxmode tells grub what resolution _it_ should use
<Ermine>
Namely it complains at ", @nobits" part
<klange>
gfxpayload tells grub what mode it should for the thing its loading
<klange>
you can set gfxpayload=keep to use whatever mode grub itself was running in
<heat_>
Ermine, works here
<heat_>
Ermine, oh, i know what's wrong, you have an extra space in the "wa" string
<Ermine>
it's in message
<Ermine>
its ok in file
<klange>
Just to check, are you building an ELF? gas may not support that stuff for other formats
<pm123123123>
klange: yes ELF. i'm basically trying to combine two projects as i study.
stolen has quit [Quit: Connection closed for inactivity]
netbsduser has joined #osdev
<pm123123123>
i use win11 host and archlinux guest. the guest vm can resize almost at will. seemingly so easy. i expected easy code to change resolution
netbsduser has quit [Ping timeout: 252 seconds]
<Ermine>
klange: yes, this is elf
<heat_>
Ermine, link the whole file
<Ermine>
pm123123123: the way linux changes mode is extremely nontrivial
<klange>
vms are special; if you only care about changing resolutions in a vm, then modesetting is very easy
<heat_>
mjg, mcrod just found out about zero cost logging
<bslsk05>
wiki.osdev.org: VMWare SVGA-II - OSDev Wiki
<heat>
mcrod, i have a really fun hack you could try out for the shits and giggles
<heat>
for near-zero-cost logging
<klange>
virtualbox and bochs implementing the io port interfaces for the bochs "card", qemu implements an mmio-mapped version
<klange>
what these all have in common that is absolutely nothing like how real modesetting works is that you just say "I want this width and height and bit depth" and the VM says "you betcha, have fun"
<heat>
hey google, what's a phase-locked-loop
<sortie>
heat, hi heat, please ask during biznizz ours
<sortie>
klange, yeah those BGA modesettings are so easy and fun. A bit of a shame qemu doesn't implement the auto scaling as well as virtualbox. Hey did you ever play with virtio graphics?