element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Code Exchange
  • Technologies
  • More
Code Exchange
Forum OS Development
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 13 replies
  • Subscribers 48 subscribers
  • Views 1517 views
  • Users 0 members are here
  • Code Exchange
  • assembly
Related

OS Development

nick123
nick123 over 10 years ago

     I've been studying assembly language for a long long long time, and I want to try OS Development. I've heard of MikeOS it was entirely written in real mode assembly. I looked over the code of MikeOS and now I feel very discouraged. It is a lot of complicated code just for a simple os.

 

MikeOS - simple x86 assembly language operating system

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 10 years ago +1
    Most OS are not written in assembler but in C or other high level language. To write even a small scheduler type OS in assembler is an odd thing to do since it will make it take longer and it won't be…
  • johnbeetem
    johnbeetem over 10 years ago in reply to nick123 +1
    Nick Gallagher wrote: Why is C portable and not assembly? An assembly language program only runs on one computer architecture, i.e., one instruction set. You can't run ARM assembly language on x86…
  • clem57
    clem57 over 10 years ago in reply to nick123 +1
    Yes if they produce a .COM module and assembly inline OK if you are careful.
Parents
  • johnbeetem
    0 johnbeetem over 10 years ago

    C was originally created as a system programming language so that you could write operating system kernels and utilities using portable high-level syntax.  C was designed to be easy to compile into efficient assembly language, specifically PDP-11.  Like many people, I think of C as a portable assembly language that uses high-level notations.

     

    As an amusing historical note, I once used a Unix system where the man page for the assembler had the following text:

    Assembly language is dead.  Necrophilia will be punished.

    That said, you'll write better C programs if you've mastered assembly language first.  You'll also find it easier to debug C programs since the C run-time model is machine language, i.e., no seat belts to protect your program from itself.

     

    JMO/YMMV

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • nick123
    0 nick123 over 10 years ago in reply to johnbeetem

    Why  is C portable and not assembly?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • johnbeetem
    0 johnbeetem over 10 years ago in reply to nick123

    Nick Gallagher wrote:

     

    Why  is C portable and not assembly?

    An assembly language program only runs on one computer architecture, i.e., one instruction set.  You can't run ARM assembly language on x86, or vice-versa, because the instructions and processor registers for one assembly language aren't the same as another.  (Well, you can use an emulator if you don't need high performance.)

     

    Unless it accesses implementation-specific device registers, a well-written [*] C program can run on any computer architecture for which you can get a C compiler.  So you can run the same C program on ARM and x86, except for the parts that access device registers.  If those are in device drivers, your well-written application programs are completely portable.

     

    [*]  There are some nuances that make C programs non-portable, such as writing code that depends on whether your architecture is big-endian or little-endian.  This is not an issue between x86 and ARM, because both are usually little-endian.  It is an issue porting C programs between x86/ARM and 68000/PowerPC.  There are other nuances as well, which is why software development groups need a few "grown-ups" around who have mastered assembly language so they know what things can go wrong and how to fix them.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • nick123
    0 nick123 over 10 years ago in reply to johnbeetem

    So, can C be compiled into flat binary like assembly? Also, is C anything like assembly. Can I put bits of assembly code in C?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • nick123
    0 nick123 over 10 years ago in reply to johnbeetem

    So, can C be compiled into flat binary like assembly? Also, is C anything like assembly. Can I put bits of assembly code in C?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • clem57
    0 clem57 over 10 years ago in reply to nick123

    Yes if they produce a .COM module and assembly inline OK if you are careful.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube