Freebsd and Netbsd on APM86290 System on Chip

Total Page:16

File Type:pdf, Size:1020Kb

Freebsd and Netbsd on APM86290 System on Chip FreeBSD and NetBSD on APM86290 System on Chip Zbigniew Bodek Semihalf [email protected] Abstract Single chip computers conquered not only the world of mobile devices, but are extensively be- This paper covers recent development ing used in the modern telecommunication sys- work on porting FreeBSD/powerpc and tems as they provide high performance data NetBSD/evbppc to the new APM86290 processing and a large number of capabilities system-on-chip from AppliedMicro. The combined with the low energy consumption and APM86290 is a dual core device compliant reasonable price. PowerPC is a superscalar, with the Book-E definition of the PowerPC RISC-like computer architecture, originally in- architecture, presenting a number of periph- troduced by Apple-IBM-Motorola (AIM) al- erals integrated in a single chip and labour liance. Initially designed for personal comput- efficiency improved by implementation of a ers, it became popular for embedded systems, message passing architecture. servers, super-computers, and gaming. The article focuses on presenting the dif- Fast evolving telecommunication industry ferences and similarities between FreeBSD and demands from the modern chips more and more NetBSD systems in the context of porting them packet processing power, along with the so- to an embedded architecture. The material phisticated capabilities concerning packet clas- briefly describes the influence of the innova- sification, security extensions, and acceleration tive inter-circuit communication architecture, subsystems designed to offload CPUs from the and data flow in the APM86290 chip on de- compute-intensive data servicing. vice drivers development. In particular the pa- per talks about the new architecture’s impact Every processor, even the most sophisti- on the FreeBSD’s and NetBSD’s drivers infras- cated one, is just an empty vessel without an tructure in example of the networking driver. operating system to have control over its func- tionality and behavior. There are a number of Finally, the overall focus of this paper is embedded operating systems available on the to compare FreeBSD’s and NetBSD’s portabil- market. Open source stands as winner among ity on the APM86290 example, to discuss prob- them thanks to its rapid development and relia- lems that may occur, and to compare diagnos- bility. FreeBSD and NetBSD are the two most tic, debugging and development tools that both popular representatives of the Unix-like oper- systems provide. ating systems, providing both: trustworthiness and a friendly BSD licence for computer system 1 Introduction manufacturers. During the past years, embedded sys- System selection is often a difficult chal- tems market has become a significant part of lenge for a developer as there is a vast variety the widely understood computer science area. and availability of operating systems. In the decision, one must take into account the exist- enables a multiple instruction and data address ing support for the target platform or time to breakpoints, data value compare, and single- achieve such support, portability of the soft- step, branch, trap and other debug events. Fi- ware that is going to be used by the client, and nally the PPC465 core implements the full, 32- system’s support for the chip’s extra features. bit fixed-point subset of the Book-E Enhanced PowerPC Architecture. This work describes the process of de- veloping an embedded operating system for a Furthermore, the on-chip processors are new platform - APM86290 from AppliedMicro assisted by a rich set of configurable hardware - in the frame of FreeBSD and NetBSD. The accelerators focused on the packet classifica- challenges of bringing-up drivers for peripherals tion, scheduling, packet/data manipulation and present on a chip and the special care taken over security. the new message passing architecture of net- These include: work controller introduced in the APM86290 are briefly described. Implementation details • Dedicated Ethernet Offload Engine are presented along with challenges and diffi- culties which were encountered during the de- • Queue Manager / Traffic Manager velopment. • Classification Engine Finally, the goal of this paper is to com- pare both systems concerning their portability, 2.1 Ethernet Offload Engine and hence to reveal their time to market capa- Ethernet Offload Engine integrated to the bilities. Differences between bringing-up of ma- APM86290 is capable of doing inline IPSec with jor subsystems are presented for both, FreeBSD greater than 2 Gbps line rate throughput, and and NetBSD operating systems. also provides inline TCP/IP and UDP check- sums calculation. It was designed to meet the 2 Hardware needs of low power all-IP networks. The APM86290 is the first chip from 2.2 Queue Manager / Traffic Manager AppliedMicro that incorporates two high per- formance PowerPC 465 processors in a single Queue Manager / Traffic Manager package. Each of them provides functional el- (QMTM) is an important element of the ements required by the most of modern em- APM86290’s design as it allows the most bedded systems. These functions include mem- efficient moving of data and packets between ory management, floating point unit (FPU), a the processors and integrated peripherals 32KB data and 32KB instruction cache. by using a message passing architecture. Communication interface offloads software The PPC465 processor connects to a from the routing of packets and transaction Level 2 cache through a high-performance Pro- synchronization. It can be therefore used cessor Local Bus 5 (PLB5), which supports to reduce communication overhead between hardware coherency. In addition, the L2 com- software and hardware. plex uses the MESI protocol to maintain mem- ory coherency for pages marked as such. Each 2.3 Classification Engine core has at its disposal a fully associative, 64 entry Translation Look-aside Buffer (TLB). De- Programmable Classification Engine sup- bug facilities that PPC465 provides constitute ports i.a. IPv4, IPv6 and AppleTalk packet an important feature from the software devel- classification, with greater than 2 Gbps line oper’s point of view. Hence, the PPC465 core rate throughput, offloading software from that is equipped with IEEE 1149.1 JTAG port that task. 2 3 Porting was a great start point as the ways of handling the core (which was the older brother of the The process of porting the operating sys- PPC465) were very instructive. In spite of all tem is divided into several stages, in which the the advantages, the forthcoming rebase to the development process is moving from the fulfill- current version was inevitable. ing prerequisites that include the cross-build toolchain and booting environment, through Regarding NetBSD, the baseline for the low-level system bootstrap and up to MMU work was the existing in the NetBSD 5.99 port support, peripheral devices support, execution for the MPC85XX - the PowerQUICC commu- of the userland applications and last but not nication processor from Freescale. Obviously least - stability and performance improvements. there was much more work to be done there because despite similarities, Book-E compati- All of the mentioned stages were elabo- bility, etc. the cores and hence the low-level rated during the work on the APM86290. Most areas of the system, were completely different. of them are presented in this paper, however, more important issues were discussed further at the expense of those less interesting in the 3.2 Cross-building environment context of the whole process. The first step to achieve was to set- Following phases were carefully depicted: up a cross-building environment. Suitable toolchain is an essential part of the develop- • Baseline code selection ment as it is required to generate proper ma- chine code for a target system. Both NetBSD • Cross-build toolchain preparation and FreeBSD sources provide the completely sufficient toolchains and scripts for building • System bootstrap kernel and root file system. The crosscompiling • Early kernel initialization in locore.S environment is required when building code for a target platform of different architecture than • Platform initialization the build host. Host’s operating system is no less important. FreeBSD can be built on the • Low-level memory management support FreeBSD hosts only, but NetBSD is suitable for • Device drivers along with support for building also on a different operating systems chip’s special features like Linux or other BSD thanks to the build.sh script which is attached to the source code. • Testing and debugging This basically consists of: 3.1 Baseline • ppc4xx crosscompiler Development versions of the FreeBSD 9.0 and NetBSD 5.99 have been chosen as a base • assembler for the upcoming ports. The first major de- cision was to choose an existing support for a • linker particular platform on which the development • other utilities will be based. It was reasonable to bounce from as similar platform as possible in order to mini- mize the effort of creating low-level parts of the Fortunately, FreeBSD 9.0 and system from scratch. Considering FreeBSD, the NetBSD 5.99 were equipped with the tools unofficial port for PPC460EX SoC developed mentioned above so that we could move by Semihalf has been chosen as a reference. Al- forward without any additional adjustments to though this port was based on FreeBSD 8.1 it that matter. 3 3.3 System bootstrap action involves creating initial mapping for the kernel text and data, only and therefore it cuts After power-up, the BootROM is off the processor from any of the mappings cre- launched by the processor so it can find and ated by the bootloader and the bootloader itself load the code to the RAM that is to be exe- (it won’t be "visible" in virtual space anymore). cuted. The role of this code, called firmware or first stage bootloader, is to perform early, Low-level initialization for the Book-E ar- low-level initialization of the DDR controller, chitecture compliant processor includes also an clocks, and power domains.
Recommended publications
  • Active-Active Firewall Cluster Support in Openbsd
    Active-Active Firewall Cluster Support in OpenBSD David Gwynne School of Information Technology and Electrical Engineering, University of Queensland Submitted for the degree of Bachelor of Information Technology COMP4000 Special Topics Industry Project February 2009 to leese, who puts up with this stuff ii Acknowledgements I would like to thank Peter Sutton for allowing me the opportunity to do this work as part of my studies at the University of Queensland. A huge thanks must go to Ryan McBride for answering all my questions about pf and pfsync in general, and for the many hours working with me on this problem and helping me test and debug the code. Thanks also go to Theo de Raadt, Claudio Jeker, Henning Brauer, and everyone else at the OpenBSD network hackathons who helped me through this. iii Abstract The OpenBSD UNIX-like operating system has developed several technologies that make it useful in the role of an IP router and packet filtering firewall. These technologies include support for several standard routing protocols such as BGP and OSPF, a high performance stateful IP packet filter called pf, shared IP address and fail-over support with CARP (Common Address Redundancy Protocol), and a protocol called pfsync for synchronisation of the firewalls state with firewalls over a network link. These technologies together allow the deployment of two or more computers to provide redundant and highly available routers on a network. However, when performing stateful filtering of the TCP protocol with pf, the routers must be configured in an active-passive configuration due to the current semantics of pfsync.
    [Show full text]
  • HP C User's Guide for Openvms Systems
    HP C User’s Guide for OpenVMS Systems Order Number: AA–PUNZM–TK January 2005 This guide describes using the HP C compiler on OpenVMS systems. It contains information on HP C program development in the OpenVMS environment, HP C features specific to OpenVMS systems, and cross-system portability concerns. Revision/Update Information: This revised guide supersedes the Compaq C User’s Guide for OpenVMS Systems Order No. AA–PUNZL–TK, Version 6.5. Operating System and Version: OpenVMS I64 Version 8.2 or higher OpenVMS Alpha Version 7.3-2 or higher Software Version: HP C Version 7.1 for OpenVMS Systems Hewlett-Packard Company Palo Alto, California © Copyright 2005 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. UNIX is a registered trademark of The Open Group. X/Open is a registered trademark of X/Open Company Ltd. in the UK and other countries. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
    [Show full text]
  • Real-Time Audio Servers on BSD Unix Derivatives
    Juha Erkkilä Real-Time Audio Servers on BSD Unix Derivatives Master's Thesis in Information Technology June 17, 2005 University of Jyväskylä Department of Mathematical Information Technology Jyväskylä Author: Juha Erkkilä Contact information: [email protected].fi Title: Real-Time Audio Servers on BSD Unix Derivatives Työn nimi: Reaaliaikaiset äänipalvelinsovellukset BSD Unix -johdannaisjärjestelmissä Project: Master's Thesis in Information Technology Page count: 146 Abstract: This paper covers real-time and interprocess communication features of 4.4BSD Unix derived operating systems, and especially their applicability for real- time audio servers. The research ground of bringing real-time properties to tradi- tional Unix operating systems (such as 4.4BSD) is covered. Included are some design ideas used in BSD-variants, such as using multithreaded kernels, and schedulers that can provide real-time guarantees to processes. Factors affecting the design of real- time audio servers are considered, especially the suitability of various interprocess communication facilities as mechanisms to pass audio data between applications. To test these mechanisms on a real operating system, an audio server and a client utilizing these techniques is written and tested on an OpenBSD operating system. The performance of the audio server and OpenBSD is analyzed, with attempts to identify some bottlenecks of real-time operation in the OpenBSD system. Suomenkielinen tiivistelmä: Tämä tutkielma kattaa reaaliaikaisuus- ja prosessien väliset kommunikaatio-ominaisuudet, keskittyen 4.4BSD Unix -johdannaisiin käyt- töjärjestelmiin, ja erityisesti siihen kuinka hyvin nämä soveltuvat reaaliaikaisille äänipalvelinsovelluksille. Tutkimusalueeseen sisältyy reaaliaikaisuusominaisuuk- sien tuominen perinteisiin Unix-käyttöjärjestelmiin (kuten 4.4BSD:hen). Mukana on suunnitteluideoita, joita on käytetty joissakin BSD-varianteissa, kuten säikeis- tetyt kernelit, ja skedulerit, jotka voivat tarjota reaaliaikaisuustakeita prosesseille.
    [Show full text]
  • Index Images Download 2006 News Crack Serial Warez Full 12 Contact
    index images download 2006 news crack serial warez full 12 contact about search spacer privacy 11 logo blog new 10 cgi-bin faq rss home img default 2005 products sitemap archives 1 09 links 01 08 06 2 07 login articles support 05 keygen article 04 03 help events archive 02 register en forum software downloads 3 security 13 category 4 content 14 main 15 press media templates services icons resources info profile 16 2004 18 docs contactus files features html 20 21 5 22 page 6 misc 19 partners 24 terms 2007 23 17 i 27 top 26 9 legal 30 banners xml 29 28 7 tools projects 25 0 user feed themes linux forums jobs business 8 video email books banner reviews view graphics research feedback pdf print ads modules 2003 company blank pub games copyright common site comments people aboutus product sports logos buttons english story image uploads 31 subscribe blogs atom gallery newsletter stats careers music pages publications technology calendar stories photos papers community data history arrow submit www s web library wiki header education go internet b in advertise spam a nav mail users Images members topics disclaimer store clear feeds c awards 2002 Default general pics dir signup solutions map News public doc de weblog index2 shop contacts fr homepage travel button pixel list viewtopic documents overview tips adclick contact_us movies wp-content catalog us p staff hardware wireless global screenshots apps online version directory mobile other advertising tech welcome admin t policy faqs link 2001 training releases space member static join health
    [Show full text]
  • Asiabsdcon 2008 Proceedings
    AsiaBSDCon 2008 Proceedings March 27-30, 2008 Tokyo, Japan Copyright c 2008 AsiaBSDCon 2008. All rights reserved. Unauthorized republication is prohibited. Published in Japan, March 2008 In Memory of Jun-ichiro “itojun” Hagino Our friend and colleague Jun-ichiro “itojun” Hagino (a BSD hacker famous for IPv6 implemen- tation, and CTO of ipv6samurais.com) was working as a member of our program committee, but he passed away on October 29th 2007. Itojun was a valued member of the BSD community both for his technical and personal contributions to various projects over his career. We who are working on AsiaBSDCon would like to express our condolences to Itojun’s family and friends and also to dedicate this year’s conference to his memory. INDEX P1A: PC-BSD: FreeBSD on the Desktop 001 Matt Olander (iXsystems) P1B: Tracking FreeBSD in a Commercial Setting 027 M. Warner Losh (Cisco Systems, Inc.) P3A: Gaols: Implementing Jails Under the kauth Framework 033 Christoph Badura (The NetBSD Foundation) P3B: BSD implementations of XCAST6 041 Yuji IMAI, Takahiro KUROSAWA, Koichi SUZUKI, Eiichi MURAMOTO, Katsuomi HAMAJIMA, Hajimu UMEMOTO, and Nobuo KAWAGUTI (XCAST fan club, Japan) P4A: Using FreeBSD to Promote Open Source Development Methods 049 Brooks Davis, Michael AuYeung, and Mark Thomas (The Aerospace Corporation) P4B: Send and Receive of File System Protocols: Userspace Approach With puffs 055 Antti Kantee (Helsinki University of Technology, Finland) P5A: Logical Resource Isolation in the NetBSD Kernel 071 Kristaps Džonsons (Centre for Parallel Computing, Swedish Royal Institute of Technology) P5B: GEOM—in Infrastructure We Trust 081 Pawel Jakub Dawidek (The FreeBSD Project) P6A: A Portable iSCSI Initiator 093 Alistair Crooks (The NetBSD Foundation) P8A: OpenBSD Network Stack Internals 109 Claudio Jeker (The OpenBSD Project) P8B: Reducing Lock Contention in a Multi-Core System 115 Randall Stewart (Cisco Systems, Inc.) P9A: Sleeping Beauty—NetBSD on Modern Laptops 127 Jörg Sonnenberger and Jared D.
    [Show full text]
  • Getting Started with Openbsd Device Driver Development
    Getting started with OpenBSD device driver development Stefan Sperling <[email protected]> EuroBSDcon 2017 Clarifications (1/2) Courtesy of Jonathan Gray (jsg@): We don't want source code to firmware We want to be able to redistribute firmware freely Vendor drivers are often poorly written, we need to be able to write our own We want documentation on the hardware interfaces Source code is not documentation OpenBSD Device Drivers 2/46 Clarifications (2/2) I would like to add: Device driver code runs in our kernel Firmware code runs on a peripheral device, not in our kernel When we say \Binary Blobs" we are talking about closed-source device drivers, not firmware Firmware often runs with high privileges; use at your own risk If you do not want closed-source firmware, then don't buy and use hardware which needs it We are software developers, we do not build hardware We will not sign NDAs Please talk to hardware vendors and advocate for change; the current situation is very bad for free software OpenBSD Device Drivers 3/46 This talk is for ... somewhat competent C programmers who use OpenBSD and would like to use a device which lacks support so have an itch to scratch (enhance or write a driver) but are not sure where to start perhaps are not sure how the development process works and will research all further details themselves The idea for this talk came about during conversations I had at EuroBSDcon 2016. Common question: "How do I add support for my laptop's wifi device?" OpenBSD Device Drivers 4/46 Itches I have scratched..
    [Show full text]
  • An Overview of Security in the Freebsd Kernel 131 Dr
    AsiaBSDCon 2014 Proceedings March 13-16, 2014 Tokyo, Japan Copyright c 2014 BSD Research. All rights reserved. Unauthorized republication is prohibited. Published in Japan, March 2014 INDEX P1A: Bold, fast optimizing linker for BSD — Luba Tang P1B: Visualizing Unix: Graphing bhyve, ZFS and PF with Graphite 007 Michael Dexter P2A: LLVM in the FreeBSD Toolchain 013 David Chisnall P2B: NPF - progress and perspective 021 Mindaugas Rasiukevicius K1: OpenZFS: a Community of Open Source ZFS Developers 027 Matthew Ahrens K2: Bambi Meets Godzilla: They Elope 033 Eric Allman P3A: Snapshots, Replication, and Boot-Environments—How new ZFS utilities are changing FreeBSD & PC-BSD 045 Kris Moore P3B: Netmap as a core networking technology 055 Luigi Rizzo, Giuseppe Lettieri, and Michio Honda P4A: ZFS for the Masses: Management Tools Provided by the PC-BSD and FreeNAS Projects 065 Dru Lavigne P4B: OpenBGPD turns 10 years - Design, Implementation, Lessons learned 077 Henning Brauer P5A: Introduction to FreeNAS development 083 John Hixson P5B: VXLAN and Cloud-based networking with OpenBSD 091 Reyk Floeter INDEX P6A: Nested Paging in bhyve 097 Neel Natu and Peter Grehan P6B: Developing CPE Routers based on NetBSD: Fifteen Years of SEIL 107 Masanobu SAITOH and Hiroki SUENAGA P7A: Deploying FreeBSD systems with Foreman and mfsBSD 115 Martin Matuška P7B: Implementation and Modification for CPE Routers: Filter Rule Optimization, IPsec Interface and Ethernet Switch 119 Masanobu SAITOH and Hiroki SUENAGA K3: Modifying the FreeBSD kernel Netflix streaming servers — Scott Long K4: An Overview of Security in the FreeBSD Kernel 131 Dr. Marshall Kirk McKusick P8A: Transparent Superpages for FreeBSD on ARM 151 Zbigniew Bodek P8B: Carve your NetBSD 165 Pierre Pronchery and Guillaume Lasmayous P9A: How FreeBSD Boots: a soft-core MIPS perspective 179 Brooks Davis, Robert Norton, Jonathan Woodruff, and Robert N.
    [Show full text]
  • Modernizing Netbsd Networking Facilities and Interrupt Handling
    Modernizing NetBSD Networking Facilities and Interrupt Handling Ryota Ozaki Kengo Nakahara [email protected] [email protected] Internet Initiative Japan Inc. Internet Initiative Japan Inc. Abstract This paper is organized as follows. Section 2 describes the current status of network processing in NetBSD. Sec- Networking facilities of NetBSD still have a lot of room tion 3 describes how to make networking facilities MP- for improvement, especially the scalability of its network safe; we pick vioif and bridge to explain that in de- processing is one of big issues that we have to address. tail. Section 4 and Section 5 describe how we support We have been working on making the network stack and hardware mentioned above in NetBSD. Section 6 reports network device drivers MP-safe to run NetBSD network- the results of preliminary performance evaluations on our ing facilities run in parallel. Supporting MSI/MSI-X and implementation. At last, Section 7 concludes the paper. multi-queue (with interrupt affinity) features of network devices in NetBSD device drivers is also an important task towards the goal. 2 Current Status of Network Processing This paper describes the current status of NetBSD net- working facilities and our recent work to improve them. In this section, we describe the current status of network The paper also reports the results of preliminary evalu- processing of NetBSD, including how the network facil- ations on our implementation and shows that our imple- ities of NetBSD work on multi-core systems, how tra- mentation scales up well on a multi-core system.
    [Show full text]
  • A Revisitation of Kernel Synchronization Schemes
    A Revisitation of Kernel Synchronization Schemes The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters Citation Small, Christopher and Stephen Manley. 1997. A Revisitation of Kernel Synchronization Schemes. Harvard Computer Science Group Technical Report TR-06-97. Citable link http://nrs.harvard.edu/urn-3:HUL.InstRepos:23996082 Terms of Use This article was downloaded from Harvard University’s DASH repository, and is made available under the terms and conditions applicable to Other Posted Material, as set forth at http:// nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of- use#LAA A version of this paper was published in the 1997 USENIX Annual Technical Conference Proceedings. A Revisitation of Kernel Synchronization Schemes Christopher Small and Stephen Manley Harvard University {chris,manley}@eecs.harvard.edu Abstract device. This is traditionally accomplished by communi- cating with an off-chip interrupt controller and masking In an operating system kernel, critical sections of code interrupts. Historically, the routines that perform this must be protected from interruption. This is traditionally service are named splintr, where intr is the name of the accomplished by masking the set of interrupts whose interrupt to disable. A special routine, splhigh, is used to handlers interfere with the correct operation of the criti- disable all interrupts. cal section. Because it can be expensive to communicate Most, if not all, conventional hardware platforms with an off-chip interrupt controller, more complex opti- allow device interrupts to be prioritized and assigned mistic techniques for masking interrupts have been pro- levels; a pending interrupt from a lower-level device can posed.
    [Show full text]
  • Jargon File, Version 4.0.0, 24 Jul 1996
    JARGON FILE, VERSION 4.0.0, 24 JUL 1996 This is the Jargon File, a comprehensive compendium of hacker slang illuminating many aspects of hackish tradition, folklore, and humor. This document (the Jargon File) is in the public domain, to be freely used, shared, and modified. There are (by intention) no legal restraints on what you can do with it, but there are traditions about its proper use to which many hackers are quite strongly attached. Please extend the courtesy of proper citation when you quote the File, ideally with a version number, as it will change and grow over time. (Examples of appropriate citation form: "Jargon File 4.0.0" or "The on-line hacker Jargon File, version 4.0.0, 24 JUL 1996".) The Jargon File is a common heritage of the hacker culture. Over the years a number of individuals have volunteered considerable time to maintaining the File and been recognized by the net at large as editors of it. Editorial responsibilities include: to collate contributions and suggestions from others; to seek out corroborating information; to cross-reference related entries; to keep the file in a consistent format; and to announce and distribute updated versions periodically. Current volunteer editors include: Eric Raymond [email protected] Although there is no requirement that you do so, it is considered good form to check with an editor before quoting the File in a published work or commercial product. We may have additional information that would be helpful to you and can assist you in framing your quote to reflect not only the letter of the File but its spirit as well.
    [Show full text]
  • Downloaded for Free From
    The Design of the NetBSD I/O Subsystems SungWon Chung Pusan National University 2 This book is dedicated to the open-source code developers in the NetBSD community. The original copy of this publication is available in an electronic form and it can be downloaded for free from http://arXiv.org. Copyright (c) 2002 by SungWon Chung. For non-commercial and personal use, this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic, mechanical, photocopying, recording or otherwise. For commercial use, no part of this publication can be reproduced by any means without the prior written permission of the author. NetBSD is the registered trademark of The NetBSD Foundation, Inc. Contents Preface 14 I Basics to Learn Filesystem 15 1 Welcome to the World of Kernel ! 17 1.1 How Does a System Call Dive into Kernel from User Program ? . 17 1.1.1 Example: write system call . 17 1.1.2 Ultra SPARC 0x7c CPU Trap . 18 1.1.3 Jump to the File Descriptor Layer . 24 1.1.4 Arriving at Virtual Filesystem Operations . 28 1.2 General Data Structures in Kernel such as List, Hash, Queue, ... 30 1.2.1 Linked-Lists . 30 1.2.2 Tail Queues . 34 1.2.3 Hash . 38 1.3 Waiting and Sleeping in Kernel . 39 1.4 Kernel Lock Manager . 39 1.4.1 simplelock and lock . 39 1.4.2 Simplelock Interfaces . 40 1.4.3 Lock Interfaces . 40 1.5 Kernel Memory Allocation . 43 1.6 Resource Pool Manager .
    [Show full text]
  • SMP Implementation for Openbsd/Sgi Takuya ASADA [email protected]
    SMP Implementation for OpenBSD/sgi Takuya ASADA [email protected] Abstract now have SMP support on the i386, amd64, mvme88k, sparc64 and macppc platforms. We started to implement SMP support for the Recently, sgi was added to the list of officially OpenBSD/sgi port and selected the SGI Octane as the supported architectures but without SMP support, de- first target machine. We are now at the point where we spite the SGI hardware range including multiprocessor have almost finished, except for the implementation of servers and workstations. We started to implement SMP some non-critical features. SMP support is now oper- support for OpenBSD/sgi and selected a SGI Octane as ational on SGI Octane systems and the code has been the first target machine. merged into the OpenBSD tree. 1 Introduction 2.2 Current status A year ago, I was working to add SMP and 64 bit sup- OpenBSD SMP now works correctly, however perfor- port to a BSD-based embedded operating system. The mance is still limited. The stage of our implementation target device was based on the MIPS64 architecture. is similar to the early versions of FreeBSD and NetBSD. At that time only FreeBSD had started to support SMP A significant amount of work still needs to be done in on MIPS, however only some of their code had been order to improve performance and scalability. merged into the public repository. As a result, I tried to implement SMP support in a step-by-step manner, refer- 2.2.1 Giant lock ring to the SMP implementations on other architectures.
    [Show full text]