Moebius Strip

Total Page:16

File Type:pdf, Size:1020Kb

Moebius Strip Target_Core_ModTarget_Core_Mod v3.0,v3.0, aa ConfigFSConfigFS enabledenabled SCSISCSI targettarget infrastructureinfrastructure LinuxLinux StorageStorage andand FilesystemFilesystem Workshop,Workshop, ©09©09 NicholasNicholas A.A. Bellinger,Bellinger, Linux-iSCSI.orgLinux-iSCSI.org ChangesChanges fromfrom LIOLIO v2.9v2.9 toto v3.0v3.0 sincesince LSFLSF ©08©08 ● CodeCode hashas beenbeen importedimported intointo kernel.org/lio-core-2.6.gitkernel.org/lio-core-2.6.git whichwhich trackstracks linux-2.6.gitlinux-2.6.git (currently(currently atat v2.6.29)v2.6.29) ● GenericGeneric TargetTarget EngineEngine codecode andand subsystemsubsystem pluginsplugins (interface(interface toto Linux/SCSI,Linux/SCSI, Linux/BLOCKLinux/BLOCK andand Linux/VFS)Linux/VFS) hashas beenbeen seperatedseperated intointo target_core_modtarget_core_mod thatthat liveslives inin drivers/targetdrivers/target andand include/targetinclude/target ● AllAll IOCTLIOCTL codecode forfor thethe GenericGeneric TargetTarget EngineEngine andand LIO-LIO- TargetTarget (iSCSI(iSCSI TargetTarget fabricfabric module)module) hashas beenbeen convertedconverted toto 100%100% upstreamupstream ConfigFSConfigFS infrastructureinfrastructure ● Target_Core_Mod/ConfigFSTarget_Core_Mod/ConfigFS hashas beenbeen submittedsubmitted forfor reviewreview andand inclusioninclusion inin v2.6.30,v2.6.30, LIO-Target/ConfigFSLIO-Target/ConfigFS willwill bebe submittedsubmitted seperately.seperately. ChangesChanges fromfrom v2.9v2.9 toto v3.0,v3.0, ContinuedContinued ● ExhaustiveExhaustive supportsupport forfor SPC-3SPC-3 compliantcompliant PersistentPersistent ReservationsReservations ● InitialInitial supportsupport forfor implictimplict (out(out ofof band)band) AsymmetricAsymmetric LogicalLogical UnitUnit AssignmentAssignment LogicalLogical UnitUnit andand TargetTarget PortPort GroupsGroups throughthrough ConfigFSConfigFS ● 4k4k sectorsector supportsupport (physical(physical andand emulatedemulated support)support) ● AdditionalAdditional EVPDEVPD 0x830x83 DeviceDevice IdentifiersIdentifiers includingincluding NAANAA IEEEIEEE RegisteredRegistered ExtendedExtended AssignedAssigned designatordesignator formatformat fromfrom ConfigFSConfigFS providedprovided WWNWWN informationinformation ● UnitUnit AttentionAttention supportsupport ConfigFSConfigFS ● target_core_modtarget_core_mod createscreates thethe ConfigFSConfigFS groupgroup /sys/kernel/config/target/core/sys/kernel/config/target/core ● Linux/SCSI,Linux/SCSI, Linux/BLOCKLinux/BLOCK andand Linux/VFSLinux/VFS storagestorage HBAHBA andand objects/devicesobjects/devices areare registered/unregisteredregistered/unregistered mkdir(2),mkdir(2), rmdir(2)rmdir(2) andand echoecho throughthrough /sys/kernel/config//sys/kernel/config/ target/core/$HBA/$DEVtarget/core/$HBA/$DEV ● ConfigFSConfigFS symlinkssymlinks areare usedused toto createcreate SCSISCSI TargetTarget PortsPorts fromfrom storagestorage objectsobjects inin /sys/kernel/config/target//sys/kernel/config/target/ core/core/ toto SCSISCSI fabricfabric modulesmodules inin /sys/kernel/config/target/$FABRIC/sys/kernel/config/target/$FABRIC ConfigFSConfigFS layoutlayout /sys/kernel/config/target/core/$HBA/$DEV/sys/kernel/config/target/core/$HBA/$DEV groupsgroups andand attributes:attributes: alua_lu_gp/alua_lu_gp/ :: UsedUsed forfor ALUAALUA logicallogical unitunit groupsgroups attrib/:attrib/: AttributesAttributes likelike block_size,block_size, emulate_tas,emulate_tas, emulate_ua_intrlck_ctrl,emulate_ua_intrlck_ctrl, queue_depth,queue_depth, etc.etc. controlcontrol :: UsedUsed toto passpass parametersparameters toto subsystemsubsystem pluginsplugins enableenable :: UsedUsed toto enableenable storagestorage objectobject fd/fd/ :: UsedUsed toto passpass filefile descriptordescriptor toto subsystemsubsystem pluginsplugins pr/pr/ :: UsedUsed forfor SPC-3SPC-3 persistentpersistent resevationsresevations informationinformation wwn/wwn/ :: UsedUsed forfor T10T10 worldworld widewide uniqueunique namingnaming informationinformation ConfigFSConfigFS andand Linux/SCSILinux/SCSI RegisteringRegistering aa Linux/SCSILinux/SCSI StorageStorage Object:Object: mkdirmkdir -p-p /sys/kernel/config/target/core/pscsi_0/sdd/sys/kernel/config/target/core/pscsi_0/sdd /*/* UsingUsing FileFile DescriptorDescriptor method,method, alsoalso cancan useuse UDEVUDEV pathpath */*/ execexec 3<>/dev/sdd3<>/dev/sdd echoecho 33 >> /sys/kernel/config/target/core/pscsi_0/sdd/fd/sys/kernel/config/target/core/pscsi_0/sdd/fd execexec 3>&-3>&- /*/* Or,Or, usingusing parameterparameter methodmethod */*/ echoecho ©scsi_target_id=0,scsi_channel_id=0,scsi_lun_id=0©©scsi_target_id=0,scsi_channel_id=0,scsi_lun_id=0© // >> /sys/kernel/config/target/core/pscsi_0/sdd/control/sys/kernel/config/target/core/pscsi_0/sdd/control echoecho 11 >> /sys/kernel/config/target/core/pscsi_0/sdd/enable/sys/kernel/config/target/core/pscsi_0/sdd/enable ConfigFSConfigFS andand Linux/BLOCKLinux/BLOCK RegisteringRegistering aa Linux/BlockLinux/Block LVMLVM StorageStorage Object:Object: mkdirmkdir -p-p /sys/kernel/config/target/core/iblock_0/lvm_test0/sys/kernel/config/target/core/iblock_0/lvm_test0 /*/* UsingUsing FileFile DescriptorDescriptor method,method, alsoalso cancan useuse UDEVUDEV pathpath */*/ execexec 3<>/dev/lio-test/test03<>/dev/lio-test/test0 echoecho 33 >> /sys/kernel/config/target/core/iblock_0/lvm_test0/fd/sys/kernel/config/target/core/iblock_0/lvm_test0/fd execexec 3>&-3>&- /*/* Or,Or, usingusing parameterparameter methodmethod */*/ echoecho ©iblock_major=252,iblock_minor=2©©iblock_major=252,iblock_minor=2© // >> /sys/kernel/config/target/core/iblock_0/lvm_test0/control/sys/kernel/config/target/core/iblock_0/lvm_test0/control echoecho 11 >> /sys/kernel/config/target/core/iblock_0/lvm_test0/enable/sys/kernel/config/target/core/iblock_0/lvm_test0/enable ConfigFSConfigFS andand Linux/VFSLinux/VFS RegisteringRegistering aa Linux/VFSLinux/VFS FILEIOFILEIO storagestorage objectobject mkdirmkdir -p-p /sys/kernel/config/target/core/fileio_0/my_file0/sys/kernel/config/target/core/fileio_0/my_file0 /*/* UsingUsing parameterparameter method,method, alsoalso willwill automaticallyautomatically detectdetect sizesize fromfrom fd_dev_name=fd_dev_name= thatthat referencesreferences underlyingunderlying structstruct block_deviceblock_device */*/ echoecho ©fd_dev_name=/tmp/my_file,fd_dev_size=10000000©©fd_dev_name=/tmp/my_file,fd_dev_size=10000000© // >> /sys/kernel/config/target/core/fileio_0/my_file0/control/sys/kernel/config/target/core/fileio_0/my_file0/control echoecho 11 >> /sys/kernel/config/target/core/fileio_0/my_file0/enable/sys/kernel/config/target/core/fileio_0/my_file0/enable SPC-3SPC-3 PersistentPersistent Reservations:Reservations: WhatsWhats implemented..?implemented..? ● PROUTPROUT ServiceService Actions:Actions: REGISTER,REGISTER, RESERVE,RESERVE, RELEASE,RELEASE, CLEAR,CLEAR, REGISTER_AND_IGNORE,REGISTER_AND_IGNORE, PREEMPT,PREEMPT, andand PREEMPT_AND_ABORTPREEMPT_AND_ABORT ● AllAll PROUTPROUT ReservationReservation TypesTypes areare supported:supported: WriteWrite Exclusive,Exclusive, ExclusiveExclusive Access,Access, WriteWrite ExclusiveExclusive RegistrantsRegistrants Only,Only, ExclusiveExclusive AccessAccess RegistrantsRegistrants Only,Only, WriteWrite ExclusiveExclusive AllAll Registrants,Registrants, ExclusiveExclusive AccessAccess AllAll RegistrantsRegistrants ● AllAll PRINPRIN ServiceService Actions:Actions: READ_KEYS,READ_KEYS, READ_RESERVATION,READ_RESERVATION, REPORT_CAPABILITIES,REPORT_CAPABILITIES, READ_FULL_STATUSREAD_FULL_STATUS SPC-3SPC-3 PersistentPersistent Reservations:Reservations: WhatWhat clientsclients havehave beenbeen tested?tested? ● RHELRHEL v5u3v5u3 usingusing SCSISCSI FencingFencing (uses(uses WriteWrite Exclusive,Exclusive, RegistrantsRegistrants OnlyOnly andand PREEMPT_AND_ABORT)PREEMPT_AND_ABORT) usingusing ext3ext3 mounts.mounts. TestingTesting withwith GFSGFS (with(with multiplemultiple writers)writers) isis underwayunderway ● MSFTMSFT ClusterCluster 20082008 (uses(uses WriteWrite Exclusive,Exclusive, RegistrantsRegistrants OnlyOnly andand PREEMPT)PREEMPT) usingusing thethe MSFTMSFT domaindomain validationvalidation suitesuite SPC-3SPC-3 PersistentPersistent Reservations:Reservations: WhatsWhats leftleft toto implement..?implement..? ● ActivateActivate PersistPersist ThroughThrough PowerPower LossLoss (APTPL)(APTPL) usingusing /var/target/$HBA/$DEV/persist/var/target/$HBA/$DEV/persist fromfrom ConfigFSConfigFS storagestorage objectobject layoutlayout forfor registration/reservationregistration/reservation metadatametadata ● PROUTPROUT REGISTER_AND_MOVEREGISTER_AND_MOVE ServiceService ActionAction (Register(Register andand movemove reservation)reservation) ● SPEC_I_PTSPEC_I_PT (Allows(Allows multiplemultiple InitiatorsInitiators toto bebe registeredregistered withwith aa singlesingle PROUTPROUT ServiceService Action)Action) AsymmetricAsymmetric LogicalLogical UnitUnit Assignment:Assignment: WhatsWhats implemented?implemented? ● LogicalLogical UnitUnit GroupsGroups (per(per storagestorage object)object) ● TargetTarget PortPort GroupsGroups (per(per SCSISCSI targettarget port)port) ● ImplictImplict ALUAALUA (through(through ConfigFS)ConfigFS) ● OptmizedOptmized andand NonNon OptimizedOptimized ALUAALUA accessaccess statesstates ● REPORT_TARGET_PORT_GROUPSREPORT_TARGET_PORT_GROUPS AsymmetricAsymmetric LogicalLogical UnitUnit Assignment:Assignment: WhatWhat clients..?clients..? ● LinuxLinux usingusing thethe Open/iSCSIOpen/iSCSI InitiatorInitiator withwith thethe genericgeneric ALUAALUA handlerhandler (scsi_dh_alua)(scsi_dh_alua)
Recommended publications
  • Administering Unidata on UNIX Platforms
    C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData Administering UniData on UNIX Platforms UDT-720-ADMU-1 C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Notices Edition Publication date: July, 2008 Book number: UDT-720-ADMU-1 Product version: UniData 7.2 Copyright © Rocket Software, Inc. 1988-2010. All Rights Reserved. Trademarks The following trademarks appear in this publication: Trademark Trademark Owner Rocket Software™ Rocket Software, Inc. Dynamic Connect® Rocket Software, Inc. RedBack® Rocket Software, Inc. SystemBuilder™ Rocket Software, Inc. UniData® Rocket Software, Inc. UniVerse™ Rocket Software, Inc. U2™ Rocket Software, Inc. U2.NET™ Rocket Software, Inc. U2 Web Development Environment™ Rocket Software, Inc. wIntegrate® Rocket Software, Inc. Microsoft® .NET Microsoft Corporation Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation Windows® Microsoft Corporation Windows® 7 Microsoft Corporation Windows Vista® Microsoft Corporation Java™ and all Java-based trademarks and logos Sun Microsystems, Inc. UNIX® X/Open Company Limited ii SB/XA Getting Started The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them. License agreement This software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice.
    [Show full text]
  • Administració De Sistemes GNU Linux Mòdul4 Administració
    Administració local Josep Jorba Esteve PID_00238577 GNUFDL • PID_00238577 Administració local Es garanteix el permís per a copiar, distribuir i modificar aquest document segons els termes de la GNU Free Documentation License, Version 1.3 o qualsevol altra de posterior publicada per la Free Software Foundation, sense seccions invariants ni textos de la oberta anterior o posterior. Podeu consultar els termes de la llicència a http://www.gnu.org/licenses/fdl-1.3.html. GNUFDL • PID_00238577 Administració local Índex Introducció.................................................................................................. 5 1. Eines bàsiques per a l'administrador........................................... 7 1.1. Eines gràfiques i línies de comandes .......................................... 8 1.2. Documents d'estàndards ............................................................. 10 1.3. Documentació del sistema en línia ............................................ 13 1.4. Eines de gestió de paquets .......................................................... 15 1.4.1. Paquets TGZ ................................................................... 16 1.4.2. Fedora/Red Hat: paquets RPM ....................................... 19 1.4.3. Debian: paquets DEB ..................................................... 24 1.4.4. Nous formats d'empaquetat: Snap i Flatpak .................. 28 1.5. Eines genèriques d'administració ................................................ 36 1.6. Altres eines .................................................................................
    [Show full text]
  • Storage Administration Guide Storage Administration Guide SUSE Linux Enterprise Server 12 SP4
    SUSE Linux Enterprise Server 12 SP4 Storage Administration Guide Storage Administration Guide SUSE Linux Enterprise Server 12 SP4 Provides information about how to manage storage devices on a SUSE Linux Enterprise Server. Publication Date: September 24, 2021 SUSE LLC 1800 South Novell Place Provo, UT 84606 USA https://documentation.suse.com Copyright © 2006– 2021 SUSE LLC and contributors. All rights reserved. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”. For SUSE trademarks, see https://www.suse.com/company/legal/ . All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its aliates. Asterisks (*) denote third-party trademarks. All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its aliates, the authors nor the translators shall be held liable for possible errors or the consequences thereof. Contents About This Guide xii 1 Available Documentation xii 2 Giving Feedback xiv 3 Documentation Conventions xiv 4 Product Life Cycle and Support xvi Support Statement for SUSE Linux Enterprise Server xvii • Technology Previews xviii I FILE SYSTEMS AND MOUNTING 1 1 Overview
    [Show full text]
  • System Calls System Calls
    System calls We will investigate several issues related to system calls. Read chapter 12 of the book Linux system call categories file management process management error handling note that these categories are loosely defined and much is behind included, e.g. communication. Why? 1 System calls File management system call hierarchy you may not see some topics as part of “file management”, e.g., sockets 2 System calls Process management system call hierarchy 3 System calls Error handling hierarchy 4 Error Handling Anything can fail! System calls are no exception Try to read a file that does not exist! Error number: errno every process contains a global variable errno errno is set to 0 when process is created when error occurs errno is set to a specific code associated with the error cause trying to open file that does not exist sets errno to 2 5 Error Handling error constants are defined in errno.h here are the first few of errno.h on OS X 10.6.4 #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* Input/output error */ #define ENXIO 6 /* Device not configured */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file descriptor */ #define ECHILD 10 /* No child processes */ #define EDEADLK 11 /* Resource deadlock avoided */ 6 Error Handling common mistake for displaying errno from Linux errno man page: 7 Error Handling Description of the perror () system call.
    [Show full text]
  • The Gnu Binary Utilities
    The gnu Binary Utilities Version cygnus-2.7.1-96q4 May 1993 Roland H. Pesch Jeffrey M. Osier Cygnus Support Cygnus Support TEXinfo 2.122 (Cygnus+WRS) Copyright c 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modi®ed versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modi®ed versions. The GNU Binary Utilities Introduction ..................................... 467 1ar.............................................. 469 1.1 Controlling ar on the command line ................... 470 1.2 Controlling ar with a script ............................ 472 2ld.............................................. 477 3nm............................................ 479 4 objcopy ....................................... 483 5 objdump ...................................... 489 6 ranlib ......................................... 493 7 size............................................ 495 8 strings ........................................ 497 9 strip........................................... 499 Utilities 10 c++®lt ........................................ 501 11 nlmconv ....................................
    [Show full text]
  • System Calls and I/O
    System Calls and I/O CS 241 January 27, 2012 Copyright ©: University of Illinois CS 241 Staff 1 This lecture Goals Get you familiar with necessary basic system & I/O calls to do programming Things covered in this lecture Basic file system calls I/O calls Signals Note: we will come back later to discuss the above things at the concept level Copyright ©: University of Illinois CS 241 Staff 2 System Calls versus Function Calls? Copyright ©: University of Illinois CS 241 Staff 3 System Calls versus Function Calls Function Call Process fnCall() Caller and callee are in the same Process - Same user - Same “domain of trust” Copyright ©: University of Illinois CS 241 Staff 4 System Calls versus Function Calls Function Call System Call Process Process fnCall() sysCall() OS Caller and callee are in the same Process - Same user - OS is trusted; user is not. - Same “domain of trust” - OS has super-privileges; user does not - Must take measures to prevent abuse Copyright ©: University of Illinois CS 241 Staff 5 System Calls System Calls A request to the operating system to perform some activity System calls are expensive The system needs to perform many things before executing a system call The computer (hardware) saves its state The OS code takes control of the CPU, privileges are updated. The OS examines the call parameters The OS performs the requested function The OS saves its state (and call results) The OS returns control of the CPU to the caller Copyright ©: University of Illinois CS 241 Staff 6 Steps for Making a System Call
    [Show full text]
  • Also Includes Slides and Contents From
    The Compilation Toolchain Cross-Compilation for Embedded Systems Prof. Andrea Marongiu ([email protected]) Toolchain The toolchain is a set of development tools used in association with source code or binaries generated from the source code • Enables development in a programming language (e.g., C/C++) • It is used for a lot of operations such as a) Compilation b) Preparing Libraries Most common toolchain is the c) Reading a binary file (or part of it) GNU toolchain which is part of d) Debugging the GNU project • Normally it contains a) Compiler : Generate object files from source code files b) Linker: Link object files together to build a binary file c) Library Archiver: To group a set of object files into a library file d) Debugger: To debug the binary file while running e) And other tools The GNU Toolchain GNU (GNU’s Not Unix) The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and software for embedded systems. The GNU project produced a set of programming tools. Parts of the toolchain we will use are: -gcc: (GNU Compiler Collection): suite of compilers for many programming languages -binutils: Suite of tools including linker (ld), assembler (gas) -gdb: Code debugging tool -libc: Subset of standard C library (assuming a C compiler). -bash: free Unix shell (Bourne-again shell). Default shell on GNU/Linux systems and Mac OSX. Also ported to Microsoft Windows. -make: automation tool for compilation and build Program development tools The process of converting source code to an executable binary image requires several steps, each with its own tool.
    [Show full text]
  • The Power Supply Subsystem
    The Power Supply Subsystem Sebastian Reichel Collabora October 24, 2018 Open First Sebastian Reichel I Embedded Linux engineer at Collabora I Open Source Consultancy I Based in Oldenburg, Germany I Open Source contributor I Debian Developer I HSI and power-supply subsystem maintainer I Cofounder of Oldenburg's Hack(er)/Makerspace Open First The power-supply subsystem I batteries / fuel gauges I chargers I (board level poweroff/reset) I Originally written and maintained by Anton Vorontsov (2007-2014) Created by Blink@design from the Noun Project Created by Jenie Tomboc I Temporarily maintained by Dmitry from the Noun Project Eremin-Solenikov (2014) Open First Userspace Interface root@localhost# ls /sys/class/power_supply/ AC BAT0 BAT1 root@localhost# ls /sys/class/power_supply/BAT0 alarm energy_full_design status capacity energy_now subsystem capacity_level manufacturer technology charge_start_threshold model_name type charge_stop_threshold power uevent cycle_count power_now voltage_min_design ... root@localhost# cat /sys/class/power_supply/BAT0/capacity 65 Open First Userspace Interface root@localhost# udevadm info /sys/class/power_supply/BAT0 E: POWER_SUPPLY_CAPACITY=79 E: POWER_SUPPLY_ENERGY_FULL=15200000 E: POWER_SUPPLY_ENERGY_FULL_DESIGN=23200000 E: POWER_SUPPLY_ENERGY_NOW=12010000 E: POWER_SUPPLY_POWER_NOW=5890000 E: POWER_SUPPLY_STATUS=Discharging E: POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000 E: POWER_SUPPLY_VOLTAGE_NOW=11688000 ... Open First Userspace Interface I one power-supply device = one physical device I All values are in uV,
    [Show full text]
  • Ext4 File System and Crash Consistency
    1 Ext4 file system and crash consistency Changwoo Min 2 Summary of last lectures • Tools: building, exploring, and debugging Linux kernel • Core kernel infrastructure • Process management & scheduling • Interrupt & interrupt handler • Kernel synchronization • Memory management • Virtual file system • Page cache and page fault 3 Today: ext4 file system and crash consistency • File system in Linux kernel • Design considerations of a file system • History of file system • On-disk structure of Ext4 • File operations • Crash consistency 4 File system in Linux kernel User space application (ex: cp) User-space Syscalls: open, read, write, etc. Kernel-space VFS: Virtual File System Filesystems ext4 FAT32 JFFS2 Block layer Hardware Embedded Hard disk USB drive flash 5 What is a file system fundamentally? int main(int argc, char *argv[]) { int fd; char buffer[4096]; struct stat_buf; DIR *dir; struct dirent *entry; /* 1. Path name -> inode mapping */ fd = open("/home/lkp/hello.c" , O_RDONLY); /* 2. File offset -> disk block address mapping */ pread(fd, buffer, sizeof(buffer), 0); /* 3. File meta data operation */ fstat(fd, &stat_buf); printf("file size = %d\n", stat_buf.st_size); /* 4. Directory operation */ dir = opendir("/home"); entry = readdir(dir); printf("dir = %s\n", entry->d_name); return 0; } 6 Why do we care EXT4 file system? • Most widely-deployed file system • Default file system of major Linux distributions • File system used in Google data center • Default file system of Android kernel • Follows the traditional file system design 7 History of file system design 8 UFS (Unix File System) • The original UNIX file system • Design by Dennis Ritche and Ken Thompson (1974) • The first Linux file system (ext) and Minix FS has a similar layout 9 UFS (Unix File System) • Performance problem of UFS (and the first Linux file system) • Especially, long seek time between an inode and data block 10 FFS (Fast File System) • The file system of BSD UNIX • Designed by Marshall Kirk McKusick, et al.
    [Show full text]
  • Riscv-Software-Stack-Tutorial-Hpca2015
    Software Tools Bootcamp RISC-V ISA Tutorial — HPCA-21 08 February 2015 Albert Ou UC Berkeley [email protected] Preliminaries To follow along, download these slides at http://riscv.org/tutorial-hpca2015.html 2 Preliminaries . Shell commands are prefixed by a “$” prompt. Due to time constraints, we will not be building everything from source in real-time. - Binaries have been prepared for you in the VM image. - Detailed build steps are documented here for completeness but are not necessary if using the VM. Interactive portions of this tutorial are denoted with: $ echo 'Hello world' . Also as a reminder, these slides are marked with an icon in the upper-right corner: 3 Software Stack . Many possible combinations (and growing) . But here we will focus on the most common workflows for RISC-V software development 4 Agenda 1. riscv-tools infrastructure 2. First Steps 3. Spike + Proxy Kernel 4. QEMU + Linux 5. Advanced Cross-Compiling 6. Yocto/OpenEmbedded 5 riscv-tools — Overview “Meta-repository” with Git submodules for every stable component of the RISC-V software toolchain Submodule Contents riscv-fesvr RISC-V Frontend Server riscv-isa-sim Functional ISA simulator (“Spike”) riscv-qemu Higher-performance ISA simulator riscv-gnu-toolchain binutils, gcc, newlib, glibc, Linux UAPI headers riscv-llvm LLVM, riscv-clang submodule riscv-pk RISC-V Proxy Kernel (riscv-linux) Linux/RISC-V kernel port riscv-tests ISA assembly tests, benchmark suite All listed submodules are hosted under the riscv GitHub organization: https://github.com/riscv 6 riscv-tools — Installation . Build riscv-gnu-toolchain (riscv*-*-elf / newlib target), riscv-fesvr, riscv-isa-sim, and riscv-pk: (pre-installed in VM) $ git clone https://github.com/riscv/riscv-tools $ cd riscv-tools $ git submodule update --init --recursive $ export RISCV=<installation path> $ export PATH=${PATH}:${RISCV}/bin $ ./build.sh .
    [Show full text]
  • The Frege Programming Language ( Draft)
    The Frege Programming Language (Draft) by Ingo Wechsung last changed May 14, 2014 3.21.285 Abstract This document describes the functional programming language Frege and its implemen- tation for the Java virtual machine. Commonplace features of Frege are type inference, lazy evaluation, modularization and separate compile-ability, algebraic data types and type classes, pattern matching and list comprehension. Distinctive features are, first, that the type system supports higher ranked polymorphic types, and, second, that Frege code is compiled to Java. This allows for maximal interoperability with existing Java software. Any Java class may be used as an abstract data type, Java functions and methods may be called from Frege functions and vice versa. Despite this interoperability feature Frege is a pure functional language as long as impure Java functions are declared accordingly. What is or who was Frege? Friedrich Ludwig Gottlob Frege was a German mathematician, who, in the second half of the 19th century tried to establish the foundation of mathematics in pure logic. Al- though this attempt failed in the very moment when he was about to publish his book Grundgesetze der Arithmetik, he is nevertheless recognized as the father of modern logic among philosophers and mathematicians. In his essay Funktion und Begriff [1] Frege introduces a function that takes another function as argument and remarks: Eine solche Funktion ist offenbar grundverschieden von den bisher betrachteten; denn als ihr Argument kann nur eine Funktion auftreten. Wie nun Funktionen von Gegenst¨andengrundverschieden sind, so sind auch Funktionen, deren Argu- mente Funktionen sind und sein m¨ussen,grundverschieden von Funktionen, deren Argumente Gegenst¨andesind und nichts anderes sein k¨onnen.
    [Show full text]
  • System Calls and Standard I/O
    System Calls and Standard I/O Professor Jennifer Rexford http://www.cs.princeton.edu/~jrex 1 Goals of Today’s Class • System calls o How a user process contacts the Operating System o For advanced services that may require special privilege • Standard I/O library o Generic I/O support for C programs o A smart wrapper around I/O-related system calls o Stream concept, line-by-line input, formatted output, ... 2 1 System Calls 3 Communicating With the OS User Process signals systems calls Operating System • System call o Request to the operating system to perform a task o … that the process does not have permission to perform • Signal o Asynchronous notification sent to a process … to notify the process of an event that has occurred o 4 2 Processor Modes • The OS must restrict what a user process can do o What instructions can execute o What portions of the address space are accessible • Supervisor mode (or kernel mode) o Can execute any instructions in the instruction set – Including halting the processor, changing mode bit, initiating I/O o Can access any memory location in the system – Including code and data in the OS address space • User mode o Restricted capabilities – Cannot execute privileged instructions – Cannot directly reference code or data in OS address space o Any such attempt results in a fatal “protection fault” – Instead, access OS code and data indirectly via system calls 5 Main Categories of System Calls • File system o Low-level file I/O o E.g., creat, open, read, write, lseek, close • Multi-tasking mechanisms o Process
    [Show full text]