Skip to content

Commit

Permalink
[libc] Use debug port only for x86 architectures
Browse files Browse the repository at this point in the history
The bochs/QEMU debug port at I/O port 0xe9 exists only for x86, and
there is no direct equivalent for other CPU architectures.

Omit the I/O port write instruction on other CPU architectures.

Signed-off-by: Michael Brown <[email protected]>
  • Loading branch information
mcb30 committed Nov 28, 2023
1 parent e902c08 commit 2007159
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ int putchar ( int character ) {
putchar ( '\r' );

/* Print character to bochs debug port */
#if defined(__i386__) || defined(__x86_64__)
__asm__ __volatile__ ( "outb %b0, $0xe9"
: : "a" ( character ) );
#endif

/* Print character to EFI/BIOS console as applicable */
if ( efi_systab ) {
Expand Down

0 comments on commit 2007159

Please sign in to comment.