发生中断时CPU自动保存的状态是什么?以哪个顺序?
我需要在 USB 内核模块中添加一个短暂的延迟,以避免在小型嵌入式 Linux 设备启动时出现极其罕见的内核恐慌。有问题的代码如下。如果我在代码中添加一个 prink,该设备会成功运行一整夜,而之前它曾经失败过。我想添加一个小的延迟,但 usleep_range 和 msleep 会导致内核回溯“在原子时调度”。如何在不睡觉的情况下在这部分代码中添加延迟?是一个while循环来做到这一点吗?
usb_hub_for_each_child(udev, chix, childdev) {
printk(KERN_ERR "r8a66597: Start USB Discover\n");
//usleep_range(10000, 11000);
//preempt_disable();
//msleep(1);
collect_usb_address_map(childdev, map);
//usleep_range(10000, 11000);
printk(KERN_ERR "r8a66597: Stop USB Discover\n");
//msleep(1);
//preempt_enable();
}
Run Code Online (Sandbox Code Playgroud) linux kernel linux-device-driver linux-kernel embedded-linux
如前所述在这里,我知道,coef0在使用polynomial和sigmoid内核功能SVM。但是这个系数的确切影响是什么?
windows _EPROCESS ( http://terminus.rewolf.pl/terminus/structures/ntdll/_EPROCESS_x64.html ) 结构有一个字段ImageFileName,声明如下:
使用 WinDbg:
ImageFileName : [15] UChar
Run Code Online (Sandbox Code Playgroud)
所以有15个字符的空间。
如何存储超过 15 个字符的进程名称?
我有一个简单的内核模块,它创建了一个字符设备并且什么都不做。
我编写了这个测试字符设备的用户空间程序。
int main()
{
int fd;
fd = open("/dev/ebbchar", O_RDWR);
if (fd < 0)
err(1, "open");
sleep(10);
ret = close(fd);
if (ret < 0)
err(1, "close");
}
Run Code Online (Sandbox Code Playgroud)
程序在 10 秒后退出。
但是如果同时我用 rmmod 或 modprobe 删除了模块,那么 10 秒后程序段错误或挂起,并且有一个内核 oops。
如何导致 rmmod 失败,或者是否有安全删除模块的方法?
我的模块可以在其 __exit 函数中关闭文件描述符吗?
我假设崩溃是由在字符文件操作中close()间接调用release回调的函数引起的,该release函数不再存在,因为模块已被删除。
可以在此处找到内核模块的源代码(搜索清单 2)。
我已经成功地使用 buildroot (v. 2019.05) 来构建 u-boot 和 Kernel,并且能够一起启动它。
问题是,即使我选择内核压缩模式为gzip,我得到的只是未压缩的Image文件。
在输出目录(以及 Linux)中只有Image文件,而应该有Image.gz.
如何Image.gz从 / 而不是生成Image?
Afaik 他们从未使用过,现在 CS=DS=SS。但是,如果我要设置这些值,会发生任何变化还是处理器会忽略它们。我在这个问题上发现了非常矛盾的信息,我不明白如果它们被忽略为什么它们仍然存在。请帮助
当我的页面错误处理程序中断被调用时(它应该挂起系统),在调用之前有一些变量被推送到堆栈中。我启用了虚拟内存,当我设置一个无效的堆栈指针(esp)并且 int14 处理程序被调用时,它会立即导致另一个页面错误等等。我应该如何解决这种情况?
我的 int14 代码:
isr14:
; interrupt handler for isr14
jmp $
iretd
Run Code Online (Sandbox Code Playgroud)
导致它中断的代码:
mov esp, 0x1000 ; 0x1000 is not mapped in the VM directory
push dword 'A'
jmp $
Run Code Online (Sandbox Code Playgroud)
我的 IDT 表的部分:
irq14:
dw isr14
dw 0x0008
db 0x00
db 10101110b
dw 0x0000
irq15:
........
Run Code Online (Sandbox Code Playgroud) 我使用 QEMU(qemu-system-aarch64 -M raspi3) 从工作映像中模拟带有内核的 Raspberry pi3。一切正常,但没有网络。
qemu-system-aarch64 \
-kernel ./bootpart/kernel8.img \
-initrd ./bootpart/initrd.img-4.14.0-3-arm64 \
-dtb ./debian_bootpart/bcm2837-rpi-3-b.dtb \
-M raspi3 -m 1024 \
-nographic \
-serial mon:stdio \
-append "rw earlycon=pl011,0x3f201000 console=ttyAMA0 loglevel=8 root=/dev/mmcblk0p3 fsck.repair=yes net.ifnames=0 rootwait memtest=1" \
-drive file=./genpi64lite.img,format=raw,if=sd,id=hd-root \
-no-reboot
Run Code Online (Sandbox Code Playgroud)
我试图添加这个选项
-device virtio-blk-device,drive=hd-root \
-netdev user,id=net0,hostfwd=tcp::5555-:22 \
-device virtio-net-device,netdev=net0 \
Run Code Online (Sandbox Code Playgroud)
但是会有错误
qemu-system-aarch64: -device virtio-blk-device,drive=hd-root: 没有找到设备“virtio-blk-device”的“virtio-bus”总线 我参考了一些论坛,并使用了“virt”机器代替 raspi3 以模拟 virtio-network
qemu-system-aarch64 \
-kernel ./bootpart/kernel8.img \
-initrd ./bootpart/initrd.img-4.14.0-3-arm64 \
-m 2048 \
-M virt \
-cpu cortex-a53 \
-smp …Run Code Online (Sandbox Code Playgroud) 我根据文档使用 GPyTorch 回归器。
我想为 RBF 内核中的“lengthscale”超参数设置一个初始值。
我想设置一个常量作为“lengthscale”的初始值(类似于我们在 scikit-learn 高斯过程回归器中可以做的)。
如果您有任何想法,请告诉我。