小编Mat*_*ery的帖子

kvm中超级呼叫的输入在哪里?

我试图了解linux中的virtio机制.我读到kick函数会通知主机端有关新发布的缓冲区.我特别关注virtio_net.一旦数据包准备好传输,就会在这里调用kick函数.从这里我追踪了这个电话,我认为它是这样的.从这里到哪里去了?哪个代码包含virtio的后端驱动程序.管理程序中的代码将在何处进行?谢谢...

谢谢,巴拉

linux kvm linux-kernel

5
推荐指数
1
解决办法
1486
查看次数

如何在DOS中进行字符串比较条件?

哇,从没想过我会在DOS上写任何东西.现在我做了,我知道为什么我从来没想过.语法很荒谬!

无论如何我需要帮助.我想提示用户输入,如果收到空白行,我想使用默认值,如下所示:

set name=abraham.
set /p input=please enter your name, press enter to use %name%:
if not %input%=="" set name=%input%
echo your name is %name%
Run Code Online (Sandbox Code Playgroud)

我收到一个错误,说"此时设置是意料之外的."

你能帮帮忙吗?

windows command-line dos

4
推荐指数
1
解决办法
3万
查看次数

更改Fork()系统调用

嗨,我正在尝试创建一个系统调用,将计算被调用的分叉数.我打算更改fork系统调用,以便它有一个计数器来跟踪fork()被调用的次数.我计划在fork.h中添加一个静态变量,然后每次调用fork.c时都增加它.我根本不明白fork.c中发生了什么.这甚至是正确的方法吗?

c linux fork system-calls

4
推荐指数
1
解决办法
1620
查看次数

装配(或NASM)恼人的问题

我曾经用TASM编译我的asm代码(在winXP上),但是我遇到了一些麻烦所以现在我使用NASM(在linux上).这段代码展示了我正在尝试做的事情:

(gdb) list 35
30      xor ecx,ecx             # ecx is a counter
31      mov bl, ' '             # this is what I'm looking for
32  count_spaces:
33      mov al,[esi]            # grab a char
34      jz  spaces_counted      # is this the end?
35      inc esi                 # next char
36      cmp al,bl               # found one?
37      jne count_spaces        # nope, loop
38      inc ecx                 # yep, inc counter
39      jmp count_spaces        # and loop
Run Code Online (Sandbox Code Playgroud)

这对我来说是正确的,但是:

Breakpoint 1, main () at …
Run Code Online (Sandbox Code Playgroud)

linux assembly gdb nasm

4
推荐指数
2
解决办法
1565
查看次数

来自Assembly的sys_execve系统调用

asm_execve.s:

.section .data
file_to_run:
.ascii       "/bin/sh"

.section .text
.globl main

main:
    pushl %ebp
    movl %esp, %ebp
    subl $0x8, %esp         # array of two pointers. array[0] = file_to_run  array[1] = 0

    movl file_to_run, %edi
    movl %edi, -0x4(%ebp)   
    movl $0, -0x8(%ebp)

    movl $11, %eax                      # sys_execve
    movl file_to_run, %ebx              # file to execute       
    leal -4(%ebp), %ecx                 # command line parameters
    movl $0, %edx                       # environment block
    int  $0x80              

    leave
    ret

生成文件:

NAME = asm_execve
$(NAME) : $(NAME).s
    gcc -o $(NAME) $(NAME).s

程序已执行,但未调用sys_execve: …

linux x86 assembly system-calls

4
推荐指数
1
解决办法
2万
查看次数

在C中获取调用函数的名称(不使用预处理器)

我想知道是否有办法在C中找到称为当前函数(在运行时)的函数.

我知道你可以__FUNCTION__在gcc中使用,但有没有办法不使用C预处理器?

可能不是.

干杯

c stack gcc

1
推荐指数
2
解决办法
5476
查看次数

有很多警告在Solaris SPARC上编译Lua?

当我在Solaris SPARC上编译Lua(5.1.4)时,我收到以下警告......还有很多......

以下只是一个片段:

# /usr/ccs/bin/make solaris
cd src && /usr/ccs/bin/make solaris
/usr/ccs/bin/make all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lapi.c
lapi.c: In function `luaA_pushobject':
lapi.c:92: warning: visibility attribute not supported in this configuration; ignored
/usr/sfw/bin/gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -c  lcode.c
lcode.c: In function `luaK_getlabel':
lcode.c:97: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_concat':
lcode.c:196: warning: visibility attribute not supported in this configuration; ignored
lcode.c: In function `luaK_patchtohere':
lcode.c:182: warning: visibility attribute …
Run Code Online (Sandbox Code Playgroud)

c lua gcc solaris

1
推荐指数
1
解决办法
868
查看次数

如何解码此指令"call*fs:0x334"以了解确切的函数地址?

在运行期间,如何获取寄存器fs中的值并在"call*fs:0x334"中计算目标函数的地址?我可以使用什么样的x86组件?

x86 assembly x86-64 linux-kernel

1
推荐指数
1
解决办法
529
查看次数

标签 统计

linux ×4

assembly ×3

c ×3

gcc ×2

linux-kernel ×2

system-calls ×2

x86 ×2

command-line ×1

dos ×1

fork ×1

gdb ×1

kvm ×1

lua ×1

nasm ×1

solaris ×1

stack ×1

windows ×1

x86-64 ×1