Kdan Qa
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 計算機組織相關 part 1 power on self-test 1. CPU 測試 2. BIOS 完整測試 3. 初始化晶片組 4. 記憶體測試 5. 從BIOS 載入bootstap並執行 6. 從Disk MBR 載入 OS Reader並執行 7. 載入OS 並執行,OS 接管系統 [OS的ppt](https://www.slideshare.net/ccckmit/10-73472927) Microkernel vs monolithic kernel ![](https://i.imgur.com/Tq6P1uz.jpg) ![](https://i.imgur.com/bXdXXI6.jpg) ![](https://i.imgur.com/tGAfCZa.jpg) # 計算機概論 ![](https://i.imgur.com/IEK2pE9.png) > 一點都不深入的了解 Compiler、 Interpreter 和 VM > https://www.spreered.com/compiler_for_dummies/?fbclid=IwAR1y0thJ6EzMA94Smltm6-chheJTSM-SE3yI_OxZV_rs0iKXZ6CbV6a2hWo von Neumann bottleneck: 在cpu與記憶體之間流量(資料傳輸率)與記憶體的容量相比起來相當小,資料運算的速度遠超過資料讀寫的速度。 DMA:DMA is the hardware mechanism that allows peripheral components to transfer their I/O data directly to and from main memory without the need for the system processor to be involved in the transfer ![](https://i.imgur.com/ypx6fba.png) Interrupt 種類: Program:由於一個指令執行完產生一些異常的condition時所產生的interrupt,ex /0, memory reference 超過許可的範圍 Timer:由processor中的timer所產生的 I/O:由I/O controller 所產生的Interupt Hardware failure:硬體產生的failure [MAR VS MDR](http://elect.taivs.tp.edu.tw/class89b/word/topic_research/no7/002.htm) [memory IO mapping](http://stenlyho.blogspot.com/2008/08/io.html) --- Contain vs vm ![](https://i.imgur.com/ZrJ5WWI.png) ![](https://i.imgur.com/Daf069z.jpg) --- ACL VS capability-based ![](https://i.imgur.com/ozvC2PD.jpg) --- PCB(Process Control Block) 一個process 一個table in kernel 1. process no. 2. process state:ready,running,waiting 3. programming counter:the next instruction address 4. cpu registers 5. cpu scheduling info 6. memory management info: base/limit register or page table or segment table 7. i/o status info 8. accounting info turing machine ![](https://i.imgur.com/ymG1acO.jpg) ![](https://i.imgur.com/u3J5bBB.png) ![](https://i.imgur.com/kDxILvW.jpg) 图灵测试(The Turing test)由艾伦·麦席森·图灵发明,指测试者与被测试者(一个人和一台机器)隔开的情况下,通过一些装置(如键盘)向被测试者随意提问。 进行多次测试后,如果机器让平均每个参与者做出超过30%的误判,那么这台机器就通过了测试,并被认为具有人类智能。图灵测试一词来源于计算机科学和密码学的先驱艾伦·麦席森·图灵写于1950年的一篇论文《计算机器与智能》,其中30%是图灵对2000年时的机器思考能力的一个预测,目前我们已远远落后于这个预测 turing machine VS Von Neumann architacture 圖靈機(turing machine)是英國數學家Alan Mathison Turing於1936年提出的一種抽象的計算模型,期更抽象的意義在為一種數學邏輯機,可以看作等價於任何有限邏輯數學過程的終極強大邏輯機器。 ![](https://i.imgur.com/p4ci92C.png) ![](https://i.imgur.com/TWTVx6Z.jpg) ![](https://i.imgur.com/oj0Uogo.jpg) heap overflow attack ![](https://i.imgur.com/JkJwOYV.jpg) 防止方法: 檢查資料長度,利用加強測試 feasible measure: 1. tech 2. economic 3. time 4. operation --- P : a problem can solved in Polynomially time 因此 P 是指 Polynomially time 的 P (多項式時間 即 O(n^k),k為一常數) NP-Problem: existed Non-deterministic algorithm can solved this problem in Polynomially time NP-hard: 若 All NP problem can polynomially reduce 成為 Q,則 我們稱 Q 這個問題 有 NP 這麼難 ,即為NP-hard NP-complete: 同時是NP-hard,也是 NP ![](https://i.imgur.com/pVGCqGI.png) --- ```c= #include <iostream> using namespace std; int main() { int i = 256; char *p = (char *)&i; // 取变量i的地址,强制转换为char *地址,赋给char *变量 p // 在VC系统中,int整型变量占4个字节,char类型数据只占1个字节。 // 所以这种转换将发生前面3个字节的数据截断丢失的现象,只能保留最后1个字节的数据。 // 由于256刚好超出1个字节的表示范围,高位的1存放在第2个字节, // 最后1个字节全为0。所以这里的转换结果为0 // 这里的 * 号是去引用操作符,有的也称为提取操作符。 // *p 的作用是取出char *类型p所指向的地址存放的数据,只取1个字节,所以结果为0 printf("%d\n", *p); int *q = &i; // *q 的作用是取出int *类型q所指向的地址存放的数据,取出4个字节的完整数据,所以结果为256 printf("%d\n", *q); // 由于127没超出1个字节的表示范围,数据都存放在最后1个字节里。所以转换结果为127 i = 127; printf("%d\n",*p); return 0; } //short 2 /* int 4 long 8 float 4 double 8 long double 12 char 1 //256=1 0000 0000; truncation error; *? ``` [多重繼承的問題](https://www.itread01.com/content/1550618849.html) ```java= interface CShape // 定義介面 CShape { final double PI=3.14; //final 可省略 public abstract void show(); //public abstract 可省略 } class CCircle implementation CShape { double radius; public CCircle(double r) //CCircle建構元 { radius=r; } public void show() //改寫介面中抽象函數 { System.out.println("面積="+PI*radius*radius); } } class CRectangle implements CShape { int width,height; public CRectangle(int w,int h) //CRectangle建構元 { width=w; height=h; } public void show() { System.out.println("area="+width*height); } } public class interface01 { public static void main(String args[]) { CShape shap01,shap02; //透過介面宣告變數 shap01=new CRectangle(5,10); shap01.show(); shap02=new CCircle(2.0); shap02.show(); } } ``` [disk 存取的最小單位 block sector ](https://ithelp.ithome.com.tw/articles/10053571) [hash 名詞](https://blog.kennycoder.io/2020/02/18/資料結構與演算法筆記-Hashing-雜湊原理介紹/) [backtracking 演算法](http://www.csie.sju.edu.tw/cm/course/alg/ch6-Backtracking.ppt) sleep vs hibernate ![](https://i.imgur.com/neKTIy4.jpg) RFQS vs RFPS vs RFIS ![](https://i.imgur.com/yTMpXkv.jpg) [磁碟存取演算法](https://video.openedu.tw/MobileMOOCs/2015/b02/講義/12.9磁碟存取.pdf)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully