Category: Uncategorized

BDO: 6/15/17

Life Skills

Crafting Progress

  • Epheria Sailboat (Worst Listed)
    • 20 Epheria Sailboat Design
      • 2/20 Obtained
    • 600 Steel
      • 3000 Coal, 15000 Iron Ore
        • 5 Melted Iron Shards + 5 Coal -> 1 Steel
          • 5 Iron Ore->1 Melted Iron Shard
    • 300 Flax Fabric
      • 15000 Flax
        • 10 Flax Thread ->1 Flax Fabric
          • 5 Flax -> 1 Flax Thread
    • 800 Standardized Timber Square
      • 80000 Logs
        • 10 Usable Scantling -> 1 Standardized Timber Square
          • 10 Logs = Usable Scantling
    • 1500 Pine Plywood
      • 75000 Pine Timber
        • 10 Pine Plank -> 1 Pine Plywood
          • 5 Pine Timber -> 1 Pine Plank

Characters

  • Qsugi
  • Qkishi

2.1.4 Loading and Executing a Program

  • Process for Loading a Program into memory and executing it
    1. The operating system (OS) searches for the program’s filename in the current disk directory.
    2. If it cannot find the name there, it searches a predetermined list of directories (called paths) for the filename. If the OS fails to find the program filename, it issues an error message.
    3.  If the program file is found, the OS retrieves basic information about the program’s file from the disk directory, including the file size and its physical location on the disk drive.
    4. The OS determines the next available location in memory and loads the program file into memory. It allocates a block of memory to the program and enters information about the program’s size and location into a table sometimes called a descriptor table). Additionally, the OS may adjust the values of pointers within the program so they contain addresses of program data.
    5. The OS begins execution of the program’s first machine instruction (its entry point). As soon as the program begins running, it is called a process. The OS assigns the process an identification number (process ID), which is used to keep track of it while running.
    6. The process runs by itself. It is the OS’s job to track the execution of the process and to respond to requests for system resources. Examples of resources are memory, disk files, and input-output devices.
    7. When the process ends, it is removed from memory

Physical Memory Layout

  • During initialization kernel builds a physical address map specifying which physical address ranges are usable/unusable by the kernel
    • Unusable physical addresses contain
      1. Addresses containing kernel code and data structures
      2. Hardware devices’ I/O shared memory
      3. BIOS data
  • In general Linux kernel begins at RAM address 0x00100000 the second megabyte

    • Often a typical config only uses 3 mb of RAM for the kernel
  • First megabyte is often reserved for BIOS routines
    • Page frame 0: POST
    • 0x000a0000 to 0x000fffff reserved for BIOS routines and mapping the internal memory of ISA (Industry Standard Architecture) Graphics Cards
      • 640kB to 1MB

Boot Sequence

  • Kernel queries BIOS and learns size of physical memory
  • Kernel invokes BIOS procedure to build a list of physical address ranges and their corresponding memory types
  • Kernel executes the
    machine_specific_memory_setup()

    function which builds the physical address map (discussed above)

    • If the BIOS version is not included in the kernel’s lookup table it marks 0x9f (LOWMEMSIZE()) to 0x100 (HIGH_MEMORY) as reserved by default
  • Kernel executes the
    setup_memory()

    which analyzes physical memory layout (2-10 table)

    • High memory defined by Gilles here.  In anyhow memory addresses is split into user space and kernel space.  If an app exceeds its limit and needs to map to kernel space it can do so.  This temporary map is called “high memory”

Capture.PNG

128 mB RAM Example (2^10*2^10)*2^7=1mB*2^7=1mB*128=128MB

Start End Type
 0x00000000  0x0009ffff  Usable
 0x000f0000  0x000fffff  Reserved
 0x00100000  0x07feffff  Usable
 0x07ff0000  0x07ff2fff  ACPI Data
 0x07ff3000  0x07ffffff  ACPI NVS
 0xffff0000  0xffffffff  Reserved
  • ACPI: Advanced Configuration and Power Interface
    1. perform discovery and configuration of computer hardware components
    2. to perform power management by (sleeping unused components)
    3. status monitoring.
  • NVS: Non Volatile Storage (?)
  • ACPI Data: Information about the hardware devices of system written by BIOS during POST
    • The kernel will copy this data and store it in a kernel data structure and then frees the addresses for use
  • ACPI NVS: Mapped to ROM chips of the hardware devices (which is NVS storage)
  • BIOS ROM: 0xffff0000 to 0xffffffff
  • The reason why the previously mentioned 0x000a0000 to 0x000fffff (640kb to 1mb) range is not in this table is because Linux assumes its reserved

 

3MB Kernel Image Layout

  • Avoid noncontiguous page frames therefore first 1MB is skipped even if there are available memory addresses
  • _text: Start at 0x00100000 first MB.  First byte of kernel code
  • _etext: End of kernel code
  • _edata: End of initialized data
  • _end: End of unintialized data
  • Note the page frame number each of the unspecified ones start at is generated at compilation depending on user options

capture

Process Management

Distinction Between Program Vs Process: Taken from here

  • Program is on disk (persistent mem) and contains only set of instructions to accomplish something
  • Process is an executing instance of a program
  • Therefore it is fair to say a program is static and a process is a dynamic program

 

exec() vs fork()

  • exec() is used to load a program into a previously terminated process’s address space and inherits the previous process’s resources
  • fork() is used to create a child process based upon its parent.  It is an exact duplicate of the parent process
    • Any process needs to point to both its parent and all child preocesses
  • _exit() terminates a process.  Done by releasing all used resources and sending the parent a SIGCHILD signal.

 

Zombie Processesterminated process which remains in the process table

  • Zombie processes remain in the process table until they recieve a wait4() system call from its parent then the parent deletes the process descriptor.
    • wait4() returns the resource usage information about the child in the structure pointed to (PID and such)
    • waitpid()
  • It is possible that a parent can terminate by accident which will leave child processes running and thus taking up precious resources
    • This is solved by system process init run at system initialization.  init will make all children point to it and then periodic run wait4() to clear useless children

 

Process Groups and Login Sessions

  • Process Groups are groups of processes required to complete a single task/job
    • Eg. ls | sort: list all directory and sort the shell acts on two processes which now are identified by a group ID (usually the first PID)
  • Login Session: Contains all descendant processes from the initial process from start.
    • All processes in a gropu must come from the same login session

 

Background VS Foreground Processes

  • Background processes do not need access to terminal and can run in the “background” without taking over the shell.
    • Shells can continue to receive more commands while having processes running in the background
      $ command &
  • Foreground processes need direct access to terminal and must be terminated before other commands may be input.
    • These types of processes might be a GUI based process
      $ command

Dynamic: That’s What it’s All About/Lost Pet/Killing Pokey (Blade and Soul)

There are only a few quirks when it comes to killing Pokey.

  1. Make sure to kill all of the eggs before the hatch
  2. If they do hatch make it your first priority to kill all the spawned scorpions (they do more damage than Pokey himself)
  3. If you’re confident about it you can counter all of Pokey’s attacks including the heavy attacks.  Doing so will stagger him and allow for a few more hits. (Counter+Iron Shoulder)

Playing as a Kung-Fu Master, it might be best to save the knockdown/mobbing attacks namely, Comet Strike and Rising Dragon, for the scorpion spawns as they don’t have much health.  For Comet Strike it’d be good if one could lure the minions into Pokey before unleashing the attack.

Here is a video of my character killing it.

Introduction

This is going to a personal blog where I blog about random things I find interesting, am doing, or need to remember in my life.  These topics will range from anything like anime to games and even things related to my academics.  I don’t know how often I’ll be posting but hopefully it will be somewhat regularly updated.