M
The answer changes in the OS and language.OSIf you don’t have a prerequisite, I think you’re thinking about OSX, Windows, and Linux. However, depending on the application, it’s not a type of OS for bootloaders, or a subroutine group so-called monitors, but some of the kind of linguistic environment is controlled by a portable 。 system or a huge dispersion system. In the latter case, it is possible to leave access to low-level resources such as hardware in the form on the OS running on individual machines.However, because it is not too much to talk about it, let’s think about it as much as it is running in a situation where there is no other software available on a hardware. So you need access to hardware resources. On the other hand, it is not applicable because it can be done by application (if you have provided low level access to the device).LanguageThis is the purpose of programming language.Functions of the range specified in the language specificationAbility to implement that language in realityFunctions of the range available in the language specificationThere are several reasons for this.The scope specified in the language specification is that it can be assembled only from the functions provided in the language specification and the standard library. Since there is a language that has almost no input/output in the language specification or standard library, it is not possible to write access to the hardware, and the OS that I studied above is not written.However, if this definition is too strictly interpreted, it may come out even in existing system language. (C's language definition is not read recently, so it is different to remember.)I/O mapped to a specific address was not guaranteed to work. )I think that the language that OS can write in this sense is rare. I/O of I/O of hardware is not defined explicitly. In this sense, POKE, PEEK, etc. used to define direct access to the memory address of the machine, but the former BASIC, etc., is closer to the language that writes OS.Next, the order is back and forth, but about the function of the extent possible in the language specification. This is not defined in the language specification or standard library, but if you think of the function that "processing system does not provide such a function is not allowed in the specification", you can write OS.For example, there are few I/O in the Scheme language specification, and no direct access to the memory is allowed, and there is no means to specify the memory allocation or even the opening with garbageガ. However, it is not allowed to define a function that reads and writes and stops garbage。s in a specific range. If the processing system provides such a function, you can write runtime and bootloader with Scheme garbageクタ only, and even OS can be written.In this sense, it is possible to write OS in almost all general language. However, even if the tulleling is complete, there is no room for the library extension by the processing system (e.g. Brainf*ck). In principle, you should be able to run your application in a sandboxy environment even in emerging languages, but you will not be able to write the OS as described above.Finally, "the function that implements the language in reality" This is what we can do as a language processing system. This is a super set of "the scope specified by the language specification" and becomes a subset of "the function of the range possible by the language specification".I think this category is the language you can write OS. C, C++, but elders such as Lisp and Fortran can also be a long history of processing. ) On the other hand, I think that there are few primitives that are required for the LL user language processing system.Close: "Bear Metal OS can be written if this language processing system is written _ written" If you have already written it, it may be better to have OS name. PL/I was used in general-purpose OS.