From b8ee3904d2703de13aad564eb73516e83151ad1d Mon Sep 17 00:00:00 2001 From: CoderSherlock Date: Tue, 12 Oct 2021 19:07:27 -0400 Subject: [PATCH] Added content in post and about * Add xv6 debug * Fix paper links in about me page --- ...40b622142f1c98125abcfe89a76a661b0e8e343910 | 2 +- ...a1e6385e65874ba0cbfe7214361894c78e973a9a85 | 100 ------------------ ...932c08432a80a1f2f8ace52dc7b553610498d9c9d0 | 19 ---- ...3983d015ea914eadd66b340ae88b9d45fd5fe8d87c | 2 - _config.yml | 2 +- _includes/sidebar.html | 2 +- _posts/2017-07-08-intro-xv6.md | 67 +++++++++++- ...-generate-word-cloud-with-chinese-fenci.md | 7 +- _site/404.html | 10 +- _site/about/index.html | 98 +++++++++-------- .../archivers/charles-is-not-a-good-tool.html | 10 +- ...enerate-word-cloud-with-chinese-fenci.html | 18 ++-- _site/archivers/hello.html | 10 +- _site/archivers/intro-xv6.html | 77 ++++++++++++-- .../some-of-my-previews-exper-work.html | 10 +- _site/category/index.html | 10 +- _site/css/main.css | 2 +- _site/css/main.css.map | 4 +- _site/feed.xml | 77 ++++++++++++-- _site/index.html | 20 ++-- _site/static/2021-10/eta-infocom18.pdf | Bin 0 -> 807744 bytes _site/timeline/index.html | 10 +- about.md | 81 ++++++++------ css/main.scss | 2 +- static/2021-10/eta-infocom18.pdf | Bin 0 -> 807744 bytes 25 files changed, 370 insertions(+), 270 deletions(-) delete mode 100644 .jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/37/304d816a1f295ed873c9a1e6385e65874ba0cbfe7214361894c78e973a9a85 delete mode 100644 .jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/5b/738694e3f95b8a3b2a12932c08432a80a1f2f8ace52dc7b553610498d9c9d0 delete mode 100644 .jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/f0/60afa57b13d66a67a3613983d015ea914eadd66b340ae88b9d45fd5fe8d87c create mode 100644 _site/static/2021-10/eta-infocom18.pdf create mode 100644 static/2021-10/eta-infocom18.pdf diff --git a/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 b/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 index af0fc87..a9b432b 100644 --- a/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 +++ b/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 @@ -1 +1 @@ -I""{"source"=>"/Users/pengzhan/Github/codersherlock.github.io", "destination"=>"/Users/pengzhan/Github/codersherlock.github.io/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/archivers/:title"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>[], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>"", "show_dir_listing"=>false, "permalink"=>"/archivers/:title", "paginate_path"=>"page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge"}, "title"=>"Stop Talking, Start Doing - 停止空想,开始行动", "author"=>"Pengzhan Hao", "avatar"=>"/static/avatar.jpg", "email"=>"haopengzhan@gmail.com", "description"=>"My personal blog, with some boring research staff and some tricks I was fancy to. I'll try my best to make this blog fun and useful. Not just a place I complain about all happens in my Lab.\n", "url"=>"https://codersherlock.github.com/", "github_username"=>"codersherlock", "disqus_shortname"=>"codersherlockblog", "gems"=>["jekyll-paginate", "jekyll-gist", "jemoji"], "paginate"=>5, "serving"=>false}:ET \ No newline at end of file +I"{"source"=>"/home/pengzhan/Github/CoderSherlock.github.io", "destination"=>"/home/pengzhan/Github/CoderSherlock.github.io/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/archivers/:title"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>[], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>"", "show_dir_listing"=>false, "permalink"=>"/archivers/:title", "paginate_path"=>"page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge"}, "title"=>"Stop Talking, Start Doing", "author"=>"Pengzhan Hao", "avatar"=>"/static/avatar.jpg", "email"=>"haopengzhan@gmail.com", "description"=>"My personal blog, with some boring research staff and some tricks I was fancy to. I'll try my best to make this blog fun and useful. Not just a place I complain about all happens in my Lab.\n", "url"=>"https://codersherlock.github.com/", "github_username"=>"codersherlock", "disqus_shortname"=>"codersherlockblog", "gems"=>["jekyll-paginate", "jekyll-gist", "jemoji"], "paginate"=>5, "serving"=>false}:ET \ No newline at end of file diff --git a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/37/304d816a1f295ed873c9a1e6385e65874ba0cbfe7214361894c78e973a9a85 b/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/37/304d816a1f295ed873c9a1e6385e65874ba0cbfe7214361894c78e973a9a85 deleted file mode 100644 index ed444c6..0000000 --- a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/37/304d816a1f295ed873c9a1e6385e65874ba0cbfe7214361894c78e973a9a85 +++ /dev/null @@ -1,100 +0,0 @@ -I"

Pengzhan Hao

- -

Position:         Research Assistant in MOSLab
-Education:      Doctoral Student of SUNY at Binghamton
-Email:             phao3 at binghamton dot edu
-Address:
-                        MOSLab, H-6 Engineering Building
-                        Binghamton University
-                        4400 Vestal Parkway East
-                        Binghamton, NY 13902

- -

Education

- - -

Experience

- - -

Research

- - -

Publications

- - -

Fun

- - -:ET \ No newline at end of file diff --git a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/5b/738694e3f95b8a3b2a12932c08432a80a1f2f8ace52dc7b553610498d9c9d0 b/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/5b/738694e3f95b8a3b2a12932c08432a80a1f2f8ace52dc7b553610498d9c9d0 deleted file mode 100644 index 62616c7..0000000 --- a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/5b/738694e3f95b8a3b2a12932c08432a80a1f2f8ace52dc7b553610498d9c9d0 +++ /dev/null @@ -1,19 +0,0 @@ -I"

I hate xv6, a stupid, useless education-oriented system. In this article, I will generally talk about how to implement system call to this operating system.

- -

Xv6 Systemcall

-

To invoke a system call, we have to first define a user mode function to be the interface of the kernel instruction in file user.h.

- -
void function (void);
-
- -

This interface-like function will then pass the function name, in this case function, to usys.S. When using user mode function in programs, usys.S will generate a reference to SYS_function and push system call number of this function into %eax. After that, system can know from syscall.c and determining whether this system call is available. We must define same name system function and add it into syscall.h and syscall.c.

- -
#define SYS_function ##		// ## is the system call number
-[SYS_function]  sys_function	// real system function name
-extern int sys_function(void);	// real system function declaration
-
- -

After adding these sentences to syscall files, we can implement real function in specific place where you want to make the function works well.

- -

Sometimes, we need to pass variables among system calls. In this case, variables’ values are not necessary and even can’t be pass directly into system_function. When invoke a system call function, all variables of this system call will be pushed into current process’ stack. In file syscall.c, multiple functions are provided to get these variables from the process. I won’t waste time on explaining how to use these functions especially when elegant and detailed comments were written in source codes. However, I will explain concepts and how process organized and works in xv6 in future articles.

-:ET \ No newline at end of file diff --git a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/f0/60afa57b13d66a67a3613983d015ea914eadd66b340ae88b9d45fd5fe8d87c b/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/f0/60afa57b13d66a67a3613983d015ea914eadd66b340ae88b9d45fd5fe8d87c deleted file mode 100644 index 29efb72..0000000 --- a/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/f0/60afa57b13d66a67a3613983d015ea914eadd66b340ae88b9d45fd5fe8d87c +++ /dev/null @@ -1,2 +0,0 @@ -I"

I hate xv6, a stupid, useless education-oriented system. In this article, I will generally talk about how to implement system call to this operating system.

-:ET \ No newline at end of file diff --git a/_config.yml b/_config.yml index fcf71f4..bacd958 100644 --- a/_config.yml +++ b/_config.yml @@ -6,7 +6,7 @@ # 'jekyll serve'. If you change this file, please restart the server process. # Site settings -title: Stop Talking, Start Doing - 停止空想,开始行动 +title: Stop Talking, Start Doing author: Pengzhan Hao avatar: "/static/avatar.jpg" email: haopengzhan@gmail.com diff --git a/_includes/sidebar.html b/_includes/sidebar.html index c7c729f..ced93f3 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -25,5 +25,5 @@
-
TOC
+
Indexes
\ No newline at end of file diff --git a/_posts/2017-07-08-intro-xv6.md b/_posts/2017-07-08-intro-xv6.md index 8821931..85c8a7c 100644 --- a/_posts/2017-07-08-intro-xv6.md +++ b/_posts/2017-07-08-intro-xv6.md @@ -5,10 +5,12 @@ date: 2017-07-28 14:56:55 -0400 categories: xv6 --- -I hate xv6, a stupid, useless education-oriented system. In this article, I will generally talk about how to implement system call to this operating system. - +In this post, you will learn a few basic concepts of xv6. Learning path will be closed coupled to first project assignment I gave when I assisted in teaching OS classes. +Understand system call and know how to implement a simple one will be coved as the first half. +In the second half of this post, I will discuss a little bit more on how to debug xv6 using gdb. ## Xv6 Systemcall + To invoke a system call, we have to first define a user mode function to be the interface of the kernel instruction in file *user.h*. ~~~~c @@ -18,11 +20,66 @@ void function (void); This interface-like function will then pass the function name, in this case function, to *usys.S*. When using user mode function in programs, *usys.S* will generate a reference to SYS_function and push system call number of this function into %eax. After that, system can know from *syscall.c* and determining whether this system call is available. We must define same name system function and add it into *syscall.h* and *syscall.c*. ~~~~c -#define SYS_function ## // ## is the system call number -[SYS_function] sys_function // real system function name -extern int sys_function(void); // real system function declaration +#define SYS_function ## // ## is the system call number +[SYS_function] sys_function // real system function name +extern int sys_function(void); // real system function declaration ~~~~ After adding these sentences to syscall files, we can implement real function in specific place where you want to make the function works well. Sometimes, we need to pass variables among system calls. In this case, variables’ values are not necessary and even can’t be pass directly into system_function. When invoke a system call function, all variables of this system call will be pushed into current process’ stack. In file *syscall.c*, multiple functions are provided to get these variables from the process. I won’t waste time on explaining how to use these functions especially when elegant and detailed comments were written in source codes. However, I will explain concepts and how process organized and works in xv6 in future articles. + +## Debug xv6 with gdb + +Please make sure that you have used gdb before. +If you never used gdb, you may write a simple 50-100 lines c code and practice how to use gdb first. + +- [GDB Manual](https://sourceware.org/gdb/current/onlinedocs/gdb/) +- [GDB cheatsheet (pdf)](https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf) + +To make sure xv6 gdb enabled, please check if *.gdbinit.tmpl* file exist. +This file is used for generate *.gdbinit* file which you can late consider it as a configuration for gdb. + +Before running the xv6 instance in QEMU, one more thing you need to know is that using gdb to debug xv6 must be attached remotely. +This is because xv6 was running within QEMU, and emulator is virtually gapped from the host device. +Later when you start debugging, QEMU will open a gdb server to let gdb client connect to. + +Once you want to start, using following command to compile and run xv6 + +~~~~bash +$ make qemu-nox-gdb +*** Now run 'gdb'. +qemu-system-i386 -nographic -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 7 +~~~~ + +At this moment, it feels xv6 was stuck, this is because QEMU is ready to be connected by the gdb client. +You may use the *.gdbinit* to automatically finish this remote connection by simple typein following command in another terminal. + +~~~~bash +$ gdb -x .gdbinit +GNU gdb (Debian 8.2.1-2+b3) 8.2.1 + +... + +The target architecture is assumed to be i8086 +[f000:fff0] 0xffff0: ljmp $0x3630,$0xf000e05b +0x0000fff0 in ?? () ++ symbol-file kernel +warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration +of GDB. Attempting to continue with the default i8086 settings. + +(gdb) +~~~~ + +Now within this gdb client shell, type 'c' to continue the xv6, and you will see xv6 start execution in the first terminal. + +At this moment, you may add breakpoints to your code to see if your code is correctly implemented or not. + +**One more thing**, if you open *.gdbinit* file, you'll find that it by default connect to a localhost target. +If you are working on some other environment that target and client were not placed in the same device, change the localhost to ip address correspondingly. +Using ssh may connect to different physical devices under same domain name, this is because load balancer were used. To check ip address, search command *ip*. + +~~~~bash +target remote localhost:28467 +# target remote [ip-addr]:28467 +~~~~ diff --git a/_posts/2020-09-15-generate-word-cloud-with-chinese-fenci.md b/_posts/2020-09-15-generate-word-cloud-with-chinese-fenci.md index 5b8dc16..d1ab58e 100644 --- a/_posts/2020-09-15-generate-word-cloud-with-chinese-fenci.md +++ b/_posts/2020-09-15-generate-word-cloud-with-chinese-fenci.md @@ -4,7 +4,12 @@ title: "Generate Word Cloud Figures with Chinese-Tokenization and WordCloud pyt date: 2020-09-15 22:00:14 -0400 categories: visualization --- - + +Let's generate a word cloud like this. +Don't understand the language is not a big deal. +If your written language is based on latin alphabet(or other language has space between words), skip tokenization. + + ## Background diff --git a/_site/404.html b/_site/404.html index 44d0f6f..8f3112b 100644 --- a/_site/404.html +++ b/_site/404.html @@ -6,7 +6,7 @@ - Page Not Found « Stop Talking, Start Doing - 停止空想,开始行动 + Page Not Found « Stop Talking, Start Doing @@ -14,7 +14,7 @@ - +