BarclayII / AIMv6

Reimplementation and extension of teaching operating system xv6, supersedes xv6-Loongson3a
GNU General Public License v2.0
16 stars 17 forks source link

Burning BIOS #3

Open BarclayII opened 9 years ago

BarclayII commented 9 years ago

龙芯2H机箱的BIOS烧写比较麻烦。开发团队使用的是XELTEK烧录器,SUPERPRO系列,型号为580U。 然而

  1. Xeltek官网称580U已经停产,
  2. Xeltek官方的驱动不支持Linux系统。

现在需要确认的有龙芯机箱ROM的型号:看Logo似乎是Macronix的。简单过了一下Google和淘宝,型号应该是MX25L8006EPI,八脚,仍需要向龙芯官方确认。若有可能,需要使用别的支持该型号和Linux的烧录器。 目前Xeltek正在生产的几个烧录器在淘宝上价格最低的是SuperPRO 610P,支持前述型号,至少800,官网上没有看到报价。 @leon001

@davidgao 你这里的BIOS ROM是什么样的?烧起来有问题么

davidgao commented 9 years ago

ARM use no burnable BIOS lol. ARM's booting is simple, just bring up core 0 and it will start execution at memory address 0x0. on zedboard, the following steps are taken:

  1. copy bootROM(onchip, invisible to processor) to bootRAM.
  2. bring up interconnect and map bootRAM to low address (0x0).
  3. bring up core 0 and it executes from 0x0.
  4. code at this stage reads jumper setting, and decide what to read and execute, or to turn to jtag.

all settings are done with jumpers, so there's no need to burn anything actually.

BarclayII commented 9 years ago

So bootROM takes the job of BIOS, and reads the kernel from external storage, executing it thereafter? What if one would like to modify the content of bootROM? Or is that necessary?

BarclayII commented 9 years ago

Loongson users could circumvent burning BIOS by booting from network. If burning BIOS is by no means possible, a small bootstrapper could be loaded from network into RAM by the load command inside PMON. Kernel residing on the disk could be loaded by the bootstrapper. Note that our ultimate goal is to produce a standalone machine running a functional OS, which of course involves burning the BIOS, though. Therefore, the bootstrapper in PROM should do everything neccessary such as:

  1. Initializations: CPU, memory, cache, TLB, SATA, preliminary exception handlers, UART (for early printing, could be left to kernel if you're confident).
  2. Loading the kernel from disk into RAM.

Network devices, VGA, USB and others could be ignored.

I've asked Loongson Tech to provide the original PMON binary used by the 3A2H box. An available programmer would be purchased after the binary has been tested in RAM.

davidgao commented 9 years ago

bootROM does not read kernel. it reads bootloader. when using SD card this goes to MBR, therefore there's no need to modify that. all control can be done with jumpers.

BarclayII commented 9 years ago

I see, so the default PMON for MIPS is special because it initializes everything and bootloads kernel from ROM.

Shall we unify the bootloader design? I guess PMON, i386 BIOS and Zedboard boot ROM really differ from each other.

davidgao commented 9 years ago

I think the MIPS ROM should include a very basic bios just to load and verify MBR from SATA, and we can almost share a bootloader from then on, which should load and verify kernel from the reserved partition. The only difference should be the data loading interface, and will not cause any trouble.