9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] boot/efi: support framebuffer with 64-bit base address
@ 2021-02-18  8:58 Michael Forney
  2021-02-18 20:23 ` [9front] " Anthony Martin
  2021-02-20 11:56 ` [9front] " cinap_lenrek
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Forney @ 2021-02-18  8:58 UTC (permalink / raw)
  To: 9front


My thinkpad t14 (amd) uses a framebuffer at 0x460000000, which got
truncated to 0x60000000 in *bootscreen.

diff a93cbc303473d336ddd224ac6198bf4499a181b8 e7f36397ace2aaaf16a643080dcc439c5b061613
--- a/sys/src/boot/efi/sub.c	Tue Feb 16 15:51:37 2021
+++ b/sys/src/boot/efi/sub.c	Thu Feb 18 00:58:35 2021
@@ -306,8 +306,8 @@
 char*
 hexfmt(char *s, int i, uvlong a)
 {
-	if(i > 8){
-		s = numfmt(s, 16, i-8, a>>32);
+	if(i > 8 || i == 0 && (a>>32) != 0){
+		s = numfmt(s, 16, i ? i-8 : 0, a>>32);
 		i = 8;
 	}
 	return numfmt(s, 16, i, a);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9front] Re: boot/efi: support framebuffer with 64-bit base address
  2021-02-18  8:58 [9front] boot/efi: support framebuffer with 64-bit base address Michael Forney
@ 2021-02-18 20:23 ` Anthony Martin
  2021-02-18 21:54   ` Michael Forney
  2021-02-20 11:48   ` cinap_lenrek
  2021-02-20 11:56 ` [9front] " cinap_lenrek
  1 sibling, 2 replies; 5+ messages in thread
From: Anthony Martin @ 2021-02-18 20:23 UTC (permalink / raw)
  To: 9front

Michael Forney <mforney@mforney.org> once said:
>  char*
>  hexfmt(char *s, int i, uvlong a)
>  {
> -	if(i > 8){
> -		s = numfmt(s, 16, i-8, a>>32);
> +	if(i > 8 || i == 0 && (a>>32) != 0){
> +		s = numfmt(s, 16, i ? i-8 : 0, a>>32);
>  		i = 8;
>  	}
>  	return numfmt(s, 16, i, a);

I'd change numfmt to take a uvlong instead
of adding another special case to hexfmt.

  Anthony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Re: boot/efi: support framebuffer with 64-bit base address
  2021-02-18 20:23 ` [9front] " Anthony Martin
@ 2021-02-18 21:54   ` Michael Forney
  2021-02-20 11:48   ` cinap_lenrek
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Forney @ 2021-02-18 21:54 UTC (permalink / raw)
  To: 9front

On 2021-02-18, Anthony Martin <ality@pbrane.org> wrote:
> I'd change numfmt to take a uvlong instead
> of adding another special case to hexfmt.

I had tried this, but it doesn't work because numfmt takes the
remainder mod the base then divides by the base (until it prints all
the digits). This same code is used to build bootia32.efi which needs
special runtime functions (_modvu and _divvu) to implement these
operations on a uvlong.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Re: boot/efi: support framebuffer with 64-bit base address
  2021-02-18 20:23 ` [9front] " Anthony Martin
  2021-02-18 21:54   ` Michael Forney
@ 2021-02-20 11:48   ` cinap_lenrek
  1 sibling, 0 replies; 5+ messages in thread
From: cinap_lenrek @ 2021-02-20 11:48 UTC (permalink / raw)
  To: 9front

the issue is that the 64-bit asop's (/=) are emulated on 386
using libc's vlrt.c. and the bootloader is not linked with
libc due to size constraints.

i should have put a comment explaining this in the code.

--
cinap

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] boot/efi: support framebuffer with 64-bit base address
  2021-02-18  8:58 [9front] boot/efi: support framebuffer with 64-bit base address Michael Forney
  2021-02-18 20:23 ` [9front] " Anthony Martin
@ 2021-02-20 11:56 ` cinap_lenrek
  1 sibling, 0 replies; 5+ messages in thread
From: cinap_lenrek @ 2021-02-20 11:56 UTC (permalink / raw)
  To: 9front

applied.

thank you!

--
cinap

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-20 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  8:58 [9front] boot/efi: support framebuffer with 64-bit base address Michael Forney
2021-02-18 20:23 ` [9front] " Anthony Martin
2021-02-18 21:54   ` Michael Forney
2021-02-20 11:48   ` cinap_lenrek
2021-02-20 11:56 ` [9front] " cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).