⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icedrvr

📁 MIPS处理器的bootloader,龙芯就是用的修改过的PMON2
💻
字号:
			The SerialICE Driver			The SerialICE DriverThe SerialICE Driver is downloaded from the host to the SerialICE Controller.Once the driver has been downloaded, the SerialICE Monitor is able to use itto communicate with the SerialICE Kernel that is resident on the Target.For more information of how to select and download an SerialICE Driver pleaserefer to the section on Getting Started withSerialICE-1A.  SerialICE Monitor - SerialICE Kernel CommunicationTwo tables are used to provide linkage between the SerialICE Monitor and theSerialICE Kernel.  The driver's table is located at 0x80020000 is used whenthe SerialICE Monitor needs to call one of the functions in the driver. Thesefunctions are listed below:OffsetFunctionDescription0Entry PointThe entry point of the driver8DVRIF_VERSThe version number of the driver12_cputypeThe address of an INT that contains the type of the CPU eg. 400116_drivernameThe address of a string that contains the driver name20read_target(int type,Ulong addr,int size)The address of a function that reads a value from the target24write_target(int type,Ulong addr,Ulong value,int size)The address of a function that writes a value to the target28run_target(int mode,int flags,int count)The address of a function that starts target execution32setbp_target(int n,int type,Ulong addr)The address of a function that sets a breakpoint in the target36clrbp_target(int n)The address of a function that clears a breakpoint in the target40flush_target(int type)The address of a function that flushes the caches in the target440Not used48is_writeable_target(Ulong addr)The address of a function that returns TRUE if the specified	address is writeableThe second table is located at 0xbfc00200 and is used when the driver needsto call functions within the SerialICE Monitor. The functions in this table areshown below:OffsetFunctionDescription0read(int fd, char *buf, int size)Read specified number of bytes into buf. Returns number ofbytes read.4write(int fd, char *buf, int size)Write specified number of bytes from buf. Returns number ofbytes written.8int open(char *name [,int mode])Open a device. Returns file descriptor.12close(int fd)Close a file descriptor.16ioctl(int fd, int request, arg)Perform I/O control operation.20printf(char *fmtstr, arg...)Print formatted to stdout.24addRegRec(RegRec *reg)The address of a function that adds a register to the current list28void *malloc(int size)The address of a function that allocates a block of memory32cpuInitThe address of a function that ...36char*getenv(char *name)The address of a function that returns a pointer to the definitionof the specified environment variable400Not used440Not used48stop(int type)The address of a function that returns control to the Monitor52int getBpid()The address of a function that returns the id of the currentbreakpoint (if any)56is_xvwmode() The address of a function that returns TRUE if xvwmode is set60gdbstop(int type)The address of a function that returns control to the gdb commandmode64setTrcbp(Ulong addr,int tover)The address of a function that sets a trace breakpoint68addCmdRec(CmdRec *cmd)The address of a function that adds a new command to the currentcommand list72Ulong disasm(char *buf,Ulong addr,Ulong instr)The address of a function that disassembles an instruction76get_rsa(Ulong *dst,char *src)The address of a function that performs expression evaluation80is_gdbmode (read)The address of a function that returns TRUE if gdbmode is set84addEnvRec(EnvRec *var)The address of a function that adds a new environment variable to the current listOnce the driver has been loaded, IMON calls the routine whose addressis located at offset 4 (_start) in the table. The routine _start firstclears the bss section and then calls dvrInit(). 	_start()	{	clrbss();	dvrInit();	}dvrInit adds the list of registers and commands that are specific tothis processor. Offsets 8 and 12 contain the address of an intthat contains the processor number (eg. 4001), and the address of astring that describes the driver (eg. "Driver for LR4001")respectively.The driver is divided into a four files:	  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -