ahense
    • 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
    # Respuestas ## Checkpoint 1 ### 1 #### Modo Real El modo real provee un entorno de programación del Intel 8086, con algunas extensiones. #### Modo Protegido El modo protegido es el nativo del procesador. Este provee el set de instrucciones del procesador, y compatibilidad con el software base. #### Particularides * **Protegido**: 4Gb de memoria, posee 4 niveles de protección, rutinas de atencipon con privilegios, y el uso de una instruccion particular depende del nivel de privilegio. * **Real**: 1Mb disponible de memoria, no tiene privilegios, tiene rutinas de atención a interrupciones, y se pueden acceder a todas las instrucciones (del 8086). Y ademas es el modo en el que se inicia la PC. ### 2 #### Porque usar modo protegido? Por cuestiones de seguridad y para aprovechar el set de instrucciones completo del procesador y no solo limitarlo a las instruccciones del 8086. Ademas al estar corriendo en compatibilidad con un 8086 la memoria se ve limitada a solo 1Mb. Siendo que las computadoras actuales poseen mas de dicha capacidad, pasar a modo protegido nos permite utilizar un mayor rango de memoria (4Gb). Si quisieramos implementar un SO en modo real, suponiendo que es posible meterlo en 1Mb, un usuario de este SO, tendria el mismo privilegio que el mismo... Una de las razones por las cuales nos interesaria quedarnos en modo real, es la libertad de no tener restricciones a la hora de ejecutar instrucciones, esto se pierde al pasar al modo protegido. ### 3 #### Que es la GDT? Es una tabla con información sobre segmentos, como el tamaño, la ubicación, el estado,y access control. #### Como es el formato de un descriptor de segmento, bit a bit? Primera posicion de memoria: * (31 a 24): Base adress 31 a 24 * (23): G * (22 a 22): D/B * (21): L * (20): AVL * (19 a 16): Limite de Segmento * (15): P * (14 a 13): DPL * (12): S * (11 a 8): tipo * (7 a 0): Base de 23 a 16 Segunda pos de memoria: * (31 a 16) Base address * (15 a 0) Limite de segmento #### Bits detalles * **Limit**: Numero de 20bits que indica cuanta memoria ocupa el segmento a partird de la base. * **Base**: Inicio del segmento en la memoria de 32bits. * **G**: Si esta prendido el limite del segmento se calcula como el (num de 20bits) << 4, en otras palabras interpretado a 4Kb. Esto permite crear un segmento de hasta 4Gb. * **P**: Indica si el segmento esta en la RAM o no. Este bit se usa en un algoritmo interno del procesador para saber cuando un segmento se esta usando y cuando no para liberarlo de la RAM. * **DPL**: Especifica el nivel de privilegio del segmento. Los privilegios van de 0 a 3, donde 0 es el mas privilegiado. * **S**: Si esta en 0 indica que el segmento es de sistema, y si no, indica que el segmento o es codigo o es dato. Type depende de este flag. ### 4 #### Segmento de codigo execute/read Para que sea extrictamente execute/read (y que no sea a su vez access). (11,10,9,8)= (1,0,1,0) ### 6 #### extern gdt_entry_t gdt[] Contiene un arreglo de segmentos #### extern gdt_descriptor_t GDT_DESC Contiene informacion sobre la variable gdt[], (base y limite). ### 8 **LGDT Descripcion**: Carga los valores de source operand, en la GDTR o en el IDTR. El source operand tiene un lugar de mem q contiene una dir base, y el lim del gdt. En terminos del codigo del bootloader es la struct gdt_descriptor_t. En el archivo gdt.h la struct que almacena la información sobre la gdt es gdt_descriptor_t GDT_DESC, esta se inicializa en gdt.c luego de inicializar a la gdt. ### 13 CR0 es un registro de 32bits, que tiene 11 flags de 1bit, que hablan del sistema y los demas estan reservados. ###### Para ver el orden referir a la section 2.5 del manual, figura 2-7. CR0 PE Protection Enable (bit 0 of CR0) — Enables protected mode when set; enables real-address mode when clear. This flag does not enable paging directly. It only enables segment-level protection. To enable paging, both the PE and PG flags must be set. ### 17 $50*80*2=8000$, le restamos 1 y lo pasamos a hexa, $8000-1=7999=0x1F3F$, y este seria el limite. ### 18 **¿Qué creen que hace el método screen_draw_box?** dibuja un rectangulo de x fila por y columnas con un mismo caracter. **¿Cómo hace para acceder a la pantalla?** No tengo idea. Usa una matriz de ca, inicializada en VIDEO. **¿Qué estructura usa para representar cada carácter de la pantalla y cuanto ocupa en memoria?** ca, es una tupla(struct) de caracter x atributo donde los dos ocupan 8bits, ocupa en memoria 16bits.

    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