Results 1 to 7 of 7
  1. #1
    t7ancients's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New York
    Posts
    381
    Reputation
    28
    Thanks
    68
    My Mood
    Twisted

    Writing A Kernel ?

    I want to get started messing with OS dev. I have a desktop with Windows 7 64-bit(AMD64) and a laptop with Windows 7 64-bit(AMD64) and Ubuntu(x64) on it. What's the quickest and/or simplest way to get started with this? Should I work on linux or windows? I assume that using NASM and GCC would be the way to go, right? I just need some advice on setting up a simple/streamlined environment to work. I really appreciate anyone's input or advice.

    Edit: Can I jump into writing a system for x64, or should I start out with x86 code?
    Last edited by t7ancients; 07-03-2012 at 12:04 AM. Reason: Almost forgot, derp.

  2. #2
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Go here: BrokenThorn Entertainment

    You can develop everything from inside win7x64 with visual studio

    If I were you I'd start with x86, you'd have to start with that anyway since you change the processor mode from x16 to x86 and then ultimately to x64. You'll not start in x64 or x86, you need code to switch.

    My devchain was:

    NASM => Bootloader ( or use grub )
    VC++ 2005 => Kernel
    Manual c+p => Osimage ( BL + kernel )
    Bochs => Emulate
    Start over !!
    Last edited by .::SCHiM::.; 07-03-2012 at 05:56 AM.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  3. The Following 2 Users Say Thank You to .::SCHiM::. For This Useful Post:

    giniyat101 (07-03-2012),t7ancients (07-03-2012)

  4. #3
    t7ancients's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New York
    Posts
    381
    Reputation
    28
    Thanks
    68
    My Mood
    Twisted
    So, when I assemble code with NASM, will it make a difference if the bootloader is assembled with 'BITS 64'? Can a processor run x64 code while in real mode, or do I have to write some 16-bit code for the first part? Also, could I just use Code::Blocks? I have a much easier time with MingW than I do VC++. Thanks for answering, I don't know much in this area, but I want to learn so I can write a very basic OS. Would it be worthwhile to look at some open-source operating systems?

  5. #4
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    No you must first code in x16 and then switch to x64. The processor will interpret everything in x16 as x16 instructions. So you can't just let it run x64 code. If Code::blocks can generate independent C code that doesn't need a library to function, sure. If it can't then you're out of luck

    I don't know much about using linux for osdevving, I used windows so I can't help you there.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  6. #5
    t7ancients's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New York
    Posts
    381
    Reputation
    28
    Thanks
    68
    My Mood
    Twisted
    Code::Blocks uses MingW, a windows GCC port. I think I'll stick with assembly as much as possible though. I want to learn more with assembly anyway. Have you ever written code for microcontrollers? Also, if you know any good articles, books, or papers on assembly, I'd love to hear about it. >

  7. #6
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Yep, I've written code for the PIC and APIC, some code for the floppy disk controller and the keyboard controller. The only book on asm you'll ever need to read is:

    https://www.planetpdf.com/codecuts/pdfs/aoa.pdf

    It basically installs an assembler right into your brain

    But you'd better not stick with asm all the way, it'll be too hard to manage once you get further with your osdev.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  8. The Following 2 Users Say Thank You to .::SCHiM::. For This Useful Post:

    Hassan (07-05-2012),Saltine (07-03-2012)

  9. #7
    t7ancients's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New York
    Posts
    381
    Reputation
    28
    Thanks
    68
    My Mood
    Twisted
    Alright, thanks for all your help man, I've got plenty of stuff to read up on now. That book looks packed, I really appreciate it! I mentioned mcu's because I got a few dozen TI MSP430's, a launchpad dev board, and an arduino. I'm really interested in the low-level stuff more than anything. I got the arduino to work with a small LCD, but the class they have handles it all for you. Thanks again!

Similar Threads

  1. Writing your own C++ Trainer
    By l0ngcat in forum Game Hacking Tutorials
    Replies: 46
    Last Post: 03-06-2019, 10:29 PM
  2. Write here this verification please =(
    By EyalZamir in forum WarRock Korea Hacks
    Replies: 6
    Last Post: 05-13-2007, 11:45 AM
  3. Actually writing hacks.
    By shercipher in forum Programming
    Replies: 22
    Last Post: 03-20-2006, 04:31 AM
  4. teach program writing or creating to me?
    By Kirashima in forum Programming
    Replies: 3
    Last Post: 02-22-2006, 06:51 AM