我正在编写一个程序来运行裸机。我正在尝试从自定义链接描述文件中获取变量以在C中使用,这是我尝试过的。
从C:
extern unsigned long* __START_OF_PROG_MEMORY;
volatile unsigned long *StartOfProgram = (unsigned long*) (&__START_OF_PROG_MEMORY);
Run Code Online (Sandbox Code Playgroud)
链接描述文件:
SECTIONS
{
. = 0x80000;
PROVIDE(__START_OF_PROG_MEMORY = .);
.text : { KEEP(*(.text.boot)) *(.text .text.* .gnu.linkonce.t*) }
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r*) }
PROVIDE(_data = .);
.data : { *(.data .data.* .gnu.linkonce.d*) }
.bss (NOLOAD) : {
. = ALIGN(16);
__bss_start = .;
*(.bss .bss.*)
*(COMMON)
__bss_end = .;
}
_end = .;
PROVIDE(__END_OF_PROG_MEMORY = .);
/DISCARD/ : { *(.comment) *(.gnu*) *(.note*) *(.eh_frame*) }
} …Run Code Online (Sandbox Code Playgroud) 我是OpenGl的专家,因此,我正在尝试仅学习4.x的现代OpenGl。一旦完成了基础教程(例如旋转多维数据集),我就决定尝试创建一个仅处理多维数据集的基于体素的程序。该程序的目标是快速,使用有限的CPU能力和内存以及动态的,因此映射大小可以更改,并且只有在数组中表示已填充块时才绘制块。
我有一个VBO,它具有由三角形构成的多维数据集的顶点和索引。首先,如果我告诉renderGl着色器使用render函数,然后在完成后绑定VBO,则执行此循环
绘制立方体循环:
//The letter_max are the dimensions of the matrix created to store the voxel status in
// The method I use for getting and setting entries in the map are very efficient so I have not included it in this example
for(int z = -(z_max / 2); z < z_max - (z_max / 2); z++)
{
for(int y = -(y_max / 2); y < y_max - (y_max / 2); y++)
{
for(int x = -(x_max / 2); x …Run Code Online (Sandbox Code Playgroud) 你好,我无法让我的脚本运行,它的目的是通过 HTTP 实时显示我的屏幕,但它出现了一个我似乎无法修复的错误。
#!/bin/python
import subprocess
import threading
try:
subprocess.Popen("rm out.mpg")
except OSError:
pass
subprocess.Popen("ffmpeg -f x11grab -framerate 60 -video_size 1366x768 -i :0.0 out.mpg")
subprocess.Popen("python -m SimpleHTTPServer 8000 out.mpg")
Run Code Online (Sandbox Code Playgroud)
错误是
Traceback (most recent call last):
File "Streaming.py", line 11, in <module>
subprocess.Popen("ffmpeg -f x11grab -framerate 60 -video_size 1366x768 -i :0.0 out.mpg")
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud) c ×2
gcc ×1
linker ×1
opengl ×1
opengl-4 ×1
optimization ×1
performance ×1
python ×1
subprocess ×1