I know that is hex. I'm fully aware. I know you add a h on the end of something in x86 assembly language. I actually think B8 is the mov instruction. It's a memory address, right?obiwac wrote:Thanks! Indeed there are a lot of bugs and unimplemented features. . 0xB800 is hexadecimal. You should also probably get used to that. It's quite important.john765 wrote:Thank you for the advice. By the way, I've tried out AquaOS. It's great. However, there are a few bugs (like when you go into some programs, the OS freezes). Is the shell being worked on because it doesn't work?obiwac wrote:Not to let you down or be mean or anything, but developing an os without any experience with C is probably not a good idea. You should start with smaller projects, so that you can gain experience, and then once you feel comfortable, start the ambitious project of making and os.
http://www.wikihow.com/Understand-Hexadecimal The 0x in C just means that what you write after will be considered as hexadecimal.
Good luck!
Where would I learn C and Assembly?
Re: Where would I learn C and Assembly?
-
- Member
- Posts: 307
- Joined: Wed Oct 30, 2013 1:57 pm
- Libera.chat IRC: no92
- Location: Germany
- Contact:
Re: Where would I learn C and Assembly?
The phrasing of this is really confusing to me. Yes, the primary opcode B8 moves a imm16/32 into eax. However, this is completely unrelated. Going back, apparently you extracted this value from Bare Bones. It is the address of the VGA video buffer. If you would have read the page that was linked to you, you'd be aware of that. Also, you didn't read Bare Bones thoroughly. It explains why 0xB8000 is relevant and what writing there does. Long story short: yes, it's a memory address, and it's completely unrelated to instruction encoding.john765 wrote:I actually think B8 is the mov instruction. It's a memory address, right?
I'm really picky about this: it depends on the syntax. If you use AT&T syntax (GAS uses this), yes. If you use Intel syntax (nasm, yasm), hex values are written C-Style with the '0x' prefix.john765 wrote:I know you add a h on the end of something in x86 assembly language.
You can learn that by reading. You've been pointed to the wiki, so use it. It's the best place to start. After that, some of the most valueable information is obtainable by reading specs and Linux or FreeBSD drivers.john765 wrote:StudlyCaps, the code in Bare Bones is insane. How did someone know how to do that? What do you have to read to make it run?
To pick up the title of this thread: you definitely shouldn't (and probably can't) learn C and Assembly on here or the wiki. There are resources dedicated to this, and osdev.org doesn't belong into that category for sure. Also, does this thread have anything to do with Operating System Development? My guess would be that this belongs into General Programming.
-
- Member
- Posts: 595
- Joined: Mon Jul 05, 2010 4:15 pm
Re: Where would I learn C and Assembly?
Back in the day when I was a cub I wanted to learn C, however in absence of literature (computer science books was hard to obtain back then) I got to lend a book "Peter Norton's Assembly Language Book for the IBM PC". The book uses an MS-DOS command "debug" which every MS-DOS is shipped with, a simple version of gdb. With that program the book actually goes through the basics and an interactive way and you get a hands on what happens. Despite it is old and uses 16-bit real mode I think that the basics of assembly language is still valid today. After you have read that book you will understand assembler language. This book is good for people who don't understand hexadecimal, 2-complement values, op-codes, registers and so on. If you have already the basics, you will not find the book that informative.
Then you can learn C. I'm not sure what order is the best C first or assembler first.
Then you can learn C. I'm not sure what order is the best C first or assembler first.
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Where would I learn C and Assembly?
You have it backwards, I'm afraid, though that isn't hard to do. GAS, being a distant descendant the original Unix assembler, uses the C '0x' prefix, while Intel's own assembler, and the Microsoft Macro Assembler (MASM), use the postfix 'h'. Most of the other x86 assemblers, such as NASM or FASM, can use either, though the C format is usually preferred.no92 wrote:I'm really picky about this: it depends on the syntax. If you use AT&T syntax (GAS uses this), yes. If you use Intel syntax (nasm, yasm), hex values are written C-Style with the '0x' prefix.john765 wrote:I know you add a h on the end of something in x86 assembly language.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
- MichaelFarthing
- Member
- Posts: 167
- Joined: Thu Mar 10, 2016 7:35 am
- Location: Lancaster, England, Disunited Kingdom
Re: Where would I learn C and Assembly?
And just to be awkward my assembler uses a dollar. I picked this up from Borland's Pascal and find it easier to type and easier to recognise.
Re: Where would I learn C and Assembly?
http://wiki.osdev.org/Printing_to_Screen seems hard. How do I do the parameter for write_string() function? In my main, do I do
or not?
Code: Select all
write_string(0x07, "Hello World!");
Re: Where would I learn C and Assembly?
Why not try it and see?
Re: Where would I learn C and Assembly?
It didn't work! what else could I use? Please help.iansjack wrote:Why not try it and see?
-
- Member
- Posts: 307
- Joined: Wed Oct 30, 2013 1:57 pm
- Libera.chat IRC: no92
- Location: Germany
- Contact:
Re: Where would I learn C and Assembly?
Oops, appears that I've messed up there. It's the other way around, of courseSchol-R-LEA wrote:You have it backwards, I'm afraid, though that isn't hard to do. GAS, being a distant descendant the original Unix assembler, uses the C '0x' prefix, while Intel's own assembler, and the Microsoft Macro Assembler (MASM), use the postfix 'h'. Most of the other x86 assemblers, such as NASM or FASM, can use either, though the C format is usually preferred.
Lesson: never write forum posts after more than a day's worth of work.
Re: Where would I learn C and Assembly?
Honestly, the Bare Bones tutorial is about as simple as it gets.john765 wrote:It didn't work! what else could I use? Please help.iansjack wrote:Why not try it and see?
You are coming over as wanting hand-holding through the process of writing an OS. It's just not going to happen; there's too much to learn, and this isn't a site for programming beginners.
I think you need to learn how to use C and assembler by writing simple user programs before you get into the relatively advanced world of OS development.
I don't mean to be rude, just realistic.
Re: Where would I learn C and Assembly?
I know C and Assembly.iansjack wrote:Honestly, the Bare Bones tutorial is about as simple as it gets.john765 wrote:It didn't work! what else could I use? Please help.iansjack wrote:Why not try it and see?
You are coming over as wanting hand-holding through the process of writing an OS. It's just not going to happen; there's too much to learn, and this isn't a site for programming beginners.
I think you need to learn how to use C and assembler by writing simple user programs before you get into the relatively advanced world of OS development.
I don't mean to be rude, just realistic.
Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane. I am in reality by the way. It is my option.
That's like judging on my religion. I want to waste my life on OSDev. Otherwise, I wouldn't come here.
- eryjus
- Member
- Posts: 286
- Joined: Fri Oct 21, 2011 9:47 pm
- Libera.chat IRC: eryjus
- Location: Tustin, CA USA
Re: Where would I learn C and Assembly?
john765 wrote:I want to learn C and Assembly
In just over 24 hours....john765 wrote:I know C and Assembly.
Adam
The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal
"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal
"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
Re: Where would I learn C and Assembly?
How to win friends and influence people.john765 wrote:Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane. I am in reality by the way. It is my option.
That's like judging on my religion. I want to waste my life on OSDev. Otherwise, I wouldn't come here.
It's your option; it's your religion; it's your choice. So just do it.
Re: Where would I learn C and Assembly?
You just said "It didn't work!". As smart as iansjack is, I don't think that he has any telepathic abilities. Maybe if you weren't so rude and actually put some effort in yourself, you'd get some better help.john765 wrote:Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
Compiler Development Forum
- obiwac
- Member
- Posts: 149
- Joined: Fri Jan 27, 2017 12:15 pm
- Libera.chat IRC: obiwac
- Location: Belgium
Re: Where would I learn C and Assembly?
I really hope this isn't going the luca1 way.
http://forum.osdev.org/viewtopic.php?f= ... 83#p273583
And yes, you are entitled to your opinion. Were just giving advice.
http://forum.osdev.org/viewtopic.php?f= ... 83#p273583
And yes, you are entitled to your opinion. Were just giving advice.