nitron

commit f76ae36ce16253cd252ef177622c8344592b80bf

Author: yeti <mesyeti@noreply.codeberg.org>

Merge pull request 'WipBASIC' (#1) from WipBASIC into main

Reviewed-on: https://codeberg.org/non-bloat-collective/nitron/pulls/1

 LICENSE | 245 ----------
 basic-boot/.gitignore | 1 
 basic-boot/Makefile | 49 ++
 basic-boot/example.bas | 10 
 basic-boot/source/common.h | 9 
 basic-boot/source/error.c | 67 +++
 basic-boot/source/error.h | 14 
 basic-boot/source/lexer.c | 224 ++++++++++
 basic-boot/source/lexer.h | 70 +++
 basic-boot/source/main.c | 76 +++
 basic-boot/source/mem.c | 27 +
 basic-boot/source/mem.h | 11 
 basic-boot/source/parser.c | 664 ++++++++++++++++++++++++++++++
 basic-boot/source/parser.h | 127 +++++
 basic-boot/source/semanticAnalysis.c | 382 +++++++++++++++++
 basic-boot/source/semanticAnalysis.h | 9 
 basic-boot/source/state.c | 127 +++++
 basic-boot/source/state.h | 80 +++
 basic-boot/source/string.c | 48 ++
 basic-boot/source/string.h | 18 
 basic-boot/source/util.c | 16 
 basic-boot/source/util.h | 22 
 basic-boot/test.bas | 20 
 kernel/Makefile | 67 +++
 kernel/source/common.h | 7 
 kernel/source/vm.h | 8 


diff --git a/LICENSE b/LICENSE
index 63e04f1218d7cdaf1583416a86d414ce11f96cd2..9394813c610290b80fd99907c88d12cec4e32fdb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,232 +1,21 @@
-GNU GENERAL PUBLIC LICENSE
-Version 3, 29 June 2007
-
-Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
-
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
-
-Preamble
-
-The GNU General Public License is a free, copyleft license for software and other kinds of works.
-
-The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
-
-To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
-
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
-
-Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
-
-For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
-
-Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
-
-Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
-
-The precise terms and conditions for copying, distribution and modification follow.
-
-TERMS AND CONDITIONS
-
-0. Definitions.
+MIT License
 
-“This License” refers to version 3 of the GNU General Public License.
+Copyright (c) 2026 non-bloat collective
 
-“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
 
-“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
-To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
-
-A “covered work” means either the unmodified Program or a work based on the Program.
-
-To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
-
-To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
-
-An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
-
-1. Source Code.
-The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
-
-A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
-
-The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
-
-The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
-
-The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
-
-The Corresponding Source for a work in source code form is that same work.
-
-2. Basic Permissions.
-All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
-
-You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
-
-Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
-
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
-
-When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
-
-4. Conveying Verbatim Copies.
-You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
-
-You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
-
-5. Conveying Modified Source Versions.
-You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
-
-     a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
-
-     b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
-
-     c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
-
-     d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
-
-A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
-
-6. Conveying Non-Source Forms.
-You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
-
-     a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
-
-     b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
-
-     c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
-
-     d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
-
-     e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
-
-A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
-
-A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
-
-“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
-
-If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
-
-The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
-
-Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
-
-7. Additional Terms.
-“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
-
-When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
-
-Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
-
-     a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
-
-     b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
-
-     c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
-
-     d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
-
-     e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
-
-     f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
-
-All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
-
-If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
-
-Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
-
-8. Termination.
-You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
-
-However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
-
-Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
-
-9. Acceptance Not Required for Having Copies.
-You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
-
-10. Automatic Licensing of Downstream Recipients.
-Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
-
-An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
-
-You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
-
-11. Patents.
-A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
-
-A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
-
-Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
-
-In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
-
-If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
-
-If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
-
-A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
-
-Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
-
-12. No Surrender of Others' Freedom.
-If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
-
-13. Use with the GNU Affero General Public License.
-Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
-
-14. Revised Versions of this License.
-The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
-
-If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
-
-Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
-
-15. Disclaimer of Warranty.
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. Limitation of Liability.
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-17. Interpretation of Sections 15 and 16.
-If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
-
-     nitron
-     Copyright (C) 2026  non-bloat-collective
-
-     This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
-     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-
-     You should have received a copy of the GNU General Public License along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
-
-     nitron  Copyright (C) 2026  non-bloat-collective
-     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-     This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
-
-You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
-
-The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.




diff --git a/basic-boot/.gitignore b/basic-boot/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..631d23f7093ec4d51a6bf2ededb3b33c0630dd30
--- /dev/null
+++ b/basic-boot/.gitignore
@@ -0,0 +1 @@
+nitronb




diff --git a/basic-boot/Makefile b/basic-boot/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..785906776db0027224492a1270d26eb186a99c75
--- /dev/null
+++ b/basic-boot/Makefile
@@ -0,0 +1,49 @@
+SOURCES := $(wildcard source/*.c) $(wildcard source/**/*.c)
+OBJECTS := $(patsubst source/%.c,bin/%.o,$(SOURCES))
+OUT     := nitronb
+LD      := $(CC)
+
+override CFLAGS += -std=c99 -Wall -Wextra -Wuninitialized -Wundef -pedantic
+override LDLIBS += -lm
+
+ifeq ($(BUILD),release)
+	override CFLAGS += -O3
+	#override CPPFLAGS += -NDEBUG
+else
+	override CFLAGS += -Og -g
+	ifeq ($(ASAN), y)
+		override CFLAGS += -fno-omit-frame-pointer -fsanitize=address
+		override LDFLAGS += -fsanitize=address
+	endif
+endif
+
+.SECONDEXPANSION:
+
+deps.filter := %.c %.h
+deps.option := -MM
+define deps
+$$(filter $$(deps.filter),,$$(shell $(CC) $(CFLAGS) $(CPPFLAGS) -E $(deps.option) $(1)))
+endef
+
+all: $(OUT)
+	@:
+
+run: $(OUT)
+	'$(dir $<)$(notdir $<)' $(RUNFLAGS)
+
+$(OUT): $(OBJECTS)
+	$(LD) $(LDFLAGS) $^ $(LDLIBS) -o $@
+
+bin/:
+	mkdir -p bin
+
+bin/%.o: source/%.c $(call deps,source/%.c) | bin/
+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
+
+clean:
+	rm -r bin
+
+distclean: clean
+	rm $(OUT)
+
+.PHONY: all run clean distclean




diff --git a/basic-boot/example.bas b/basic-boot/example.bas
new file mode 100644
index 0000000000000000000000000000000000000000..2267bac07513ff4c398f934c27ab667969854ed0
--- /dev/null
+++ b/basic-boot/example.bas
@@ -0,0 +1,10 @@
+'NITRON
+
+extern C func puts(ptr(char)) int
+
+puts "Hello, world!"
+
+dim ret as int
+ret = puts("Hello again, world!")
+
+quit ret




diff --git a/basic-boot/source/common.h b/basic-boot/source/common.h
new file mode 100644
index 0000000000000000000000000000000000000000..94f4fb2029fd67dc73686715ded950e26256c9a6
--- /dev/null
+++ b/basic-boot/source/common.h
@@ -0,0 +1,9 @@
+#ifndef N_COMMON_H
+#define N_COMMON_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#endif




diff --git a/basic-boot/source/error.c b/basic-boot/source/error.c
new file mode 100644
index 0000000000000000000000000000000000000000..2149922c18c01d2bd86757208d040c3983d37e91
--- /dev/null
+++ b/basic-boot/source/error.c
@@ -0,0 +1,67 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include "mem.h"
+#include "error.h"
+
+#define FMT(RET, FORMAT) do { \
+	int     n    = 0; \
+	size_t  size = 0; \
+	va_list ap; \
+\
+	va_start(ap, FORMAT); \
+	n = vsnprintf(RET, size, FORMAT, ap); \
+	va_end(ap); \
+\
+	assert(n >= 0); \
+\
+	size = n + 1; \
+	RET = (char*) SafeMalloc(size); \
+	if (RET == NULL) { \
+		return; \
+	} \
+\
+	va_start(ap, FORMAT); \
+	n = vsnprintf(RET, size, FORMAT, ap); \
+	va_end(ap); \
+\
+	assert(n >= 0); \
+} while (0);
+
+void PrintError(ErrorInfo err, const char* format, ...) {
+	char* ret = NULL;
+
+	FMT(ret, format);
+
+	#if 0
+		fprintf(stderr, "error: %s:%d: %s\n", err.file, (int) err.line, ret);
+	#else
+		#define RED   "\x1b[31m"
+		#define BLUE  "\x1b[34m"
+		#define RESET "\x1b[0m"
+		fprintf(
+			stderr, RED "error: " BLUE "%s:%d: " RESET "%s\n",
+			err.file, (int) err.line, ret
+		);
+	#endif
+
+	exit(1);
+}
+
+void PrintWarning(ErrorInfo err, const char* format, ...) {
+	char* ret = NULL;
+
+	FMT(ret, format);
+
+	#if 0
+		fprintf(stderr, "error: %s:%d: %s\n", err.file, (int) err.line, ret);
+	#else
+		#define YELLOW "\x1b[33m"
+		#define BLUE   "\x1b[34m"
+		#define RESET  "\x1b[0m"
+		fprintf(
+			stderr, YELLOW "warning: " BLUE "%s:%d: " RESET "%s\n",
+			err.file, (int) err.line, ret
+		);
+	#endif
+}




diff --git a/basic-boot/source/error.h b/basic-boot/source/error.h
new file mode 100644
index 0000000000000000000000000000000000000000..de5ff9f8e56c78843c3d6aefae933fcc325e3de4
--- /dev/null
+++ b/basic-boot/source/error.h
@@ -0,0 +1,14 @@
+#ifndef N_ERROR_H
+#define N_ERROR_H
+
+#include "common.h"
+
+typedef struct {
+	const char* file;
+	size_t      line;
+} ErrorInfo;
+
+void PrintError(ErrorInfo err, const char* format, ...);
+void PrintWarning(ErrorInfo err, const char* format, ...);
+
+#endif




diff --git a/basic-boot/source/lexer.c b/basic-boot/source/lexer.c
new file mode 100644
index 0000000000000000000000000000000000000000..06ae344d28b518f6745713a23d6a05af98a2075c
--- /dev/null
+++ b/basic-boot/source/lexer.c
@@ -0,0 +1,224 @@
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include "lexer.h"
+#include "string.h"
+
+Lexer Lexer_Init(FILE* file, const char* fileName) {
+	Lexer lexer;
+	lexer.file     = file;
+	lexer.success  = true;
+	lexer.fileName = fileName;
+	lexer.line     = 1;
+	return lexer;
+}
+
+void Lexer_Free(Lexer* lexer) {
+	fclose(lexer->file);
+}
+
+static bool IsSeparator(char ch) {
+	switch (ch) {
+		case ' ':
+		case '\n':
+		case '\t':
+		case '(':
+		case ')':
+		case ',':
+		case '+':
+		case '-':
+		case '*':
+		case '/':
+		case '%':
+		case '=':
+		case '<':
+		case '>':
+		case '\'': return true;
+		default:   return false;
+	}
+}
+
+static bool IsNumeric(const char* str) {
+	size_t len = strlen(str);
+
+	for (size_t i = 0; i < len; ++ i) {
+		if ((str[i] < '0') || (str[i] > '9')) return false;
+	}
+
+	return true;
+}
+
+#define GET_CHAR(VAR) \
+	do { \
+		if (fread(&VAR, 1, 1, lexer->file) != 1) { \
+			return LEXER_EOF; \
+		} \
+		if (VAR == '\n') ++ lexer->line; \
+	} while (0);
+
+#define GET_CHAR_ERROR(VAR) \
+	do { \
+		if (fread(&VAR, 1, 1, lexer->file) != 1) { \
+			ErrorInfo err = {lexer->fileName, lexer->line}; \
+			PrintError(err, "Unexpected EOF"); \
+			lexer->success = false; \
+			return LEXER_EOF; \
+		} \
+		if (VAR == '\n') ++ lexer->line; \
+	} while (0);
+
+#define TOKEN(TYPE, CONTENTS) ((Token) \
+	{(TYPE), (ErrorInfo) {lexer->fileName, lexer->line}, (CONTENTS)})
+
+int Lexer_Next(Lexer* lexer, Token* token) {
+	char ch;
+
+	GET_CHAR(ch)
+
+	switch (ch) {
+		case '"': {
+			String string = String_New();
+
+			while (true) {
+				GET_CHAR_ERROR(ch)
+				if (ch == '"') break;
+
+				String_AddChar(&string, ch);
+			}
+
+			*token = TOKEN(TOKEN_STRING, string.contents);
+			return LEXER_TOKEN;
+		}
+		case '(':  *token = TOKEN(TOKEN_LPAREN,   NULL); return LEXER_TOKEN;
+		case ')':  *token = TOKEN(TOKEN_RPAREN,   NULL); return LEXER_TOKEN;
+		case ',':  *token = TOKEN(TOKEN_COMMA,    NULL); return LEXER_TOKEN;
+		case '+':  *token = TOKEN(TOKEN_ADD,      NULL); return LEXER_TOKEN;
+		case '-':  *token = TOKEN(TOKEN_SUBTRACT, NULL); return LEXER_TOKEN;
+		case '*':  *token = TOKEN(TOKEN_MULTIPLY, NULL); return LEXER_TOKEN;
+		case '/':  *token = TOKEN(TOKEN_DIVIDE,   NULL); return LEXER_TOKEN;
+		case '%':  *token = TOKEN(TOKEN_MOD,      NULL); return LEXER_TOKEN;
+		case '=':  *token = TOKEN(TOKEN_EQUAL,    NULL); return LEXER_TOKEN;
+		case '<':  *token = TOKEN(TOKEN_LESS,     NULL); return LEXER_TOKEN;
+		case '>':  *token = TOKEN(TOKEN_GREATER,  NULL); return LEXER_TOKEN;
+		case '\n': *token = TOKEN(TOKEN_LINE,     NULL); return LEXER_TOKEN;
+		case '\'': {
+			while (true) {
+				GET_CHAR(ch);
+
+				if (ch == '\n') {
+					return LEXER_NONE;
+				}
+			}
+			return LEXER_EOF;
+		}
+		case ' ':
+		case '\t':  return LEXER_NONE;
+		default: {
+			// must be an identifier, keyword, or integer
+			String string = String_FromChar(ch);
+
+			while (true) {
+				GET_CHAR_ERROR(ch)
+				if (IsSeparator(ch)) {
+					fseek(lexer->file, -1, SEEK_CUR);
+					if (ch == '\n') -- lexer->line;
+					break;
+				}
+
+				String_AddChar(&string, ch);
+			}
+
+			if (IsNumeric(string.contents)) {
+				*token = TOKEN(TOKEN_INT, string.contents);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "extern")) {
+				*token = TOKEN(TOKEN_EXTERN, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "func") || !strcmp(string.contents, "function")) {
+				*token = TOKEN(TOKEN_FUNC, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "sub")) {
+				*token = TOKEN(TOKEN_SUB, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "dim")) {
+				*token = TOKEN(TOKEN_DIM, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "as")) {
+				*token = TOKEN(TOKEN_AS, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "quit")) {
+				*token = TOKEN(TOKEN_QUIT, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "ptr")) {
+				*token = TOKEN(TOKEN_PTR, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+			if (!strcmp(string.contents, "end")) {
+				*token = TOKEN(TOKEN_END, NULL);
+				String_Free(&string);
+				return LEXER_TOKEN;
+			}
+
+			*token = TOKEN(TOKEN_IDENTIFIER, string.contents);
+			return LEXER_TOKEN;
+		}
+	}
+}
+
+const char* Lexer_TypeVAsString(TokenType type) {
+	switch (type) {
+		case TOKEN_NULL:       return "null";
+		case TOKEN_EXTERN:     return "extern";
+		case TOKEN_FUNC:       return "func";
+		case TOKEN_SUB:        return "sub";
+		case TOKEN_DIM:        return "dim";
+		case TOKEN_AS:         return "as";
+		case TOKEN_QUIT:       return "quit";
+		case TOKEN_PTR:        return "ptr";
+		case TOKEN_END:        return "end";
+		case TOKEN_IDENTIFIER: return "identifier";
+		case TOKEN_STRING:     return "string";
+		case TOKEN_INT:        return "int";
+		case TOKEN_LINE:       return "line";
+		case TOKEN_LPAREN:     return "lparen";
+		case TOKEN_RPAREN:     return "rparen";
+		case TOKEN_COMMA:      return "comma";
+		case TOKEN_ADD:        return "add";
+		case TOKEN_SUBTRACT:   return "subtract";
+		case TOKEN_MULTIPLY:   return "multiply";
+		case TOKEN_DIVIDE:     return "divide";
+		case TOKEN_MOD:        return "mod";
+		case TOKEN_EQUAL:      return "equal";
+		case TOKEN_LESS:       return "less";
+		case TOKEN_GREATER:    return "greater";
+		default:               assert(0);
+	}
+}
+
+const char* Lexer_TypeAsString(Token* token) {
+	return Lexer_TypeVAsString(token->type);
+}
+
+void Lexer_PrintToken(Token* token) {
+	printf("%s: %s\n", Lexer_TypeAsString(token), token->contents);
+}
+
+void Lexer_FreeToken(Token* token) {
+	if (token->contents) {
+		free(token->contents);
+	}
+}




diff --git a/basic-boot/source/lexer.h b/basic-boot/source/lexer.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f3e15fa515f4e38f3882d1480fa461bb3e6a706
--- /dev/null
+++ b/basic-boot/source/lexer.h
@@ -0,0 +1,70 @@
+#ifndef N_LEXER_H
+#define N_LEXER_H
+
+#include <stdio.h>
+#include "error.h"
+#include "common.h"
+
+typedef enum {
+	TOKEN_NULL = 0,
+
+	// keywords
+	TOKEN_EXTERN,
+	TOKEN_FUNC,
+	TOKEN_SUB,
+	TOKEN_DIM,
+	TOKEN_AS,
+	TOKEN_QUIT,
+	TOKEN_PTR,
+	TOKEN_END,
+
+	// misc
+	TOKEN_IDENTIFIER,
+	TOKEN_STRING,
+	TOKEN_INT,
+	TOKEN_LINE,
+
+	// characters
+	TOKEN_LPAREN,
+	TOKEN_RPAREN,
+	TOKEN_COMMA,
+
+	// operators
+	TOKEN_ADD,
+	TOKEN_SUBTRACT,
+	TOKEN_MULTIPLY,
+	TOKEN_DIVIDE,
+	TOKEN_MOD,
+	TOKEN_EQUAL,
+	TOKEN_LESS,
+	TOKEN_GREATER
+} TokenType;
+
+enum {
+	LEXER_TOKEN,
+	LEXER_EOF,
+	LEXER_NONE
+};
+
+typedef struct {
+	TokenType type;
+	ErrorInfo err;
+	char*     contents;
+} Token;
+
+typedef struct {
+	FILE*       file;
+	bool        success;
+	const char* fileName;
+	size_t      line;
+} Lexer;
+
+Lexer       Lexer_Init(FILE* file, const char* fileName);
+void        Lexer_Free(Lexer* lexer);
+int         Lexer_Next(Lexer* lexer, Token* token);
+const char* Lexer_TypeVAsString(TokenType type);
+const char* Lexer_TypeAsString(Token* token);
+void        Lexer_PrintToken(Token* token);
+void        Lexer_FreeToken(Token* token);
+
+#endif




diff --git a/basic-boot/source/main.c b/basic-boot/source/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..a8e3fa95d0afaa3a9ac44b0c75f86f336a150b30
--- /dev/null
+++ b/basic-boot/source/main.c
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <string.h>
+#include "lexer.h"
+#include "state.h"
+#include "parser.h"
+#include "common.h"
+#include "semanticAnalysis.h"
+
+int main(int argc, char** argv) {
+	const char* source = NULL;
+
+	bool printNodes  = false;
+	bool printTokens = false;
+
+	if (argc == 1) {
+		printf(
+			"Usage: %s SOURCE [FLAGS]\n", argv[0]
+		);
+	}
+
+	for (int i = 1; i < argc; ++ i) {
+		if (argv[i][0] != '-') {
+			if (source) {
+				fprintf(stderr, "Source file set multiple times");
+				return 1;
+			}
+
+			source = argv[i];
+		}
+		else if (strcmp(argv[i], "--dp") == 0) {
+			printNodes = true;
+		}
+		else if (strcmp(argv[i], "--dl") == 0) {
+			printTokens = true;
+		}
+		else {
+			fprintf(stderr, "Unknown flag: %s\n", argv[i]);
+			return 1;
+		}
+	}
+
+	if (!source) {
+		fprintf(stderr, "No source file provided\n");
+		return 1;
+	}
+
+	FILE* sourceFile = fopen(source, "r");
+
+	if (!sourceFile) {
+		fprintf(stderr, "Failed to open '%s'\n", source);
+		return 1;
+	}
+
+	Parser parser = Parser_Init(sourceFile, source, printTokens);
+
+	size_t len;
+	Node*  ret = Parser_Parse(&parser, &len);
+
+	if (printNodes) {
+		for (size_t i = 0; i < len; ++ i) {
+			Parser_PrintNode(&ret[i]);
+		}
+
+		return 0;
+	}
+
+	SemanticAnalysis_Init(8);
+
+	for (size_t i = 0; i < len; ++ i){
+		SemanticAnalysis_Analyse(&ret[i]);
+	}
+
+	State_DumpInfo();
+
+	return 0;
+}




diff --git a/basic-boot/source/mem.c b/basic-boot/source/mem.c
new file mode 100644
index 0000000000000000000000000000000000000000..bcef6460e47b9108ddcc2f316a9836fd77855b03
--- /dev/null
+++ b/basic-boot/source/mem.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include "mem.h"
+#include "common.h"
+
+void* SafeMalloc(size_t size) {
+	if (size == 0) return NULL;
+
+	void* ret = malloc(size);
+
+	if (ret == NULL) {
+		fprintf(stderr, "Malloc returned NULL\n");
+		exit(1);
+	}
+
+	return ret;
+}
+
+void* SafeRealloc(void* ptr, size_t size) {
+	void* ret = realloc(ptr, size);
+
+	if ((ret == NULL) && (size > 0)) {
+		fprintf(stderr, "Malloc returned NULL\n");
+		exit(1);
+	}
+
+	return ret;
+}




diff --git a/basic-boot/source/mem.h b/basic-boot/source/mem.h
new file mode 100644
index 0000000000000000000000000000000000000000..1254b31036c2ac43f2f96bc0063f85ab6766d742
--- /dev/null
+++ b/basic-boot/source/mem.h
@@ -0,0 +1,11 @@
+#ifndef N_MEM_H
+#define N_MEM_H
+
+#include "common.h"
+
+#define NEW(T) (T*) SafeMalloc(sizeof(T))
+
+void* SafeMalloc(size_t size);
+void* SafeRealloc(void* ptr, size_t size);
+
+#endif




diff --git a/basic-boot/source/parser.c b/basic-boot/source/parser.c
new file mode 100644
index 0000000000000000000000000000000000000000..2ae234724509cccb38c4a2cc5db7aacef610e5c1
--- /dev/null
+++ b/basic-boot/source/parser.c
@@ -0,0 +1,664 @@
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include "mem.h"
+#include "util.h"
+#include "parser.h"
+
+Parser Parser_Init(FILE* file, const char* fileName, bool printTokens) {
+	Parser ret;
+	Lexer  lexer = Lexer_Init(file, fileName);
+
+	Token* tokens    = SafeMalloc(64 * sizeof(Token));
+	size_t tokensLen = 0;
+	size_t tokensCap = 64;
+
+	bool lexing = true;
+	while (lexing) {
+		Token token;
+
+		int status = Lexer_Next(&lexer, &token);
+
+		switch (status) {
+			case LEXER_TOKEN: {
+				tokens[tokensLen] = token;
+				++ tokensLen;
+
+				if (tokensLen >= tokensCap) {
+					tokensCap += 64;
+					tokens     = SafeRealloc(tokens, tokensCap * sizeof(Token));
+				}
+				break;
+			}
+			case LEXER_EOF:  lexing = false; break;
+			case LEXER_NONE: continue;
+		}
+	}
+
+	tokens       = SafeRealloc(tokens, tokensLen * sizeof(Token));
+	ret.tokens   = tokens;
+	ret.tokenNum = tokensLen;
+	ret.i        = 0;
+
+	if (printTokens) {
+		for (size_t i = 0; i < tokensLen; ++ i) {
+			Lexer_PrintToken(&tokens[i]);
+		}
+
+		exit(0);
+	}
+
+	return ret;
+}
+
+#define INFO(TYPE) ((NodeInfo) {TYPE, p->tokens[p->i].err})
+
+static Node ParseBinary(Parser* p);
+static Node ParseNode(Parser* p);
+
+static void Advance(Parser* p) {
+	++ p->i;
+
+	if (p->i >= p->tokenNum) {
+		PrintError(p->tokens[p->tokenNum - 1].err, "Unexpected EOF");
+	}
+}
+
+static void Expect(Parser* p, TokenType type) {
+	if (p->tokens[p->i].type != type) {
+		Token token2;
+		token2.type = type;
+
+		PrintError(
+			p->tokens[p->i].err, "Expected %s, got %s",
+			Lexer_TypeAsString(&token2), Lexer_TypeAsString(&p->tokens[p->i])
+		);
+	}
+}
+
+static Node ParseAtom(Parser* p) {
+	Token* token = &p->tokens[p->i];
+	Node   ret;
+
+	Advance(p);
+
+	switch (token->type) {
+		case TOKEN_IDENTIFIER: {
+			ret.ident = (IdentifierNode) {INFO(NODE_IDENTIFIER), NewString(token->contents)};
+			return ret;
+		}
+		case TOKEN_STRING: {
+			ret.string = (StringNode) {INFO(NODE_STRING), NewString(token->contents)};
+			return ret;
+		}
+		case TOKEN_INT: {
+			ret.integer = (IntNode) {INFO(NODE_INT), atoi(token->contents)};
+			return ret;
+		}
+		case TOKEN_LPAREN: {
+			ret = ParseBinary(p);
+			Expect(p, TOKEN_RPAREN);
+			Advance(p);
+			return ret;
+		}
+		default: {
+			PrintError(
+				token->err, "Failed to parse atom, got %s",
+				Lexer_TypeAsString(token)
+			);
+			exit(1);
+		}
+	}
+}
+
+static bool IsUnaryOperator(Token* tok) {
+	switch (tok->type) {
+		case TOKEN_ADD:
+		case TOKEN_SUBTRACT: return true;
+		default:             return false;
+	}
+}
+
+static Node ParseUnary(Parser* p) {
+	Token* tok = &p->tokens[p->i];
+
+	if (IsUnaryOperator(tok)) {
+		Advance(p);
+		Node  operand    = ParseUnary(p);
+		Node* operandPtr = SafeMalloc(sizeof(Node));
+		*operandPtr      = operand;
+
+		Node ret;
+		ret.unary = (UnaryNode) {
+			INFO(NODE_UNARY_OP), operandPtr, tok->type
+		};
+		return ret;
+	}
+	else {
+		return ParseAtom(p);
+	}
+}
+
+static Node ParseMulDivMod(Parser* p) {
+	Node left = ParseUnary(p);
+
+	while (
+		(p->tokens[p->i].type == TOKEN_MULTIPLY) ||
+		(p->tokens[p->i].type == TOKEN_DIVIDE) ||
+		(p->tokens[p->i].type == TOKEN_MOD)
+	) {
+		TokenType op = p->tokens[p->i].type;
+		Advance(p);
+		Node right = ParseUnary(p);
+
+		Node* leftPtr  = SafeMalloc(sizeof(Node));
+		Node* rightPtr = SafeMalloc(sizeof(Node));
+		*leftPtr       = left;
+		*rightPtr      = right;
+
+		left.bin = (BinaryNode) {
+			INFO(NODE_BINARY_OP), leftPtr, rightPtr, op
+		};
+	}
+
+	return left;
+}
+
+static Node ParseAddSub(Parser* p) {
+	Node left = ParseMulDivMod(p);
+
+	while (
+		(p->tokens[p->i].type == TOKEN_ADD) ||
+		(p->tokens[p->i].type == TOKEN_SUB)
+	) {
+		TokenType op = p->tokens[p->i].type;
+		Advance(p);
+		Node right = ParseMulDivMod(p);
+
+		Node* leftPtr  = SafeMalloc(sizeof(Node));
+		Node* rightPtr = SafeMalloc(sizeof(Node));
+		*leftPtr       = left;
+		*rightPtr      = right;
+
+		left.bin = (BinaryNode) {
+			INFO(NODE_BINARY_OP), leftPtr, rightPtr, op
+		};
+	}
+
+	return left;
+}
+
+static Node ParseComparison(Parser* p) {
+	Node left = ParseAddSub(p);
+
+	while (
+		(p->tokens[p->i].type == TOKEN_EQUAL) ||
+		(p->tokens[p->i].type == TOKEN_LESS) ||
+		(p->tokens[p->i].type == TOKEN_GREATER)
+	) {
+		TokenType op = p->tokens[p->i].type;
+		Advance(p);
+		Node right = ParseAddSub(p);
+
+		Node* leftPtr  = SafeMalloc(sizeof(Node));
+		Node* rightPtr = SafeMalloc(sizeof(Node));
+		*leftPtr       = left;
+		*rightPtr      = right;
+
+		left.bin = (BinaryNode) {
+			INFO(NODE_BINARY_OP), leftPtr, rightPtr, op
+		};
+	}
+
+	return left;
+}
+
+static Node ParseBinary(Parser* p) {
+	return ParseComparison(p);
+}
+
+static Node ParseType(Parser* p) {
+	Node ret;
+
+	switch (p->tokens[p->i].type) {
+		case TOKEN_PTR: {
+			Advance(p);
+			Expect(p, TOKEN_LPAREN);
+			Advance(p);
+
+			Node innerType = ParseType(p);
+			ret.ptr = (PtrNode) {INFO(NODE_PTR), SafeMalloc(sizeof(Node))};
+			*ret.ptr.inner = innerType;
+
+			Advance(p);
+			Expect(p, TOKEN_RPAREN);
+			return ret;
+		}
+		case TOKEN_IDENTIFIER: {
+			ret.ident = (IdentifierNode) {
+				INFO(NODE_IDENTIFIER), NewString(p->tokens[p->i].contents)
+			};
+			return ret;
+		}
+		default: {
+			PrintError(
+				p->tokens[p->i].err, "Unexpected %s token in type",
+				Lexer_TypeAsString(&p->tokens[p->i])
+			);
+			exit(1);
+		}
+	}
+}
+
+static FuncDec ParseFuncDec(Parser* p) {
+	FuncDecParam* params    = NULL;
+	size_t        paramsNum = 0;
+
+	bool sub = p->tokens[p->i].type == TOKEN_SUB;
+
+	Advance(p);
+	FuncDec ret;
+
+	Expect(p, TOKEN_IDENTIFIER);
+	ret.name = NewString(p->tokens[p->i].contents);
+
+	Advance(p);
+	Expect(p, TOKEN_LPAREN);
+	Advance(p);
+
+	while (p->tokens[p->i].type != TOKEN_RPAREN) {
+		FuncDecParam param;
+		Expect(p, TOKEN_IDENTIFIER);
+		param.name = NewString(p->tokens[p->i].contents);
+
+		Advance(p);
+		Expect(p, TOKEN_AS);
+
+		Advance(p);
+		Node  typeNode = ParseType(p);
+		Node* typePtr  = SafeMalloc(sizeof(Node));
+		*typePtr       = typeNode;
+		param.type     = typePtr;
+
+		++ paramsNum;
+		params = SafeRealloc(params, paramsNum * sizeof(FuncDecParam));
+		params[paramsNum - 1] = param;
+
+		Advance(p);
+		if (
+			(p->tokens[p->i].type != TOKEN_COMMA) &&
+			(p->tokens[p->i].type != TOKEN_RPAREN)
+		) {
+			PrintError(
+				p->tokens[p->i].err, "Unexpected %s token in parameter list",
+				Lexer_TypeAsString(&p->tokens[p->i])
+			);
+		}
+
+		if (p->tokens[p->i].type == TOKEN_COMMA) {
+			Advance(p);
+		}
+	}
+
+	ret.params    = params;
+	ret.paramsNum = paramsNum;
+
+	Advance(p);
+	if (sub) {
+		Expect(p, TOKEN_LINE);
+	}
+	else {
+		ret.ret  = SafeMalloc(sizeof(Node));
+		*ret.ret = ParseType(p);
+		Advance(p);
+		Expect(p, TOKEN_LINE);
+	}
+
+	return ret;
+}
+
+static Node ParseFuncDef(Parser* p) {
+	FuncDefNode ret;
+	ret.i   = INFO(NODE_FUNC_DEF);
+	ret.dec = ParseFuncDec(p);
+	Advance(p);
+
+	ret.body    = NULL;
+	ret.bodyLen = 0;
+
+	while (p->tokens[p->i].type != TOKEN_END) {
+		if (p->tokens[p->i].type == TOKEN_LINE) {
+			Advance(p);
+			continue;
+		}
+
+		Node node = ParseNode(p);
+
+		++ ret.bodyLen;
+		ret.body = SafeRealloc(ret.body, ret.bodyLen * sizeof(Node));
+		ret.body[ret.bodyLen - 1] = node;
+	}
+
+	Advance(p);
+	Expect(p, TOKEN_LINE);
+
+	Node node;
+	node.funcDef = ret;
+	return node;
+}
+
+static Node ParseDim(Parser* p) {
+	DimNode ret;
+	ret.i = INFO(NODE_DIM);
+
+	Advance(p);
+	Expect(p, TOKEN_IDENTIFIER);
+	ret.name = NewString(p->tokens[p->i].contents);
+
+	Advance(p);
+	Expect(p, TOKEN_AS);
+
+	Advance(p);
+	ret.varType  = SafeMalloc(sizeof(Node));
+	*ret.varType = ParseType(p);
+
+
+	Advance(p);
+	Expect(p, TOKEN_LINE);
+
+	Node node;
+	node.dim = ret;
+	return node;
+}
+
+static Node ParseFuncCall(Parser* p) {
+	FuncCallNode ret;
+	ret.i    = INFO(NODE_FUNC_CALL);
+	ret.func = NewString(p->tokens[p->i].contents);
+
+	Advance(p);
+	Node*  params    = NULL;
+	size_t paramsNum = 0;
+
+	while (p->tokens[p->i].type != TOKEN_LINE) {
+		Node param = ParseBinary(p);
+
+		++ paramsNum;
+		params                = SafeRealloc(params, paramsNum * sizeof(Node));
+		params[paramsNum - 1] = param;
+
+		if (
+			(p->tokens[p->i].type != TOKEN_LINE) &&
+			(p->tokens[p->i].type != TOKEN_COMMA)
+		) {
+			PrintError(
+				p->tokens[p->i].err, "Unexpected %s token in parameter list",
+				Lexer_TypeAsString(&p->tokens[p->i])
+			);
+		}
+		if (p->tokens[p->i].type == TOKEN_COMMA) {
+			Advance(p);
+		}
+	}
+
+	ret.params    = params;
+	ret.paramsNum = paramsNum;
+
+	Node node;
+	node.funcCall = ret;
+	return node;
+}
+
+static Node ParseAssign(Parser* p) {
+	AssignNode ret;
+	ret.i        = INFO(NODE_ASSIGN);
+	ret.variable = NewString(p->tokens[p->i].contents);
+
+	Advance(p);
+	Expect(p, TOKEN_EQUAL);
+	Advance(p);
+
+	ret.rValue  = SafeMalloc(sizeof(Node));
+	*ret.rValue = ParseBinary(p);
+
+	Expect(p, TOKEN_LINE);
+
+	Node node;
+	node.assign = ret;
+	return node;
+}
+
+static Node ParseNode(Parser* p) {
+	switch (p->tokens[p->i].type) {
+		case TOKEN_FUNC:
+		case TOKEN_SUB: return ParseFuncDef(p);
+		case TOKEN_DIM: return ParseDim(p);
+		case TOKEN_IDENTIFIER: {
+			if (p->i == p->tokenNum - 1) {
+				PrintError(p->tokens[p->i].err, "Unexpected EOF");
+			}
+
+			if (p->tokens[p->i + 1].type == TOKEN_EQUAL) {
+				return ParseAssign(p);
+			}
+
+			return ParseFuncCall(p);
+		}
+		default: {
+			PrintError(
+				p->tokens[p->i].err, "Unexpected %s token",
+				Lexer_TypeAsString(&p->tokens[p->i])
+			);
+			exit(1);
+		}
+	}
+}
+
+void Parser_PrintNode(Node* node) {
+	switch (node->i.type) {
+		case NODE_INT: printf("%d", node->integer.value); break;
+		case NODE_STRING: printf("%s", node->string.value); break;
+		case NODE_IDENTIFIER: printf("%s", node->ident.name); break;
+		case NODE_BINARY_OP: {
+			printf("(");
+			Parser_PrintNode(node->bin.left);
+
+			switch (node->bin.op) {
+				case TOKEN_ADD:      printf("+"); break;
+				case TOKEN_SUBTRACT: printf("-"); break;
+				case TOKEN_MULTIPLY: printf("*"); break;
+				case TOKEN_DIVIDE:   printf("/"); break;
+				case TOKEN_MOD:      printf("%%"); break;
+				case TOKEN_EQUAL:    printf("="); break;
+				case TOKEN_LESS:     printf("<"); break;
+				case TOKEN_GREATER:  printf(">"); break;
+				default:             assert(0);
+			}
+
+			Parser_PrintNode(node->bin.right);
+			printf(")");
+			break;
+		}
+		case NODE_UNARY_OP: {
+			printf("(");
+
+			switch (node->unary.op) {
+				case TOKEN_ADD:      printf("+"); break;
+				case TOKEN_SUBTRACT: printf("-"); break;
+				default:             assert(0);
+			}
+
+			Parser_PrintNode(node->unary.operand);
+			printf(")");
+			break;
+		}
+		case NODE_PTR: {
+			printf("ptr(");
+			Parser_PrintNode(node->ptr.inner);
+			break;
+		}
+		case NODE_FUNC_DEF: {
+			if (node->funcDef.dec.ret) {
+				printf("func ");
+			}
+			else {
+				printf("sub ");
+			}
+
+			printf("%s(", node->funcDef.dec.name);
+
+			for (size_t i = 0; i < node->funcDef.dec.paramsNum; ++ i) {
+				printf("%s as ", node->funcDef.dec.params[i].name);
+				Parser_PrintNode(node->funcDef.dec.params[i].type);
+
+				if (i < node->funcDef.dec.paramsNum - 1) {
+					printf(", ");
+				}
+			}
+
+			printf(")\n");
+
+			for (size_t i = 0; i < node->funcDef.bodyLen; ++ i) {
+				printf("\t");
+				Parser_PrintNode(&node->funcDef.body[i]);
+				puts("");
+			}
+			puts("end");
+			break;
+		}
+		case NODE_DIM: {
+			printf("dim %s as ", node->dim.name);
+			Parser_PrintNode(node->dim.varType);
+			puts("");
+			break;
+		}
+		case NODE_FUNC_CALL: {
+			printf("%s ", node->funcCall.func);
+
+			for (size_t i = 0; i < node->funcCall.paramsNum; ++ i) {
+				Parser_PrintNode(&node->funcCall.params[i]);
+
+				if (i < node->funcCall.paramsNum - 1) {
+					printf(", ");
+				}
+			}
+			puts("");
+			break;
+		}
+		case NODE_ASSIGN: {
+			printf("%s = ", node->assign.variable);
+			Parser_PrintNode(node->assign.rValue);
+			puts("");
+			break;
+		}
+		default: {
+			printf("unknown %d\n", node->i.type);
+			assert(0);
+		}
+	}
+}
+
+Node* Parser_Parse(Parser* p, size_t* lenOut) {
+	Node*  ret = NULL;
+	size_t len = 0;
+
+	for (p->i = 0; p->i < p->tokenNum; ++ p->i) {
+		if (p->tokens[p->i].type == TOKEN_LINE) continue;
+
+		Node node = ParseNode(p);
+
+		++ len;
+		ret          = SafeRealloc(ret, len * sizeof(Node));
+		ret[len - 1] = node;
+	}
+
+	for (size_t i = 0; i < p->tokenNum; ++ i) {
+		Lexer_FreeToken(&p->tokens[i]);
+	}
+	free(p->tokens);
+
+	*lenOut = len;
+	return ret;
+}
+
+void Parser_FreeNode(Node* node) {
+	switch (node->i.type) {
+		case NODE_STRING:     free(node->string.value); break;
+		case NODE_IDENTIFIER: free(node->ident.name);  break;
+		case NODE_BINARY_OP: {
+			Parser_FreeNode(node->bin.left);
+			Parser_FreeNode(node->bin.right);
+			free(node->bin.left);
+			free(node->bin.right);
+			break;
+		}
+		case NODE_UNARY_OP: {
+			Parser_FreeNode(node->unary.operand);
+			free(node->unary.operand);
+			break;
+		}
+		case NODE_PTR: {
+			Parser_FreeNode(node->ptr.inner);
+			free(node->ptr.inner);
+			break;
+		}
+		case NODE_FUNC_DEF: {
+			if (node->funcDef.dec.ret) {
+				Parser_FreeNode(node->funcDef.dec.ret);
+				free(node->funcDef.dec.ret);
+			}
+
+			for (size_t i = 0; i < node->funcDef.dec.paramsNum; ++ i) {
+				Parser_FreeNode(node->funcDef.dec.params[i].type);
+				free(node->funcDef.dec.params[i].type);
+			}
+
+			free(node->funcDef.dec.name);
+
+			for (size_t i = 0; i < node->funcDef.bodyLen; ++ i) {
+				Parser_FreeNode(&node->funcDef.body[i]);
+			}
+			free(node->funcDef.body);
+			break;
+		}
+		case NODE_DIM: {
+			free(node->dim.name);
+			Parser_FreeNode(node->dim.varType);
+			free(node->dim.varType);
+			break;
+		}
+		case NODE_FUNC_CALL: {
+			free(node->funcCall.func);
+
+			for (size_t i = 0; i < node->funcCall.paramsNum; ++ i) {
+				Parser_FreeNode(&node->funcCall.params[i]);
+			}
+			free(node->funcCall.params);
+			break;
+		}
+		case NODE_ASSIGN: {
+			free(node->assign.variable);
+			Parser_FreeNode(node->assign.rValue);
+			free(node->assign.rValue);
+			break;
+		}
+		default: return;
+	}
+}
+
+const char* Parser_TypeStr(NodeType type) {
+	switch (type) {
+		case NODE_NONE:       return "none";
+		case NODE_INT:        return "int";
+		case NODE_STRING:     return "string";
+		case NODE_IDENTIFIER: return "identifier";
+		case NODE_BINARY_OP:  return "binary operation";
+		case NODE_UNARY_OP:   return "unary operation";
+		case NODE_PTR:        return "ptr";
+		case NODE_FUNC_DEF:   return "function definition";
+		case NODE_DIM:        return "dim";
+		case NODE_FUNC_CALL:  return "function call";
+		case NODE_ASSIGN:     return "assignment";
+		default:              return "???";
+	}
+}




diff --git a/basic-boot/source/parser.h b/basic-boot/source/parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..9e643df70c4de70613cbcd791b17f86efca21126
--- /dev/null
+++ b/basic-boot/source/parser.h
@@ -0,0 +1,127 @@
+#ifndef N_PARSER_H
+#define N_PARSER_H
+
+#include "lexer.h"
+#include "error.h"
+#include "common.h"
+
+typedef enum {
+	NODE_NONE,
+	NODE_INT,
+	NODE_STRING,
+	NODE_IDENTIFIER,
+	NODE_BINARY_OP,
+	NODE_UNARY_OP,
+	NODE_PTR,
+	NODE_FUNC_DEF,
+	NODE_DIM,
+	NODE_FUNC_CALL,
+	NODE_ASSIGN
+} NodeType;
+
+typedef struct {
+	NodeType  type;
+	ErrorInfo err;
+} NodeInfo;
+
+typedef union Node Node;
+
+typedef struct {
+	NodeInfo i;
+	int      value;
+} IntNode;
+
+typedef struct {
+	NodeInfo i;
+	char*    value;
+} StringNode;
+
+typedef struct {
+	NodeInfo i;
+	char*    name;
+} IdentifierNode;
+
+typedef struct {
+	NodeInfo  i;
+	Node*     left;
+	Node*     right;
+	TokenType op;
+} BinaryNode;
+
+typedef struct {
+	NodeInfo  i;
+	Node*     operand;
+	TokenType op;
+} UnaryNode;
+
+typedef struct {
+	NodeInfo i;
+	Node*    inner;
+} PtrNode;
+
+typedef struct {
+	Node*  type;
+	char*  name;
+} FuncDecParam;
+
+typedef struct {
+	FuncDecParam* params;
+	size_t        paramsNum;
+	Node*         ret;
+	char*         name;
+} FuncDec;
+
+typedef struct {
+	NodeInfo i;
+	FuncDec  dec;
+	Node*    body;
+	size_t   bodyLen;
+} FuncDefNode;
+
+typedef struct {
+	NodeInfo i;
+	char*    name;
+	Node*    varType;
+} DimNode;
+
+typedef struct {
+	NodeInfo i;
+	char*    func;
+	Node*    params;
+	size_t   paramsNum;
+} FuncCallNode;
+
+typedef struct {
+	NodeInfo i;
+	char*    variable;
+	Node*    rValue;
+} AssignNode;
+
+union Node {
+	NodeInfo       i;
+	IntNode        integer;
+	StringNode     string;
+	IdentifierNode ident;
+	BinaryNode     bin;
+	UnaryNode      unary;
+	PtrNode        ptr;
+	FuncDefNode    funcDef;
+	DimNode        dim;
+	FuncCallNode   funcCall;
+	AssignNode     assign;
+};
+
+typedef struct {
+	Token* tokens;
+	size_t tokenNum;
+	size_t i;
+} Parser;
+
+Parser Parser_Init(FILE* file, const char* fileName, bool printTokens);
+void   Parser_PrintNode(Node* node);
+Node*  Parser_Parse(Parser* p, size_t* lenOut);
+void   Parser_FreeNode(Node* node);
+
+const char* Parser_TypeStr(NodeType type);
+
+#endif




diff --git a/basic-boot/source/semanticAnalysis.c b/basic-boot/source/semanticAnalysis.c
new file mode 100644
index 0000000000000000000000000000000000000000..c275153bb71bcc85fc06e2e5a9372f795796eb04
--- /dev/null
+++ b/basic-boot/source/semanticAnalysis.c
@@ -0,0 +1,382 @@
+#include <assert.h>
+#include <string.h>
+#include "mem.h"
+#include "util.h"
+#include "error.h"
+#include "state.h"
+#include "parser.h"
+#include "semanticAnalysis.h"
+
+void SemanticAnalysis_Init(size_t wordSize) {
+	State_Init();
+
+	// add primitive types
+	State_MakePrimitive("u8",    1,        PRIM_UINT);
+	State_MakePrimitive("i8",    1,        PRIM_INT);
+	State_MakePrimitive("u16",   2,        PRIM_UINT);
+	State_MakePrimitive("i16",   2,        PRIM_INT);
+	State_MakePrimitive("u32",   4,        PRIM_UINT);
+	State_MakePrimitive("i32",   4,        PRIM_INT);
+	State_MakePrimitive("u64",   8,        PRIM_UINT);
+	State_MakePrimitive("i64",   8,        PRIM_INT);
+	State_MakePrimitive("uint",  wordSize, PRIM_UINT);
+	State_MakePrimitive("int",   wordSize, PRIM_INT);
+	State_MakePrimitive("char",  1,        PRIM_UINT);
+	State_MakePrimitive("f32",   4,        PRIM_FLOAT);
+	State_MakePrimitive("f64",   8,        PRIM_FLOAT);
+	State_MakePrimitive("bool",  1,        PRIM_UINT);
+	State_MakePrimitive("__lit", 0,        PRIM_INT);
+
+	Type type;
+	type.name = NewString("unit");
+	type.type = TYPE_UNIT;
+	State_AddType(type);
+}
+
+void Expect(Node* node, NodeType type) {
+	if (node->i.type != type) {
+		PrintError(node->i.err,
+			"Expected %s, got %s", Parser_TypeStr(type),
+			Parser_TypeStr(node->i.type)
+		);
+	}
+}
+
+void Unexpected(Node* node) {
+	PrintError(node->i.err, "Unexpected %s", Parser_TypeStr(node->i.type));
+}
+
+static UsedType NodeAsUsedType(Node* node) {
+	UsedType ret;
+	ret.ptr   = 0;
+	ret.array = false; // no arrays yet
+
+	while (true) {
+		switch (node->i.type) {
+			case NODE_PTR: {
+				node = node->ptr.inner;
+				++ ret.ptr;
+				continue;
+			}
+			case NODE_IDENTIFIER: {
+				Type* type = State_GetType(node->ident.name);
+
+				if (!type) {
+					PrintError(node->i.err, "Type '%s' does not exist", node->ident.name);
+				}
+
+				ret.typeIdx = type - state.types;
+				return ret;
+			}
+			default: {
+				Unexpected(node);
+				exit(1);
+			}
+		}
+	}
+}
+
+static Type* GetTypeFromUsed(UsedType type) {
+	return &state.types[type.typeIdx];
+}
+
+#define GET_PRIM(NAME, PTR) \
+	((UsedType) {(PTR), State_GetType(NAME) - state.types, 0})
+
+static UsedType EvalType(Node* node);
+
+static UsedType EvalBinOp(Node* node) {
+	UsedType left  = EvalType(node->bin.left);
+	UsedType right = EvalType(node->bin.right);
+
+	Type* leftType  = GetTypeFromUsed(left);
+	Type* rightType = GetTypeFromUsed(right);
+
+	if ((leftType->type != TYPE_PRIM) || (rightType->type != TYPE_PRIM)) {
+		PrintError(node->i.err, "You can only use primitive types in binary expressions");
+	}
+
+	if (left.ptr) {
+		if (right.ptr) {
+			switch (node->bin.op) {
+				case TOKEN_EQUAL:
+				case TOKEN_LESS:
+				case TOKEN_GREATER: return GET_PRIM("bool", 0);
+				case TOKEN_SUB:     return GET_PRIM("uint", 0);
+				default: {
+					PrintError(
+						node->i.err, "Operation '%s' not allowed here",
+						Lexer_TypeVAsString(node->bin.op)
+					);
+				}
+			}
+		}
+		else {
+			switch (node->bin.op) {
+				case TOKEN_ADD:
+				case TOKEN_SUB: {
+					if (rightType->primType == PRIM_FLOAT) {
+						PrintError(node->i.err, "Cannot add float to pointer");
+					}
+					return left;
+				}
+				default: {
+					PrintError(
+						node->i.err, "Operation '%s' not allowed here",
+						Lexer_TypeVAsString(node->bin.op)
+					);
+				}
+			}
+		}
+	}
+	else if (right.ptr) {
+		switch (node->bin.op) {
+			case TOKEN_ADD:
+			case TOKEN_SUB: {
+				if (leftType->primType == PRIM_FLOAT) {
+					PrintError(node->i.err, "Cannot add float to pointer");
+				}
+				return right;
+			}
+			default: {
+				PrintError(
+					node->i.err, "Operation '%s' not allowed here",
+					Lexer_TypeVAsString(node->bin.op)
+				);
+			}
+		}
+	}
+	else if (!right.ptr) {
+		switch (node->bin.op) {
+			case TOKEN_EQUAL: return GET_PRIM("bool", 0);
+			case TOKEN_LESS:
+			case TOKEN_GREATER: {
+				if ((leftType->type != TYPE_PRIM) || (rightType->type != TYPE_PRIM)) {
+					PrintError(
+						node->i.err, "Operation '%s' only works on primitives",
+						Lexer_TypeVAsString(node->bin.op)
+					);
+				}
+				return GET_PRIM("bool", 0);
+			}
+			case TOKEN_ADD:
+			case TOKEN_SUBTRACT:
+			case TOKEN_MULTIPLY:
+			case TOKEN_DIVIDE:
+			case TOKEN_MOD: {
+				if ((leftType->type != TYPE_PRIM) || (rightType->type != TYPE_PRIM)) {
+					PrintError(
+						node->i.err, "Operation '%s' only works on primitives",
+						Lexer_TypeVAsString(node->bin.op)
+					);
+				}
+
+				if (leftType->primType == rightType->primType) {
+					if (leftType->size > rightType->size) {
+						return left;
+					}
+					else {
+						return right;
+					}
+				}
+				else {
+					PrintError(
+						node->i.err, "Incompatible types in '%s' operation",
+						Lexer_TypeVAsString(node->bin.op)
+					);
+				}
+			}
+			default: break;
+		}
+
+		PrintError(
+			node->i.err, "Operation '%s' not allowed here",
+			Lexer_TypeVAsString(node->bin.op)
+		);
+	}
+
+	exit(1);
+}
+
+static UsedType EvalType(Node* node) {
+	static bool inFunc = false;
+
+	switch (node->i.type) {
+		case NODE_INT:    return GET_PRIM("__lit", 0);
+		case NODE_STRING: return GET_PRIM("char", 1);
+		case NODE_IDENTIFIER: {
+			Var* var = State_GetVar(node->ident.name);
+
+			if (!var) {
+				PrintError(
+					node->i.err, "Variable '%s' doesn't exist", node->ident.name
+				);
+			}
+
+			return var->type;
+		}
+		case NODE_BINARY_OP: return EvalBinOp(node);
+		case NODE_UNARY_OP: {
+			UsedType operand = EvalType(node->unary.operand);
+			Type*    type    = GetTypeFromUsed(operand);
+
+			if (type->type != TYPE_PRIM) {
+				PrintError(node->i.err,
+					"Only primitive types can be used with unary operators"
+				);
+			}
+
+			if ((type->primType == PRIM_UINT) && (node->unary.op == TOKEN_SUBTRACT)) {
+				PrintWarning(node->i.err, "Using negative sign on unsigned value");
+			}
+
+			return operand;
+		}
+		case NODE_PTR: {
+			UsedType type = EvalType(node->ptr.inner);
+			++ type.ptr;
+			return type;
+		}
+		case NODE_FUNC_DEF: {
+			if (inFunc) {
+				PrintError(node->i.err, "Nested function definitions are not allowed");
+			}
+
+			Function func;
+			func.sub = node->funcDef.dec.ret != NULL;
+
+			if (!func.sub) {
+				func.ret = NodeAsUsedType(node->funcDef.dec.ret);
+			}
+
+			func.paramsLen = node->funcDef.dec.paramsNum;
+			func.params    = SafeMalloc(func.paramsLen * sizeof(FuncParam));
+
+			for (size_t i = 0; i < func.paramsLen; ++ i) {
+				func.params[i].type = NodeAsUsedType(
+					node->funcDef.dec.params[i].type
+				);
+				func.params[i].name = node->funcDef.dec.params[i].name;
+			}
+
+			func.name = NewString(node->funcDef.dec.name);
+			State_AddFunc(func);
+
+			// now analyse the body
+			State_AddScope();
+			inFunc = true;
+
+			// add parameters to this scope
+			for (size_t i = 0; i < func.paramsLen; ++ i) {
+				Var var;
+				var.type = func.params[i].type;
+				var.name = NewString(func.params[i].name);
+				State_AddVar(var);
+			}
+
+			for (size_t i = 0; i < node->funcDef.bodyLen; ++ i) {
+				EvalType(&node->funcDef.body[i]);
+			}
+			inFunc = false;
+			State_FreeScope();
+			return GET_PRIM("unit", 0);
+		}
+		case NODE_FUNC_CALL: {
+			Function* func = State_GetFunc(node->funcCall.func);
+			if (!func) {
+				PrintError(node->i.err, "Function %s does not exist", node->funcCall.func);
+			}
+
+			if (func->paramsLen != node->funcCall.paramsNum) {
+				PrintError(
+					node->i.err, "Expected %d parameters, got %d",
+					func->paramsLen, node->funcCall.paramsNum
+				);
+			}
+
+			for (size_t i = 0; i < func->paramsLen; ++ i) {
+				UsedType type      = EvalType(&node->funcCall.params[i]);
+				UsedType param     = func->params[i].type;
+				Type*    paramType = GetTypeFromUsed(param);
+				Type*    callType  = GetTypeFromUsed(type);
+
+				bool paramLit = strcmp(callType->name, "__lit") == 0;
+
+				if (!State_UsedTypeEq(type, param)) {
+					if (
+						(callType->type == TYPE_PRIM) && (paramType->type == TYPE_PRIM) &&
+						(callType->primType == paramType->primType) &&
+						(paramType->size >= callType->size)
+					) {
+						continue;
+					}
+
+					if (paramLit && (paramType->type == TYPE_PRIM)) continue;
+
+					PrintError(node->i.err,
+						"Expected %s for parameter %s, got %s",
+						paramType->name, func->params[i].name, callType->name
+					);
+				}
+			}
+
+			if (func->sub) {
+				return GET_PRIM("unit", 0);
+			}
+			else {
+				return func->ret;
+			}
+		}
+		case NODE_DIM: {
+			Var var;
+			var.type = NodeAsUsedType(node->dim.varType);
+			var.name = NewString(node->dim.name);
+			State_AddVar(var);
+			return GET_PRIM("unit", 0);
+		}
+		case NODE_ASSIGN: {
+			Var* var = State_GetVar(node->assign.variable);
+
+			if (!var) {
+				PrintError(
+					node->i.err, "Variable '%s' doesn't exist",
+					node->assign.variable
+				);
+			}
+
+			UsedType left  = var->type;
+			UsedType right = EvalType(node->assign.rValue);
+
+			Type* leftType  = GetTypeFromUsed(left);
+			Type* rightType = GetTypeFromUsed(right);
+
+			bool compatible = true;
+
+			if ((left.ptr != right.ptr) || (leftType->type != rightType->type)) {
+				compatible = false;
+			}
+			else if (leftType->type == TYPE_PRIM) {
+				if (leftType->primType != rightType->primType) compatible = false;
+				else if (leftType->size < rightType->size)     compatible = false;
+			}
+
+			if (!compatible) {
+				PrintError(
+					node->i.err, "Type '%s' cannot be assigned to '%s' variable",
+					GetTypeFromUsed(left)->name, GetTypeFromUsed(right)->name
+				);
+			}
+
+			return GET_PRIM("unit", 0);
+		}
+		default: {
+			Unexpected(node);
+		}
+	}
+
+	assert(0);
+}
+
+void SemanticAnalysis_Analyse(Node* node) {
+	EvalType(node);
+}




diff --git a/basic-boot/source/semanticAnalysis.h b/basic-boot/source/semanticAnalysis.h
new file mode 100644
index 0000000000000000000000000000000000000000..341ccb8ac4a96ebcd1d94b58b4aad9fa914a881e
--- /dev/null
+++ b/basic-boot/source/semanticAnalysis.h
@@ -0,0 +1,9 @@
+#ifndef N_SEMANTIC_ANALYSIS_H
+#define N_SEMANTIC_ANALYSIS_H
+
+#include "common.h"
+
+void SemanticAnalysis_Init(size_t wordSize);
+void SemanticAnalysis_Analyse(Node* node);
+
+#endif




diff --git a/basic-boot/source/state.c b/basic-boot/source/state.c
new file mode 100644
index 0000000000000000000000000000000000000000..c2d901ca81d47638cf32a652631f8562859bda74
--- /dev/null
+++ b/basic-boot/source/state.c
@@ -0,0 +1,127 @@
+#include <stdio.h>
+#include <string.h>
+#include "mem.h"
+#include "util.h"
+#include "state.h"
+
+State state;
+
+void State_Init(void) {
+	state.types        = NULL;
+	state.typeNum      = 0;
+	state.scopes[0]    = NULL;
+	state.scopeSize[0] = 0;
+	state.scopeNum     = 1;
+	state.funcs        = NULL;
+	state.funcNum      = 0;
+}
+
+void State_AddType(Type type) {
+	++ state.typeNum;
+	state.types = SafeRealloc(state.types, state.typeNum * sizeof(Type));
+	state.types[state.typeNum - 1] = type;
+}
+
+void State_AddVar(Var var) {
+	size_t scope = state.scopeNum - 1;
+
+	++ state.scopeSize[scope];
+	state.scopes[scope] = SafeRealloc(
+		state.scopes[scope], state.scopeSize[scope] * sizeof(Var)
+	);
+	state.scopes[scope][state.scopeSize[scope] - 1] = var;
+}
+
+bool State_AddScope(void) {
+	if (state.scopeNum >= 16) return false;
+
+	++ state.scopeNum;
+	state.scopeSize[state.scopeNum - 1] = 0;
+	state.scopes[state.scopeNum - 1]    = NULL;
+	return true;
+}
+
+void State_AddFunc(Function func) {
+	++ state.funcNum;
+	state.funcs = SafeRealloc(state.funcs, state.funcNum * sizeof(Function));
+	state.funcs[state.funcNum - 1] = func;
+}
+
+void State_FreeScope(void) {
+	Var*   scope    = state.scopes[state.scopeNum - 1];
+	size_t scopeNum = state.scopeSize[state.scopeNum - 1];
+
+	for (size_t i = 0; i < scopeNum; ++ i) {
+		free(scope[i].name);
+	}
+
+	-- state.scopeNum;
+}
+
+Var* State_GetVar(const char* name) {
+	for (size_t i = state.scopeNum; i --> 0;) {
+		for (size_t j = 0; j < state.scopeSize[i]; ++ j) {
+			if (strcmp(state.scopes[i][j].name, name) == 0) {
+				return &state.scopes[i][j];
+			}
+		}
+	}
+
+	return NULL;
+}
+
+Type* State_GetType(const char* name) {
+	for (size_t i = 0; i < state.typeNum; ++ i) {
+		if (strcmp(state.types[i].name, name) == 0) {
+			return &state.types[i];
+		}
+	}
+
+	return NULL;
+}
+
+Function* State_GetFunc(const char* name) {
+	for (size_t i = 0; i < state.funcNum; ++ i) {
+		if (strcmp(state.funcs[i].name, name) == 0) {
+			return &state.funcs[i];
+		}
+	}
+
+	return NULL;
+}
+
+void State_MakePrimitive(const char* name, size_t size, int primType) {
+	Type type;
+	type.type     = TYPE_PRIM;
+	type.name     = NewString(name);
+	type.size     = size;
+	type.primType = primType;
+	State_AddType(type);
+}
+
+bool State_UsedTypeEq(UsedType a, UsedType b) {
+	return (a.ptr == b.ptr) && (a.typeIdx == b.typeIdx) && (a.array == b.array);
+}
+
+void State_DumpInfo(void) {
+	puts("TYPES");
+	puts("=====");
+	for (size_t i = 0; i < state.typeNum; ++ i) {
+		printf("- %s\n", state.types[i].name);
+	}
+	puts("\n");
+
+	puts("GLOBALS");
+	puts("=======");
+	for (size_t i = 0; i < state.scopeSize[0]; ++ i) {
+		printf("- %s\n", state.scopes[0][i].name);
+	}
+	puts("\n");
+
+	puts("FUNCTIONS");
+	puts("=========");
+	for (size_t i = 0; i < state.funcNum; ++ i) {
+		printf("- %s\n", state.funcs[i].name);
+	}
+	puts("\n");
+}




diff --git a/basic-boot/source/state.h b/basic-boot/source/state.h
new file mode 100644
index 0000000000000000000000000000000000000000..bff6a6faeea769784107c85cb53b3b8e1e1da066
--- /dev/null
+++ b/basic-boot/source/state.h
@@ -0,0 +1,80 @@
+#ifndef N_STATE_H
+#define N_STATE_H
+
+#include "common.h"
+
+enum {
+	TYPE_PRIM, // is this "primitive", or Primula the manul?
+	TYPE_STRUCT,
+	TYPE_UNIT
+};
+
+enum {
+	PRIM_UINT,
+	PRIM_INT,
+	PRIM_FLOAT
+};
+
+typedef struct {
+	size_t ptr;
+	size_t typeIdx;
+	size_t array; // 0 if not array, contains length if not array
+} UsedType;
+
+typedef struct {
+	int    type;
+	char*  name;
+	size_t size;
+
+	// only for "struct" types
+	UsedType* structure;
+	size_t    structLen;
+
+	// only for "primitive" types
+	int primType;
+} Type;
+
+typedef struct {
+	UsedType type;
+	char*    name;
+} Var;
+
+typedef struct {
+	UsedType type;
+	char*    name;
+} FuncParam;
+
+typedef struct {
+	bool       sub;
+	UsedType   ret;
+	FuncParam* params;
+	size_t     paramsLen;
+	char*      name;
+} Function;
+
+typedef struct {
+	Type*     types;
+	size_t    typeNum;
+	Var*      scopes[16];
+	size_t    scopeSize[16];
+	size_t    scopeNum;
+	Function* funcs;
+	size_t    funcNum;
+} State;
+
+extern State state;
+
+void      State_Init(void);
+void      State_AddType(Type type);
+void      State_AddVar(Var var);
+bool      State_AddScope(void);
+void      State_AddFunc(Function func);
+void      State_FreeScope(void);
+Var*      State_GetVar(const char* name);
+Type*     State_GetType(const char* name);
+Function* State_GetFunc(const char* name);
+void      State_MakePrimitive(const char* name, size_t size, int primType);
+bool      State_UsedTypeEq(UsedType a, UsedType b);
+void      State_DumpInfo(void);
+
+#endif




diff --git a/basic-boot/source/string.c b/basic-boot/source/string.c
new file mode 100644
index 0000000000000000000000000000000000000000..7e42275935d2fa0e7044dae2263a0c206aadf2de
--- /dev/null
+++ b/basic-boot/source/string.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <string.h>
+#include "mem.h"
+#include "string.h"
+
+String String_New(void) {
+	char* contents = SafeMalloc(1);
+	*contents      = 0;
+
+	return (String) {
+		contents, 1
+	};
+}
+
+String String_FromChar(char ch) {
+	String ret = String_New();
+	String_AddChar(&ret, ch);
+	return ret;
+}
+
+void String_Free(String* string) {
+	free(string->contents);
+}
+
+void String_Add(String* string, char* value) {
+	size_t newLen = strlen(string->contents) + strlen(value) + 1;
+	size_t newCap = string->capacity;
+
+	while (newCap < newLen) {
+		newCap *= 2;
+	}
+
+	if (newCap != string->capacity) {
+		string->capacity = newCap;
+		string->contents = SafeRealloc(string->contents, newCap);
+	}
+
+	strcat(string->contents, value);
+}
+
+void String_AddChar(String* string, char ch) {
+	char str[] = {ch, 0};
+	String_Add(string, str);
+}
+
+size_t String_Len(String* string) {
+	return strlen(string->contents);
+}




diff --git a/basic-boot/source/string.h b/basic-boot/source/string.h
new file mode 100644
index 0000000000000000000000000000000000000000..98e30f87cba52e57745b1493d7be6621416d8936
--- /dev/null
+++ b/basic-boot/source/string.h
@@ -0,0 +1,18 @@
+#ifndef N_STRING_H
+#define N_STRING_H
+
+#include "common.h"
+
+typedef struct {
+	char*  contents;
+	size_t capacity;
+} String;
+
+String String_New(void);
+String String_FromChar(char ch);
+void   String_Free(String* string);
+void   String_Add(String* string, char* value);
+void   String_AddChar(String* string, char ch);
+size_t String_Len(String* string);
+
+#endif




diff --git a/basic-boot/source/util.c b/basic-boot/source/util.c
new file mode 100644
index 0000000000000000000000000000000000000000..3524bb0b4c307b7a93a3b07c1c2c13fe438d9956
--- /dev/null
+++ b/basic-boot/source/util.c
@@ -0,0 +1,16 @@
+#include <string.h>
+#include "mem.h"
+#include "common.h"
+
+char* NewString(const char* src) {
+	char* ret = SafeMalloc(strlen(src) + 1);
+	strcpy(ret, src);
+	return ret;
+}
+
+char* ConcatString(const char* first, const char* second) {
+	char* ret = SafeMalloc(strlen(first) + strlen(second) + 1);
+	strcpy(ret, first);
+	strcat(ret, second);
+	return ret;
+}




diff --git a/basic-boot/source/util.h b/basic-boot/source/util.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa57880a037cf533331c0e4cdedfcef4953b4465
--- /dev/null
+++ b/basic-boot/source/util.h
@@ -0,0 +1,22 @@
+#ifndef N_UTIL_H
+#define N_UTIL_H
+
+#include <stdio.h>
+
+#define FUNCTION_POINTER(TYPE, NAME, ...) TYPE (*NAME)(__VA_ARGS__)
+#define MIN(A, B) (((A) < (B))? (A) : (B))
+#define MAX(A, B) (((A) > (B))? (A) : (B))
+
+#define SWAP(TYPE, A, B) \
+	do { \
+		TYPE* macro##a   = &(A); \
+		TYPE* macro##b   = &(B); \
+		TYPE  macro##tmp = *macro##a; \
+		*macro##a = *macro##b; \
+		*macro##b = macro##tmp; \
+	} while (0);
+
+char* NewString(const char* src);
+char* ConcatString(const char* first, const char* second);
+
+#endif




diff --git a/basic-boot/test.bas b/basic-boot/test.bas
new file mode 100644
index 0000000000000000000000000000000000000000..af13a8b74c4cbcb49dd5ac303c39c0578ebf48fb
--- /dev/null
+++ b/basic-boot/test.bas
@@ -0,0 +1,20 @@
+'NITRON
+
+dim foo as int
+
+func manul(foo as int, bar as int) int
+	dim bar as u32
+end
+
+manul 1, (2 * 3) + -5 * 4
+
+foo = 3 + 4
+
+dim a as int
+dim b as f32
+dim c as int
+
+manul a + c, 5
+
+dim myPtr as ptr(int)
+myPtr = myPtr * 5




diff --git a/kernel/Makefile b/kernel/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..7a6707ef8c225fc324aed07d75c627dc16583acb
--- /dev/null
+++ b/kernel/Makefile
@@ -0,0 +1,67 @@
+SOURCES := $(wildcard source/*.c) $(wildcard source/**/*.c)
+OBJECTS := $(patsubst source/%.c,bin/%.o,$(SOURCES))
+OUT     := nitron
+LD      := $(CC)
+
+override CFLAGS += -std=c99 -Wall -Wextra -Wuninitialized -Wundef -pedantic -Ilib -m32
+override CFLAGS += -DN_DEVICE_HOST
+override LDLIBS += -lm -m32
+
+ifeq ($(BUILD),release)
+	override CFLAGS += -O3
+	#override CPPFLAGS += -NDEBUG
+else
+	override CFLAGS += -Og -g
+	ifeq ($(ASAN), y)
+		override CFLAGS += -fno-omit-frame-pointer -fsanitize=address
+		override LDFLAGS += -fsanitize=address
+	endif
+
+	ifeq ($(SYS_ALLOC), y)
+		override CFLAGS += -DN_SYS_ALLOC
+	endif
+
+	ifeq ($(REI_ALLOC), y)
+		override CFLAGS += -DN_REI_ALLOC
+	endif
+endif
+
+.SECONDEXPANSION:
+
+deps.filter := %.c %.h
+deps.option := -MM
+define deps
+$$(filter $$(deps.filter),,$$(shell $(CC) $(CFLAGS) $(CPPFLAGS) -E $(deps.option) $(1)))
+endef
+
+all: $(OUT)
+	@:
+
+run: $(OUT)
+	'$(dir $<)$(notdir $<)' $(RUNFLAGS)
+
+$(OUT): $(OBJECTS)
+	$(LD) $(LDFLAGS) $^ $(LDLIBS) -o $@
+
+bin/:
+	mkdir -p bin
+
+bin/fs:
+	mkdir -p bin/fs
+
+bin/disk:
+	mkdir -p bin/disk
+
+bin/system:
+	mkdir -p bin/system
+
+bin/%.o: source/%.c $(call deps,source/%.c) romfs.h | bin/ bin/fs bin/disk bin/system
+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
+
+clean:
+	rm -r bin
+
+distclean: clean
+	rm $(OUT)
+
+.PHONY: all run clean distclean




diff --git a/kernel/source/common.h b/kernel/source/common.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f2bbb6733256481d77ba83a8ebb35a04e561748
--- /dev/null
+++ b/kernel/source/common.h
@@ -0,0 +1,7 @@
+#ifndef N_COMMON_H
+#define N_COMMON_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#endif




diff --git a/kernel/source/vm.h b/kernel/source/vm.h
new file mode 100644
index 0000000000000000000000000000000000000000..299760539cd2593075dc82270addc8b2db860f98
--- /dev/null
+++ b/kernel/source/vm.h
@@ -0,0 +1,8 @@
+#ifndef N_VM_H
+#define N_VM_H
+
+typedef struct {
+	
+} VMState;
+
+#endif