<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
  <compounddef id="tty_8c" kind="file" language="C++">
    <compoundname>tty.c</compoundname>
    <includes refid="tty_8h" local="no">ubixos/tty.h</includes>
    <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes>
    <includes refid="spinlock_8h" local="no">ubixos/spinlock.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes>
    <includes refid="io_8h" local="no">sys/io.h</includes>
    <includes refid="string_8h" local="no">string.h</includes>
    <incdepgraph>
      <node id="13">
        <label>stdarg.h</label>
        <link refid="stdarg_8h"/>
      </node>
      <node id="10">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="15">
        <label>sys/io.h</label>
        <link refid="io_8h"/>
      </node>
      <node id="2">
        <label>ubixos/tty.h</label>
        <link refid="tty_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="17">
        <label>strings.h</label>
        <link refid="strings_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>sys/select.h</label>
        <link refid="select_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
      </node>
      <node id="11">
        <label>ubixos/spinlock.h</label>
        <link refid="spinlock_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/kernel/tty.c</label>
        <link refid="tty_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="14" relation="include">
        </childnode>
        <childnode refid="15" relation="include">
        </childnode>
        <childnode refid="16" relation="include">
        </childnode>
      </node>
      <node id="9">
        <label>sys/_sigset.h</label>
        <link refid="__sigset_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="14">
        <label>lib/kmalloc.h</label>
        <link refid="kmalloc_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="16">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>sys/types.h</label>
        <link refid="include_2sys_2types_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="12">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="6">
        <label>sys/cdefs.h</label>
        <link refid="cdefs_8h"/>
      </node>
      <node id="4">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="7">
        <label>sys/_timespec.h</label>
        <link refid="__timespec_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>sys/_timeval.h</label>
        <link refid="__timeval_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="var">
      <memberdef kind="variable" id="tty_8c_1a71910aae9a65de1b7375f236908f8a22" prot="public" static="yes" mutable="no">
        <type><ref refid="tty_8h_1ab4a376d082a021be5b9520e6c4987065" kindref="member">tty_term</ref> *</type>
        <definition>tty_term* terms</definition>
        <argsstring></argsstring>
        <name>terms</name>
        <initializer>= 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="37" column="17" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="37" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" prot="public" static="no" mutable="no">
        <type><ref refid="tty_8h_1ab4a376d082a021be5b9520e6c4987065" kindref="member">tty_term</ref> *</type>
        <definition>tty_term* tty_foreground</definition>
        <argsstring></argsstring>
        <name>tty_foreground</name>
        <initializer>= 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="38" column="10" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="38" bodyend="-1"/>
        <referencedby refid="atkbd_8c_1ac45fdeab51c3197c1e7c4ec7beabaca9" compoundref="atkbd_8c" startline="346" endline="393">getchar</referencedby>
        <referencedby refid="kpanic_8h_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</referencedby>
        <referencedby refid="video_8c_1a5429378b96a24fadfd2d1f8d777eb95a" compoundref="video_8c" startline="58" endline="106">kprint</referencedby>
        <referencedby refid="sysproto__posix_8h_1a635e457cca04f0435b1b25d0d6b987df" compoundref="file_8c" startline="76" endline="113">sys_fgetc</referencedby>
        <referencedby refid="vfs__calls_8c_1a883455624440fedf2b1af73d313e0ade" compoundref="vfs__calls_8c" startline="239" endline="291">sys_pread</referencedby>
        <referencedby refid="vfs__calls_8c_1a7678726e58a6393050f3b26e0b9b3152" compoundref="vfs__calls_8c" startline="151" endline="237">sys_read</referencedby>
        <referencedby refid="tty_8c_1a52a11053c56546a0dcb568942ada9c72" compoundref="tty_8c" startline="84" endline="113">tty_change</referencedby>
      </memberdef>
      <memberdef kind="variable" id="tty_8c_1a573341c9299efe182053e9ec49afc740" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structspinLock" kindref="compound">spinLock</ref></type>
        <definition>struct spinLock tty_spinLock</definition>
        <argsstring></argsstring>
        <name>tty_spinLock</name>
        <initializer>= <ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref></initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="38" column="10" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="39" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="tty_8c_1a52a11053c56546a0dcb568942ada9c72" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int tty_change</definition>
        <argsstring>(uInt16 tty)</argsstring>
        <name>tty_change</name>
        <param>
          <type><ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref></type>
          <declname>tty</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="84" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="84" bodyend="113"/>
        <references refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</references>
        <references refid="string_8h_1ae33b18edb618c656b9b795b9fce2316c">memcpy</references>
        <references refid="structtty__termNode_1ad7d6c2241ad060df43036b02a9a6ac26" compoundref="tty_8h" startline="37">tty_termNode::tty_buffer</references>
        <references refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" compoundref="tty_8c" startline="38">tty_foreground</references>
        <references refid="tty_8h_1aaf7550f4ba4072823e4085117944c5ef" compoundref="tty_8h" startline="34">TTY_MAX_TERMS</references>
      </memberdef>
      <memberdef kind="function" id="tty_8c_1a360dbff4aa208682a9943640a8696d66" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="tty_8h_1ab4a376d082a021be5b9520e6c4987065" kindref="member">tty_term</ref> *</type>
        <definition>tty_term* tty_find</definition>
        <argsstring>(uInt16 tty)</argsstring>
        <name>tty_find</name>
        <param>
          <type><ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref></type>
          <declname>tty</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="167" column="10" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="167" bodyend="169"/>
        <referencedby refid="exec_8c_1af80d4412d42ed1b5bf9a1b9774230f33" compoundref="exec_8c" startline="153" endline="330">execFile</referencedby>
        <referencedby refid="video_8c_1a5429378b96a24fadfd2d1f8d777eb95a" compoundref="video_8c" startline="58" endline="106">kprint</referencedby>
        <referencedby refid="systemtask_8h_1ac7cc6a806237f8657fcdce169319fd7f" compoundref="armv6_2systemtask_8c" startline="47" endline="117">systemTask</referencedby>
      </memberdef>
      <memberdef kind="function" id="tty_8c_1aab365abb615be7027fa0bdb2c09569cb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int tty_init</definition>
        <argsstring>()</argsstring>
        <name>tty_init</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="41" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="41" bodyend="77"/>
      </memberdef>
      <memberdef kind="function" id="tty_8c_1ab8811ced5425e47e4c5b0c8f086700ca" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int tty_print</definition>
        <argsstring>(char *string, tty_term *term)</argsstring>
        <name>tty_print</name>
        <param>
          <type>char *</type>
          <declname>string</declname>
        </param>
        <param>
          <type><ref refid="tty_8h_1ab4a376d082a021be5b9520e6c4987065" kindref="member">tty_term</ref> *</type>
          <declname>term</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c" line="115" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/tty.c" bodystart="115" bodyend="165"/>
        <references refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" compoundref="armv6_2spinlock_8c" startline="55" endline="61">spinLock</references>
        <referencedby refid="video_8c_1a5429378b96a24fadfd2d1f8d777eb95a" compoundref="video_8c" startline="58" endline="106">kprint</referencedby>
        <referencedby refid="include_2vfs_2file_8h_1a6b6b8f061ddd1e9631f0858ff0d83ff0" compoundref="file_8c" startline="47" endline="62">sys_fwrite</referencedby>
        <referencedby refid="file_8c_1a1a17e9753f6c9d2b34c35a2b2e7d240e" compoundref="file_8c" startline="66" endline="74">sysFwrite</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*-</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>*<sp/>Copyright<sp/>(c)<sp/>2002-2018<sp/>The<sp/>UbixOS<sp/>Project.</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>*<sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>*<sp/>This<sp/>was<sp/>developed<sp/>by<sp/>Christopher<sp/>W.<sp/>Olsen<sp/>for<sp/>the<sp/>UbixOS<sp/>Project.</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/>*<sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are<sp/>permitted</highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>*<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/>1)<sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>*<sp/>2)<sp/>Redistributions<sp/>in<sp/>binary<sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>other<sp/>materials<sp/>provided<sp/>with<sp/>the<sp/>distribution.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/>*<sp/>3)<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its<sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to</highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software<sp/>without<sp/>specific<sp/>prior<sp/>written</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>permission.</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>AUTHOR<sp/>AND<sp/>CONTRIBUTORS<sp/>&quot;AS<sp/>IS&quot;<sp/>AND<sp/>ANY<sp/>EXPRESS<sp/>OR<sp/>IMPLIED</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF<sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,<sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>*<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT<sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>*<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)<sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN</highlight></codeline>
<codeline lineno="25"><highlight class="comment"><sp/>*<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR<sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT</highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>*<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS<sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="27"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="tty_8h" kindref="compound">ubixos/tty.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="spinlock_8h" kindref="compound">ubixos/spinlock.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="io_8h" kindref="compound">sys/io.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="string_8h" kindref="compound">string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="structtty__termNode" kindref="compound">tty_term</ref><sp/>*terms<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="38" refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" refkind="member"><highlight class="normal"><ref refid="structtty__termNode" kindref="compound">tty_term</ref><sp/>*<ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structspinLock" kindref="compound">spinLock</ref><sp/>tty_spinLock<sp/>=<sp/><ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41" refid="tty_8c_1aab365abb615be7027fa0bdb2c09569cb" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="tty_8c_1aab365abb615be7027fa0bdb2c09569cb" kindref="member">tty_init</ref>()<sp/>{</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Allocate<sp/>memory<sp/>for<sp/>terminals<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/>terms<sp/>=<sp/>(<ref refid="structtty__termNode" kindref="compound">tty_term</ref><sp/>*)<sp/><ref refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structtty__termNode" kindref="compound">tty_term</ref>)<sp/>*<sp/><ref refid="tty_8h_1aaf7550f4ba4072823e4085117944c5ef" kindref="member">TTY_MAX_TERMS</ref>);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(terms<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;tty_init:<sp/>Failed<sp/>to<sp/>allocate<sp/>memory.<sp/>File:<sp/>%s,<sp/>Line:<sp/>%i\n&quot;</highlight><highlight class="normal">,<sp/>__FILE__,<sp/>__LINE__);</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>all<sp/>default<sp/>terminal<sp/>information<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="tty_8h_1aaf7550f4ba4072823e4085117944c5ef" kindref="member">TTY_MAX_TERMS</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/>terms[i].<ref refid="structtty__termNode_1ad7d6c2241ad060df43036b02a9a6ac26" kindref="member">tty_buffer</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/><ref refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(80<sp/>*<sp/>60<sp/>*<sp/>2);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(terms[i].tty_buffer<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;tty_init:<sp/>Failed<sp/>to<sp/>allocate<sp/>buffer<sp/>memory.<sp/>File:<sp/>%s,<sp/>Line:<sp/>%i\n&quot;</highlight><highlight class="normal">,<sp/>__FILE__,<sp/>__LINE__);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/>terms[i].<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref><sp/>=<sp/>terms[i].<ref refid="structtty__termNode_1ad7d6c2241ad060df43036b02a9a6ac26" kindref="member">tty_buffer</ref>;<sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>tty<sp/>pointer<sp/>to<sp/>internal<sp/>buffer<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/>terms[i].<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref><sp/>=<sp/>0x0;<sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>default<sp/>X<sp/>position<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/>terms[i].<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref><sp/>=<sp/>0x0;<sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>default<sp/>Y<sp/>position<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/>terms[i].<ref refid="structtty__termNode_1a06bfeceb1a07aa6c0602745a12be05b0" kindref="member">tty_colour</ref><sp/>=<sp/>0x0A<sp/>+<sp/>i;<sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>default<sp/>tty<sp/>text<sp/>colour<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Read<sp/>tty0<sp/>current<sp/>position<sp/>(to<sp/>migrate<sp/>from<sp/>kprintf).<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0e);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/>terms[0].<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref><sp/>=<sp/><ref refid="io_8h_1a77b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(0x3D5);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0f);</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/>terms[0].<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref><sp/>=<sp/><ref refid="io_8h_1a77b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(0x3D5);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>pointer<sp/>for<sp/>the<sp/>foreground<sp/>tty<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref><sp/>=<sp/>&amp;terms[0];</highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>up<sp/>the<sp/>foreground<sp/>ttys<sp/>information<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>0xB8000;</highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>to<sp/>let<sp/>kernel<sp/>know<sp/>initialization<sp/>is<sp/>complete<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;tty0<sp/>-<sp/>Initialized\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="75"><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="77"><highlight class="normal">}</highlight></codeline>
<codeline lineno="78"><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="80"><highlight class="comment"><sp/>This<sp/>will<sp/>change<sp/>the<sp/>specified<sp/>tty.<sp/>It<sp/>ultimately<sp/>copies<sp/>the<sp/>screen</highlight></codeline>
<codeline lineno="81"><highlight class="comment"><sp/>to<sp/>the<sp/>foreground<sp/>buffer<sp/>copies<sp/>the<sp/>new<sp/>ttys<sp/>buffer<sp/>to<sp/>the<sp/>screen<sp/>and</highlight></codeline>
<codeline lineno="82"><highlight class="comment"><sp/>adjusts<sp/>a<sp/>couple<sp/>pointers<sp/>and<sp/>we<sp/>are<sp/>good<sp/>to<sp/>go.</highlight></codeline>
<codeline lineno="83"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="84" refid="tty_8c_1a52a11053c56546a0dcb568942ada9c72" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="tty_8c_1a52a11053c56546a0dcb568942ada9c72" kindref="member">tty_change</ref>(<ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref><sp/>tty)<sp/>{</highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tty<sp/>&gt;<sp/><ref refid="tty_8h_1aaf7550f4ba4072823e4085117944c5ef" kindref="member">TTY_MAX_TERMS</ref>)</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>Changing<sp/>to<sp/>an<sp/>invalid<sp/>tty.<sp/>File:<sp/>%s,<sp/>Line:<sp/>%i\n&quot;</highlight><highlight class="normal">,<sp/>__FILE__,<sp/>__LINE__);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Copy<sp/>display<sp/>buffer<sp/>to<sp/>tty<sp/>buffer<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><ref refid="string_8h_1ae33b18edb618c656b9b795b9fce2316c" kindref="member">memcpy</ref>(<ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1ad7d6c2241ad060df43036b02a9a6ac26" kindref="member">tty_buffer</ref>,<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>0xB8000,<sp/>(80<sp/>*<sp/>60<sp/>*<sp/>2));</highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Copy<sp/>new<sp/>tty<sp/>buffer<sp/>to<sp/>display<sp/>buffer<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><ref refid="string_8h_1ae33b18edb618c656b9b795b9fce2316c" kindref="member">memcpy</ref>((</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>0xB8000,<sp/>terms[tty].tty_buffer,<sp/>(80<sp/>*<sp/>60<sp/>*<sp/>2));</highlight></codeline>
<codeline lineno="94"><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="96"><highlight class="comment"><sp/><sp/><sp/>Set<sp/>the<sp/>tty_pointer<sp/>to<sp/>the<sp/>internal<sp/>buffer<sp/>so<sp/>I<sp/>can<sp/>continue<sp/></highlight></codeline>
<codeline lineno="97"><highlight class="comment"><sp/><sp/><sp/>writing<sp/>to<sp/>what<sp/>it<sp/>believes<sp/>is<sp/>the<sp/>screen</highlight></codeline>
<codeline lineno="98"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref><sp/>=<sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1ad7d6c2241ad060df43036b02a9a6ac26" kindref="member">tty_buffer</ref>;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/>terms[tty].<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>0xB8000;</highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>set<sp/>new<sp/>foreground<sp/>tty<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref><sp/>=<sp/>&amp;terms[tty];</highlight></codeline>
<codeline lineno="105"><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Adjust<sp/>cursor<sp/>when<sp/>we<sp/>change<sp/>consoles<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0F);</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D5,<sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref>);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0E);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D5,<sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>-&gt;<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref>);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="113"><highlight class="normal">}</highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight></codeline>
<codeline lineno="115" refid="tty_8c_1ab8811ced5425e47e4c5b0c8f086700ca" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="tty_8c_1ab8811ced5425e47e4c5b0c8f086700ca" kindref="member">tty_print</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">,<sp/><ref refid="structtty__termNode" kindref="compound">tty_term</ref><sp/>*term)<sp/>{</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>bufferOffset<sp/>=<sp/>0x0,<sp/>character<sp/>=<sp/>0x0,<sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><ref refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" kindref="member">spinLock</ref>(&amp;tty_spinLock);</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>We<sp/>Need<sp/>To<sp/>Get<sp/>The<sp/>Y<sp/>Position<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/>bufferOffset<sp/>=<sp/>term-&gt;<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref>;</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/>bufferOffset<sp/>&lt;&lt;=<sp/>8;</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Then<sp/>We<sp/>Need<sp/>To<sp/>Add<sp/>The<sp/>X<sp/>Position<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/>bufferOffset<sp/>+=<sp/>term-&gt;<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref>;</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/>bufferOffset<sp/>&lt;&lt;=<sp/>1;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"></highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>((character<sp/>=<sp/>*</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">++))<sp/>{</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(character)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/></highlight><highlight class="charliteral">&apos;\n&apos;</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>bufferOffset<sp/>=<sp/>(bufferOffset<sp/>/<sp/>160)<sp/>*<sp/>160<sp/>+<sp/>160;</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[bufferOffset++]<sp/>=<sp/>character;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[bufferOffset++]<sp/>=<sp/>term-&gt;<ref refid="structtty__termNode_1a06bfeceb1a07aa6c0602745a12be05b0" kindref="member">tty_colour</ref>;</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="comment">/*<sp/>switch<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Check<sp/>To<sp/>See<sp/>If<sp/>We<sp/>Are<sp/>Out<sp/>Of<sp/>Bounds<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(bufferOffset<sp/>&gt;=<sp/>160<sp/>*<sp/>25)<sp/>{</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>160<sp/>*<sp/>24;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[i]<sp/>=<sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[i<sp/>+<sp/>160];</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>80;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[(160<sp/>*<sp/>24)<sp/>+<sp/>(i<sp/>*<sp/>2)]<sp/>=<sp/>0x20;</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1ac0868dddca6832ef5f791dd8d2606c7c" kindref="member">tty_pointer</ref>[(160<sp/>*<sp/>24)<sp/>+<sp/>(i<sp/>*<sp/>2)<sp/>+<sp/>1]<sp/>=<sp/>term-&gt;<ref refid="structtty__termNode_1a06bfeceb1a07aa6c0602745a12be05b0" kindref="member">tty_colour</ref>;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>bufferOffset<sp/>-=<sp/>160;</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/>bufferOffset<sp/>&gt;&gt;=<sp/>1;<sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>the<sp/>new<sp/>cursor<sp/>position<sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref><sp/>=<sp/>(bufferOffset<sp/>&amp;<sp/>0xFF);</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/>term-&gt;<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref><sp/>=<sp/>(bufferOffset<sp/>&gt;&gt;<sp/>0x8);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(term<sp/>==<sp/><ref refid="tty_8c_1aafbb5679104334c34d7691b2de7d7a86" kindref="member">tty_foreground</ref>)<sp/>{</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0f);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D5,<sp/>term-&gt;<ref refid="structtty__termNode_1a22e444939c17fda952c5924c8780aa8b" kindref="member">tty_x</ref>);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D4,<sp/>0x0e);</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_1a8acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(0x3D5,<sp/>term-&gt;<ref refid="structtty__termNode_1a9440a0dd6d9f9402e84725a303946bb9" kindref="member">tty_y</ref>);</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="161"><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;tty_spinLock);</highlight></codeline>
<codeline lineno="163"><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="165"><highlight class="normal">}</highlight></codeline>
<codeline lineno="166"><highlight class="normal"></highlight></codeline>
<codeline lineno="167" refid="tty_8c_1a360dbff4aa208682a9943640a8696d66" refkind="member"><highlight class="normal"><ref refid="structtty__termNode" kindref="compound">tty_term</ref><sp/>*<ref refid="tty_8c_1a360dbff4aa208682a9943640a8696d66" kindref="member">tty_find</ref>(<ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref><sp/>tty)<sp/>{</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(&amp;terms[tty]);</highlight></codeline>
<codeline lineno="169"><highlight class="normal">}</highlight></codeline>
<codeline lineno="170"><highlight class="normal"></highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight><highlight class="comment">/***</highlight></codeline>
<codeline lineno="172"><highlight class="comment"><sp/>END</highlight></codeline>
<codeline lineno="173"><highlight class="comment"><sp/>***/</highlight><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/kernel/tty.c"/>
  </compounddef>
</doxygen>
