2022年3月13日

分段、分页虚拟内存访问原理、应用

摘要: 参考书及图来源:x86实模式到保护模式、操作系统真像还原、操作系统导论、mooc计算机系统基础 分段机制 一个段是地址空间里一个定长的区域,在典型的地址空间中分为3个逻辑不同的段:代码、栈、堆(实际更多) 分段机制使得操作系统将不同的段加入到不同的物理内存区域。 上图为将一个程序分为代码、堆、栈 三 阅读全文

posted @ 2022-03-13 16:37 thotf 阅读(217) 评论(0) 推荐(0)

2022年2月26日

那些令我迷惑的汇编语法(自用)

摘要: CS 代码段寄存器 DS 数据段寄存器 ES 附加段寄存器 FS 同上 GS 同上 SS 栈段 约定 AX 累加寄存器(算数、逻辑运算、保存外设I/0 数据) BX 基址寄存器(存地址,作为基址) CX 计数寄存器(循环) DX 数据寄存器(存数据,端口号) SI 源变址寄存器(数据源地址,指向被传 阅读全文

posted @ 2022-02-26 15:56 thotf 阅读(91) 评论(0) 推荐(0)

2020年5月21日

选择排序

摘要: func main(){ a := []int{1, 9, 2, 8, 3, 7, 4, 6, 5, 10} for i:=0;i<len(a)-1;i++{ max := i for j:=i+1;j<len(a);j++{ if a[j] > a[max]{ max = j } } a[i],a 阅读全文

posted @ 2020-05-21 09:11 thotf 阅读(87) 评论(0) 推荐(0)

2020年5月4日

小数精度丢失问题

摘要: 例子: x := 74.96 y := 20.48 b := x - y fmt.Println(b) //output: 54.47999999999999 上面是使用普通编码 硬编码的方式如下: fmt.Println(74.96-20.48) //54.48 百度关于硬编码的解释一堆话 以上的 阅读全文

posted @ 2020-05-04 19:15 thotf 阅读(404) 评论(0) 推荐(0)

2020年4月29日

使用os.WriteAt 分块写入数据

摘要: 最近在写一个并发写入数据到文件的功能。使用到os.WriteAt方法 先看下官方给的文档 func (*File) WriteAt ¶ func (f *File) WriteAt(b []byte, off int64) (n int, err error) WriteAt在指定的位置(相对于文件 阅读全文

posted @ 2020-04-29 10:59 thotf 阅读(1331) 评论(0) 推荐(0)

2020年4月21日

弹性盒子flex

摘要: <div class=""> <div class="bao as1" style="background-color: #4CAF50">div1</div> <div class="bao as2" style="background-color: brown">div2</div> <div 阅读全文

posted @ 2020-04-21 10:13 thotf 阅读(105) 评论(0) 推荐(0)

2020年4月20日

页面布局

摘要: position 定位 属性 static、relative、absolute、fixed static:所有元素都默认的定位 absolute:绝对定位的父元素设置了除static之外的定位,那么它就会相对于它的父元素定位,没有父元素就会相对于html定位。 可以使用left、right、top、 阅读全文

posted @ 2020-04-20 17:03 thotf 阅读(97) 评论(0) 推荐(0)

HTML 快速复习

摘要: 加粗不用特别记忆 HTML扩展名 .html 和.htm <!DOCTYPE html>声明,引用官方DTD文件,DTD文件时对标签的使用进行定义。 <html> <head> <title> <meta name =" " content = "" charset="UTF-8" > name = 阅读全文

posted @ 2020-04-20 10:56 thotf 阅读(389) 评论(0) 推荐(0)

2020年4月19日

proxy handle

摘要: func proxyHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { u, _ := url.Parse("http://127.0.0.1:9000/") proxy := httputil.NewSin 阅读全文

posted @ 2020-04-19 15:31 thotf 阅读(102) 评论(0) 推荐(0)

api透传模块

摘要: func request(b *ApiBody, w http.ResponseWriter, r *http.Request) { var resp *http.Response var err error switch b.Method { case http.MethodGet: req, _ 阅读全文

posted @ 2020-04-19 15:30 thotf 阅读(252) 评论(0) 推荐(0)

导航