Bug 208050

Summary: The boot loader forth does not understand 'outb' on the amd64 platform.
Product: Base System Reporter: K Staring <qdk>
Component: miscAssignee: Devin Teske <dteske>
Status: New ---    
Severity: Affects Some People CC: allanjude
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
'outb' amd64 patch none

Description K Staring 2016-03-16 05:14:50 UTC
Created attachment 168280 [details]
'outb' amd64 patch

'outb (port char --)', according to loader(8), writes a value to a port.
However, it only does so on the i386 platform (and possibly non-x86 platforms, but this is outside of the scope of this report), ihe 'outb' word is not recognised on amd64.

One would expect this would also work on amd64.

A patch is supplied which enables 'outb' on amd64 also. Note that after the patch is applied, i386/sysdep.c and amd64/sysdep.c have the same contents.
Comment 1 Devin Teske freebsd_committer 2018-06-17 20:54:38 UTC
I'm unfamiliar with inb/outb, how might I use it for testing?
Comment 2 K Staring 2018-07-09 06:50:38 UTC
Its use was for me to be able to disable the discrete GPU at boot on my MacBook Pro with the following outb statements. However, since submitting this bug report I've changed laptops from the Apple to a Dell.

 outb 0x728 1
 outb 0x710 2
 outb 0x740 2
 outb 0x750 0

I don't know of any other use for outb in the bootloader and it's not at all required to be able to boot up a MacBook Pro, so its use is rather limited. More like a 'nice to have' since the man page mentions it, and on top of that, at the time I made the patch, the i386 and x86_64 sysdep.c files became identical when the patch was applied, allowing the possibility to have only one sysdep.c .