我在看一个嵌入式x86系统设计文档。一个包含Xilinx的I/O板连接到linux x86 PCI总线。FPGA的实现如下:
• PCI interface core to connect to the x86 PCI bus
• Xilinx MB soft processor
• Xilinx OPB bus (this is a processor bus for the MB)
• PCI <-> OPB interface to allow the PCI bus to access all OPB peripherals
• Interrup
我有一个非常简单的程序:
using System;
public class Program
{
public static void Main()
{
Console.WriteLine(IntPtr.Size);
}
}
让我们使用mono编译器作为x86应用程序构建它,并在x64 mono上运行它:
$ uname -srvmpio ; lsb_release -d
Linux 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 G
我想做以下几件事:
#include <memory>
#include <vector>
#include <queue>
int main() {
std::vector<std::queue<std::unique_ptr<int>>> v;
v.resize(10);
}
但是我和GCC一起得到了10.2:
$ g++ test.cpp -o test
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++
我正在用C语言开发一个操作系统(当然还有一些汇编程序),现在我想让它加载/运行外部程序(放在RAM磁盘中)。我已经使用'-f bin‘用nasm组装了一个测试程序作为原始机器代码。我在这个主题上发现的其他东西都是在运行Windows或Linux时加载代码。我使用以下代码将程序加载到内存中:
#define BIN_ADDR 0xFF000
int run_bin(char *file) //Too many hacks at the moment
{
u32int size = 0;
char *bin = open_file(file, &size);