EDK2开发(3)-Hello World

简介

本文分两部分

  1. 编译MdeModulePkg下的HelloWorld 并运行
  2. 自己新建一个 Package 并且写一个 HelloWorld,然后编译运行
Read more

不同Shell下的代理设置

Why

鉴于日益严峻的网络形势,先写个文章记录一下各个 Shell 的代理设置,方便后续使用

(感觉不如…搞个 dot file repo)

Read more

在WSL2中安装任意Linux发行版

为什么

因为我要准备EDK2的开发环境,但是我不想污染自己之前在用的 WSL 发行版

我在安装Docker之后发现 WSL 多出了两个发行版本docker-desktopdocker-desktop-data。这个我是知道为什么的,因为 Windows 上的 Docker 其实只是套壳,本质上还是用 Linux 版本的 Docker 进行工作的。不过重点不是这个,重要的是这个说明 WSL 可以安装多个 Linux distro

我第一反应是去 MSDN 看一下,搜multi distro,果然有对应的文档:Import any Linux distribution to use with WSL | Microsoft Docs

接下来围绕文档进行说明和操作

Read more

使用Python处理Markdown front matter

什么是 Front matter

在你使用Hexo等基于Markdown的静态博客生成系统时,工具为你所生成的 md 文件开头通常会有一个符合YAML语法的代码段

比如我现在正在写的这篇文章,它的开头是这样的:

1
2
3
4
5
6
7
---
title: 使用Python处理Markdown front matter
toc: true
date: 2022-05-21 20:38:07
tags:
- Python
---

这就是 Front matter,它可以为 Markdown 文件提供一些基本的信息

Read more

使用StyleGAN2-Ada模型生成高清晰度甘雨头像

StyleGAN2-ADA 迁移学习

实验介绍

使用 StyleGAN2-ADA 模型对动漫《Re:从零开始的异世界生活》中的角色蕾姆进行训练后,在此基础上使用游戏《原神》中的角色甘雨脸部数据集进行训练

由于两个角色的面部特征较为相似,所以相对于使用大量动漫面部数据集训练出的模型,进行迁移学习应该会更快的收敛,并产生较好的结果

Read more

Vite2+Vue3+Electron16 环境配置

使用 Yarn

以获得更好的体验

1
npm install -g yarn

也许后面你需要对~/.yarnrc添加以下内容,以方便进行 Electron 的安装

1
2
3
ELECTRON_BUILDER_BINARIES_MIRROR "http://npm.taobao.org/mirrors/electron-builder-binaries/"
electron_mirror "https://cdn.npm.taobao.org/dist/electron/"
registry "https://registry.npm.taobao.org/"
Read more

6.828-Hw2-Shell

Homework: shell

Executing simple commands

Implementation

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
case ' ':
ecmd = (struct execcmd *)cmd;
if (ecmd->argv[0] == 0)
_exit(0);
// Check if the file is executeable in pwd
if (access(ecmd->argv[0], X_OK) == 0)
{
execv(ecmd->argv[0], ecmd->argv);
}
else
{
// Check if the file is executeable in /bin/
// no support for PATHs
const char *binPath = "/bin/";
int pathLen = strlen(binPath) + strlen(ecmd->argv[0]);
char *path = (char *)malloc((pathLen + 1) * sizeof(char));
strcpy(path, binPath);
strcat(path, ecmd->argv[0]);
if (access(path, X_OK) == 0)
{
execv(path, ecmd->argv);
}
else
{
fprintf(stderr, "shell: command <%s> not found\n", ecmd->argv[0]);
}
}
break;
Read more

6.828-Hw1-Boot xv6

Homework: boot xv6

Exercise: What is on the stack

Begin by restarting qemu and gdb, and set a break-point at 0x7c00, the start of the boot block (bootasm.S). Single step through the instructions (type si at the gdb prompt). Where in bootasm.S is the stack pointer initialized? (Single step until you see an instruction that moves a value into %esp, the register for the stack pointer.)

Read more
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×