查看: 3|回复: 0

youyeetoo x1s的com1串口的实际物理地址是多少?

[复制链接]

2

主题

0

回帖

208

积分

中级会员

Rank: 3Rank: 3

积分
208
发表于 5 小时前 | 显示全部楼层 |阅读模式
(为了高效,请按如下格式提问)

硬件主板型号:youyeetoo x1s
固件名称/系统版本:
自编的或固件下载地址:
Log日志: (可以导出,用TXT附件上传)

问题描述及复现步骤:
我的程序在qemu上有打印:Z1:Start

*** yyZephyr EFI Loader ***
RSDP found at 0x1fb7e014
Zeroing 499408 bytes of memory at 0x106000
Copying 20480 data bytes to 0x1000 from image offset
Copying 24576 data bytes to 0x100000 from image offset 20480
Copying 33056 data bytes to 0x17fee0 from image offset 45056
Jumping to Entry Point: 0x1137 (66 ba fb 3 b0 80 ee)
Z1:Start
但是在youyeetoo x1s板子上,只打印到了Jumping
用的是标准的 x86_64 UEFI 环境 + COM1 串口(0x3F8)去打印的Z1:Start
附打印代码:

# --- 串口打印测试代码开始(x86_64标准格式,无编译错误)---
    # 初始化COM1串口(0x3F8),波特率115200 8N1
    movw $0x3FB, %dx        # Line Control Register (0x3F8+3)
    movb $0x80, %al         # 设置DLAB位,允许修改波特率
    outb %al, %dx           # 写入线路控制寄存器

    movw $0x3F8, %dx        # Divisor Latch Low (0x3F8)
    movb $0x01, %al         # 波特率除数=1 (115200)
    outb %al, %dx

    movw $0x3F9, %dx        # Divisor Latch High (0x3F8+1)
    movb $0x00, %al         # 除数高字节=0
    outb %al, %dx

    movw $0x3FB, %dx        # Line Control Register
    movb $0x03, %al         # 8N1模式,清除DLAB位
    outb %al, %dx

    movw $0x3FC, %dx        # Modem Control Register (0x3F8+4)
    movb $0x0B, %al         # 启用DTR/RTS,禁用中断
    outb %al, %dx

    # 发送测试字符串:"Z1:Start\n\r"(Youyeetoo X1启动标记)
    # 发送 'Z'
send_z:
    movw $0x3FD, %dx        # Line Status Register (0x3F8+5)
    inb %dx, %al            # 读取线路状态
    testb $0x20, %al        # 检查TX Empty位(bit5)
    jz send_z               # 串口忙则等待
   
    movw $0x3F8, %dx        # Transmit Data Register
    movb $0x5A, %al         # 'Z'
    outb %al, %dx

    # 发送 '1'
send_1:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_1
   
    movw $0x3F8, %dx
    movb $0x31, %al         # '1'
    outb %al, %dx

    # 发送 ':'
send_colon:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_colon
   
    movw $0x3F8, %dx
    movb $0x3A, %al         # ':'
    outb %al, %dx

    # 发送 'S'
send_s:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_s
   
    movw $0x3F8, %dx
    movb $0x53, %al         # 'S'
    outb %al, %dx

    # 发送 't'
send_t:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_t
   
    movw $0x3F8, %dx
    movb $0x74, %al         # 't'
    outb %al, %dx

    # 发送 'a'
send_a:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_a
   
    movw $0x3F8, %dx
    movb $0x61, %al         # 'a'
    outb %al, %dx

    # 发送 'r'
send_r:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_r
   
    movw $0x3F8, %dx
    movb $0x72, %al         # 'r'
    outb %al, %dx

    # 发送 't'
send_t2:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_t2
   
    movw $0x3F8, %dx
    movb $0x74, %al         # 't'
    outb %al, %dx

    # 发送换行+回车
send_nl:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_nl
   
    movw $0x3F8, %dx
    movb $0x0A, %al         # '\n'
    outb %al, %dx

send_cr:
    movw $0x3FD, %dx
    inb %dx, %al
    testb $0x20, %al
    jz send_cr
   
    movw $0x3F8, %dx
    movb $0x0D, %al         # '\r'
    outb %al, %dx

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|风火轮WIKI|手机版|小黑屋|深圳风火轮团队 ( 粤ICP备17095099号 )

GMT+8, 2026-3-2 22:43 , Processed in 0.064812 second(s), 22 queries .

快速回复 返回顶部 返回列表
 
【客服1】 商务合作 15289193
【客服2】 业务洽谈 13257599
【客服3】 售前咨询 510313198
【邮箱】
smartfire@smartfire.cn