0%

Advanced Matrix Extension (AMX) 高级矩阵运算,是x86平台新引入的一个矩阵相关的编程框架。AMX扩展引入了两个新的组件:二维寄存器,成为tile, 还有一组可以操作那些tile的加速器。Tile指代内存中的一个二维数组。AMX指令在指令流中依靠内存load/store操作同步的访问内存。AMX指令可以自由的于X86的传统指令集,以及其他的扩展指令并发执行,例如AVX512.
amx_architecture.svg

Palettes

Read more »

一个最简单的内核模块,其中创建一个最简单的可读可写的proc fs的模板,供大家参考和备忘。
首先创建一个文件,或者干脆把新模块文件放在<linux source>/fs/proc/文件夹中,命名debug_sy.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <linux/module.h>       /* Specifically, a module */
#include <linux/kernel.h> /* We're doing kernel work */
#include <linux/proc_fs.h> /* Necessary because we use the proc fs */
#include <asm/uaccess.h> /* for copy_from_user */
#include <linux/seq_file.h> //using seq_printf
#include <linux/slab.h> // Using kzalloc

#define PROCFS_NAME "debug_sy"

MODULE_AUTHOR("Yi Sun");
static char *str = NULL;

static int my_proc_show(struct seq_file *m,void *v){
seq_printf(m,"%s\n",str);
return 0;
}

static ssize_t my_proc_write(struct file* file,const char __user *buffer,size_t count,loff_t *f_pos){
char *tmp = kzalloc((count+1),GFP_KERNEL);
if(!tmp)return -ENOMEM;
if(copy_from_user(tmp,buffer,count)){
kfree(tmp);
return EFAULT;
}
kfree(str);
str=tmp;
return count;
}

static int my_proc_open(struct inode *inode,struct file *file){
return single_open(file,my_proc_show,NULL);
}

static const struct proc_ops my_fops={
.proc_open = my_proc_open,
.proc_release = single_release,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_write = my_proc_write
};

static int __init hello_init(void){
struct proc_dir_entry *entry;
entry = proc_create(PROCFS_NAME,0777,NULL,&my_fops);
if(!entry){
return -1;
}else{
printk(KERN_INFO "create proc file successfully\n");
}
return 0;
}

static void __exit hello_exit(void){
remove_proc_entry(PROCFS_NAME,NULL);
printk(KERN_INFO "Goodbye world!\n");
}

module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
Read more »

本文我们来解释下怎样创建一个mini x86操作系统。当然这个操作系统小到并不具备一个操作系统应该具有的功能,而仅仅是打印一个字符串到显示器上。

概述

Read more »

前面几篇文章我们完成了Crosvm的编译和安装,以及依赖库的安装。本文将详细阐述一下如何开发和调试crosvm。
我的开发环境是Windows工作机+Ubuntu开发机。当然,可以仅仅用一个Ubuntu做为开发机就可以搞定所有的事情,这种情况最为简单直接。之所以这么做,因为需要使用windows的office,N多年来也习惯了Windows office。出差出门啥的,不需要带两个电脑。
所以,windows中使用的IDE是MS VScode。免费软件,自行下载。

VSCode 插件

Read more »

很多同学可能想要着手学习Linux kernel、虚拟机,或者刚入门不久。今天写一个入门用的很有用的教程,教大家如何创建最小化的虚拟机镜像。

创建镜像文件

Read more »

本文我们来一起探索下ELF的真容。我们将尝试从头开始以十六进制生成Linux的”Hello world”程序。为了讲解最底层的ELF原理,我们这里尽量不使用gcc,ld等编译工具。希望通过本文,让读者对操作系统如何加载和运行程序的原理有所了解。

为了使生活更轻松,本文将仅关注一种体系结构:AMD64(x64)和一种操作系统Linux。不需要编译器、链接器甚至标准库。我们创建最简单的ELF可执行程序,直接使用系统调用。我将详细介绍并描述所有“源代码”,即十六进制的文件。然后使用工具’xxd’将其转换为二进制文件。

Read more »

ChromeOS开发者们已经帮玩家实现了创建一个ChromeOS的虚拟机镜像。有兴趣的同学,可以玩一下。

编译ChromeOS

Read more »

近来研究了下Android emulator,就是Android Studio中用于调试App的虚拟机AVD(Android Virtualized Device)。本来是件挺平淡无奇的事情,但非要给生活比个””耶…..”(^-^)V 需求是,在Linux OS中,使用自定义的Android Kernel! 由于烂樱桃本人只略懂一丢虚拟化技术,对于Android算是一窍不通,所以,本文主要记录步骤为主,木有原理性的东西。

0. 准备 安装Android Studio

Read more »