simple nasm batch file

Programming, for all ages and all languages.
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

simple nasm batch file

Post by feare56 »

This might be obvious to some people but for people like myself who never thought about it and I just created this so it will make kernel converting to asm to bin easier.

This is for windows only

create a new text document and paste this code

cd \Users\*Your Username*\AppData\Local\nasm
nasm kernel.asm -f bin -o kernel.bin

then change the file extension to .bat
again most of you probably know this but others like myself didn't know it. Hope I made it easier for those who feel that it is hard to remember the nasm command.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: simple nasm batch file

Post by thepowersgang »

Without sounding elitist - People who don't know that (or can't easily figure that out), have no business attempting OSdev (yet).
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: simple nasm batch file

Post by feare56 »

That's not the case for some actually. Some people make operating systems to learn programming. Though those people are rare and most of us know what to do it just for those people who aren't a good programmer yet
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: simple nasm batch file

Post by iansjack »

Well, I'd agree with thepowersgang that anyone who can't knock up a simple batch file, shell script, makefile, linker script, etc. is unlikely to get far in OS development.
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: simple nasm batch file

Post by Griwes »

"Want to learn programming? Write OS!" is simply broken in way too many ways to ever list them.

If you don't know pitfalls and caveats of your programming language of choice and ways of debugging things (not to mention shell usage...), then you have nothing to do in this field.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: simple nasm batch file

Post by feare56 »

Indeed making an OS is difficult but I have seen a few stories starting like this "I don't know a bunch of programming but how would I begin an OS?" And yes they probably don't relize how hard it is to make a working kernel even the most basic kernel
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: simple nasm batch file

Post by Yoda »

feare56 wrote:Indeed making an OS is difficult
Making a real OS is SO difficult that newbies often greatly underestimate the complexity of task.
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: simple nasm batch file

Post by Love4Boobies »

Developers generally use build systems which only rebuild things whose prerequisites have been modified since the last build. As your code base grows, this will become more valuable. As an example, see the Makefile article on the wiki.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: simple nasm batch file

Post by qw »

feare56 wrote:cd \Users\*Your Username*\AppData\Local\nasm
nasm kernel.asm -f bin -o kernel.bin
Do you store the source code in "\Users\*Your Username*\AppData\Local\nasm"?
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: simple nasm batch file

Post by feare56 »

Yea that's where I put mine and I made a shortcut on desktop for quick access
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: simple nasm batch file

Post by Griwes »

Then you're definitely not ready for participating in this community.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: simple nasm batch file

Post by Antti »

Griwes wrote:"Want to learn programming? Write OS!" is simply broken in way too many ways to ever list them.
Although this is true, I think that it is quite possible to start making some "boot loader experiments" quite early on. These should not be considered as an OS but more like simple programs. Printing on screen etc. Of course everyone is going to say it is better to do this on real OS (e.g. making normal programs). Yes it is, I cannot deny. However, as a side project it is not very bad idea to try these simple "bare metal" code snippets.

If someone had shown me how to boot simple "Hello World OS" ten years ago, I am quite sure I would have eagerly start investigating it more. Making it print two "Hello Worlds". This is awesome! I can do whatever I want it and I do not even have an operating system! I will grab a book and start studying more.

What I mean is that if you find it interesting to play with "nasm kernel.asm -f bin -o kernel.bin" I recommend that you continue. Also, please also keep studying programming in general. Please continue participating this community (especially: read the wiki) but do not make this kind of thread because this community concentrates on more advanced topics. Expect the Auto-Delete Forum occasionally.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: simple nasm batch file

Post by qw »

I'd say anyone is ready for participating in this community.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: simple nasm batch file

Post by Love4Boobies »

To help lighten the mood, here is an ASCII art butt:

Code: Select all

             .         .              
             |         |              
             j    :    l              
            /           \             
           /             \            
          Y       .       Y           
          |       |       |           
          l "----~Y~----" !           
           \      |      /            
            Y     |     Y             
            |     I     |         
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: simple nasm batch file

Post by Kazinsal »

Hobbes wrote:I'd say anyone is ready for participating in this community.
Even those who store their source code in the same place as they store their toolchain? *points a few posts up*
Post Reply